Want to use your own router/firewall device on an ADSL service with just 1 public IP? Can’t do this because you are forced to use PPPoA?
Here is the solution to this problem for Netgear DG834GT users though it should work fine with mostly any DG834 based router.
You can download our pre-made image here.
The credit for this cannot go entirely to myself – it is compiled from various sources and is based on the half-bridge script from RouterTech firmware. Thanks to both DGTeam and RouterTech for the nice firmwares they release.
As always, if you can add to or improve on this your comments are welcome!
Note: We have mirrored the sources in our downloads section for convenience but please download the latest copy from DGTeam!
First, download and untar DGTeam firmware:
wget http://modernadmin.com/downloads/firmware/netgear/DG834GT/DG834GT_V1.02.16_DGTeam_0848_sources.tar.bz2
tar xjf DG834GT_V1.02.16_DGTeam_0848_sources.tar.bz2
cd DG834GT_V1.02.16_DGTeam_0848_sources
tar xjf target_dgteam.tar.bz2
Add our half-bridge script:
mkdir target_dgteam/usr/etc/ppp
cat <<EOF > target_dgteam/usr/etc/ppp/ip-up
#!/bin/sh
/bin/cp /proc/uptime /tmp/wan_uptime
/usr/sbin/rc service restart
#/bin/cp /proc/uptime /tmp/wan_uptime
/bin/cp /usr/etc/ppp/ip-down /etc/ppp/
/bin/echo g5on > /proc/led
/usr/sbin/hbStart.sh
EOFcat <<EOF > target_dgteam/usr/etc/ppp/ip-up-demand
#!/bin/sh
/bin/cp /proc/uptime /tmp/wan_uptime
/usr/sbin/rc service restart
/bin/cp /usr/etc/ppp/ip-down /etc/ppp/
/bin/echo “/usr/sbin/atm_monitor” >>/etc/ppp/ip-down
/bin/echo g5on > /proc/led
/usr/sbin/hbStart.sh
EOF
add to target_dgteam/usr/sbin/hbStart.sh:
cat <<EOF > target_dgteam/usr/sbin/hbStart.sh
#!/bin/shIFC=/sbin/ifconfig
IPT=/usr/sbin/iptables
RTE=/sbin/routeWIF=ppp0
LIF=br0iKx=$($IFC $WIF|grep inet)
iKMK=${iKx#*k:}
iKx=${iKx#*r:};WIP=${iKx%% *}
iKx=${iKx#*P:};GW=${iKx%% *}$IFC ${WIF:=ppp0} 0.0.0.0
$RTE add -host $WIP dev $LIF
$RTE add -host $GW dev $WIF
$RTE add default gw $GW/bin/echo “1″ >/proc/sys/net/ipv4/conf/$WIF/proxy_arp
/bin/echo “1″ >/proc/sys/net/ipv4/conf/$LIF/proxy_arp
EOF
Set permissions:
chmod +x target_dgteam/usr/sbin/hbStart.sh
Lastly, Pack firmware image:
./create_target.sh 1.02.16 GT
./build_dgteam.sh 1.02.16 GT
You should now find the .img file in the current folder like follows: DG834GT_V1.02.16_DGTeam_0921.img
Enjoy!