11

**HOW-TO** Half-Bridge for Public IP on firewall/router device behind Modem/Router with Netgear DG834GT

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
EOF

cat <<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/sh

IFC=/sbin/ifconfig
IPT=/usr/sbin/iptables
RTE=/sbin/route

WIF=ppp0
LIF=br0

iKx=$($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!

This entry was posted in ADSL, Networking. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

11 Comments

  1. Rob Young
    Posted August 19, 2009 at 3:03 pm | Permalink

    Thanks for your info. Have downloaded your image and loaded into router, and the WAN details now are blanked apart from the gateway.

    Not sure what the attached PC/device should be doing to make use of the DG834 in this mode. Should it make regular network connection to router, should it be running software to terminate the ISP circuit using PPPoE or PPPoA. Not getting any Internet access or seeing any Internet traffic coming towards PC on the RJ45 with Wireshark.

    Browsing on Half-Bridge router mode I read that it changes DHCP server in the router so that it issues short leases and once an ISP link is up it re-assigns DHCP lease for PC to the IP of the WAN. This means router supports only 1 connected device. Is that what your script mods achieve?

  2. admin
    Posted September 26, 2009 at 7:03 pm | Permalink

    Hi Rob,

    Sorry for the delay – Hadn’t been on here in a while as I’ve been extremely busy.

    In my particular setup I had added static routes on the router/firewall device behind the DG834. Off the top of my head I believe it may have been as simple as:

    route add -net **ISP GATEWAY IP** netmask 255.255.255.255 dev eth0
    route add default gw **ISP GATEWAY IP**

    You may or may not need to do the above – my setup was slightly different as it was actually a secondary gateway.

    Hope this helps though it may be too late by now!

  3. Posted November 16, 2009 at 2:32 am | Permalink

    I’m interested in this firmware, partly because I have a DG834GT as my spare modem and it’d be lovely to be able to just slot it in in place of my ailing Speedtouch 585v7 (supplied by my ISP).

    My ISP only uses EthoA, but most ISPs in the UK use PPPoA due to BT’s platform restrictions (PITA too). My friend tried this firmware using a WRT54GL flashed with DD-WRT, and he reported that it connected for a few seconds then disconnected and wouldn’t reconnect (showing everything as Disconnected).

    Unfortunately I can’t see his set up to directly check, but something’s afoot… When he uses the device directly as a modem/router, it does function ok, but my DT834GT experience is severely limited.

    Do you have any pointers for fellow brave souls willing to give your cooked fw a go? ;)

  4. Adam
    Posted March 13, 2010 at 9:23 am | Permalink

    hello could you create a new version of the custom firmware using dgteams latest build.

  5. admin
    Posted March 13, 2010 at 3:57 pm | Permalink

    Hello,

    I’ve only just noticed the new release, thanks for pointing it out.

    I will be giving this firmware a try today but from the looks of things my modification may no longer be needed! Nice!

  6. admin
    Posted March 13, 2010 at 4:00 pm | Permalink

    Hello,

    I’m not sure you’d have to use my cooked version with BE / O2. It would most likely break things like you said.

    Have you tried looking on the BE Usergroup Technical Wiki for help?

    p.s. I now use O2 myself but haven’t tried to bridge yet.

  7. Adam
    Posted March 14, 2010 at 9:51 am | Permalink

    how can i setup the new firmware in half bridge mode then? i need to use pppoa to connect to my isp, and my Billion 7402nx can only do pppoe in Ewan mode and some other modes.

  8. Adam
    Posted March 15, 2010 at 5:53 pm | Permalink

    there’s a new section in the firmware for scripts. could you list just the script.

  9. Adam
    Posted March 17, 2010 at 12:18 am | Permalink

    im a noob when it comes to scripting routers. can someone help please.

  10. Adam
    Posted March 24, 2010 at 11:07 pm | Permalink

    is anyone there?

  11. Smudge
    Posted April 1, 2010 at 12:36 pm | Permalink

    Hi, did you manage to get the half-bridge working with the new firmware? Thanks.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>