HALF-BRIDGE mode in Routertech 2.2/2.3 UPDATED using 2.9+

All about firmwares for routers. Support for RouterTech firmwares is here too.
legume
Experienced
Experienced
Posts: 101
Joined: Fri Apr 13, 2007 11:57 pm

Post by legume » Thu Jun 14, 2007 7:30 pm

Better fire up the pctool then
I'll give it a go when I get a chance.

Andy.
TopCat
Newbie
Newbie
Posts: 1
Joined: Thu May 27, 2010 7:47 pm

Re: HALF-BRIDGE mode in Routertech 2.2/2.3 UPDATE 3

Post by TopCat » Fri May 28, 2010 6:22 pm

Holy drats, you saved me life.

I bought the wrong equipment for PPPoA and I thought my family were going to kill me, that is until I found routertech and pppHB!

My only criticism is it seems you've done your very best to hide this information from the world. It took quite alot of searching through google, then searching through routertech to find this documentation. (unless I'm just an idiot :lol:)

Cheers,

Michael :D
mstombs
RouterTech Team
RouterTech Team
Posts: 3753
Joined: Wed Jan 10, 2007 11:54 pm

Re: HALF-BRIDGE mode in Routertech 2.2/2.3 UPDATE 3

Post by mstombs » Fri May 28, 2010 7:05 pm

Sorry, this is an old thread but the script in the firmware hasn't been changed for some time, I assumed not many users!

I still use it, and have only recently got versions of Tomato and dd-wrt to fix their WAN routing code to accept the /32 IP address and out of net gateway so they don't need firewall scripts to path their routing when the 'modem' is configured in "no firewall mode".

I've never added GUI integration, and don't like the time taken for a new WAN IP to be propagated when my DSL goes down and recovers.

Also I often forget - don't save the config or attempt firmware upgrades when in half-bridge mode...
mstombs
RouterTech Team
RouterTech Team
Posts: 3753
Joined: Wed Jan 10, 2007 11:54 pm

Re: HALF-BRIDGE mode in Routertech 2.2/2.3 UPDATE 3

Post by mstombs » Wed Jun 02, 2010 11:28 pm

hi, i just started to use yr half bridge script, the manual 1, located @ viewtopic.php?f=3&t=1189 , it work great, i love it. however, i am on a 1ip connection, sometimes, i use the connection myself, i use the script, some other times, when i have to share the connection via router wifi, i need to reconnect my connection, becoz i dont know how to revert everything back to normal with command manually, can u pls teach me how to do it? thx in adv.
The half-bridge mode can be started from a Telnet/ssh session, or probably the Web Gui run_command, but during the reconfiguration the connection gets broken. I developed the script using serial console to see the messages!

Except when hacking the 'modem' I still use half-bridge, with a single dynamic PPPoA IP address, using a env entry

Code: Select all

pppHB.sh        init -nofw -v -s 60
Note this is the "purest" form of half-bridge the modem just "routing" without "nat firewall", but many routers need help working with this.

To change things back or do a firmware upgrade, I connect again and issue

Code: Select all

pppHB.sh exit
Again the connection gets broken, and the WAN (PPPoA) is reconnected.

I'm sure it would take much to make it work in PPPoE mode, but no point because PPPoE users can run in FULL Bridge mode to a router

Without the "-nofw" or "-nonat" flags the modem should continue act as an Internet Gateway router for local IP addresses (including the modem itself), but the dhcp server is hijacked to pass on the single true WAN IP, so any local clients would have to have static local IP addresses using the modem lan IP address as their gateway. The modem still does connection tracking but not quite 'double nat' on comms to/from the wan IP (held by device on lan).
how to revert back and multiple ip setup? about the multiple ip setup, does it work for static ip, pppoa, 1 ip for router, 1 ip for client connection.
If you have a single static PPPoA address, you should be able to run with "-nodhcp", manually giving the static WAN IP to your router, leaving local lan dhcp for lan clients untouched. This mode was simulated a log time ago - but not used recently. Static IPs tend to come in small ranges and users can use no-nat mode without resorting to half-bridge. There was some discussion about using half-bridge with a range of IP addresses, and yes it is theoretically possible for the modem not to have a real WAN IP address itself, and a form of this script could help.

Certain D-Link and Linksys have a form of half-bridge called ZipB or IP extension that allows a real WAN IP to be held both by the router and a lan device. This uses kernel hacks to hide interfaces from the kernel which I have seen code examples, but it causes various problems and could affect normal operation for other users.

The half-bridge code in RouterTech firmware has been left as a reconfiguration script, so if you don't need it - it just wastes a few kB of flash. If you use it from command line any actions are only temporary, and will be wiped by power cycle.
PANiCnz
Newbie
Newbie
Posts: 2
Joined: Sat Apr 24, 2010 7:24 am

Re: HALF-BRIDGE mode in Routertech 2.2/2.3 UPDATED using 2.93

Post by PANiCnz » Wed Jul 28, 2010 7:46 am

Hi,

Ran the above script and am not having a lot of luck. The external IP address is passed to the router but the internet is not accessible. I've had the router previously running with a different modem in half-bridge mode so know the router is not the issue.

The executed the following code at command line as described:

Code: Select all

pppHB.sh        init -nofw -v -s 60
I have a single dynamic PPPoA IP address

Thks
mstombs
RouterTech Team
RouterTech Team
Posts: 3753
Joined: Wed Jan 10, 2007 11:54 pm

Re: HALF-BRIDGE mode in Routertech 2.2/2.3 UPDATED using 2.93

Post by mstombs » Wed Jul 28, 2010 9:25 am

What router? - see comments re old versions of Tomato/dd-wrt etc needing extra firewall commands to accept the Gateway not in network defined by IP address and netmask.
PANiCnz
Newbie
Newbie
Posts: 2
Joined: Sat Apr 24, 2010 7:24 am

Re: HALF-BRIDGE mode in Routertech 2.2/2.3 UPDATED using 2.93

Post by PANiCnz » Thu Jul 29, 2010 2:06 am

mstombs wrote:What router? - see comments re old versions of Tomato/dd-wrt etc needing extra firewall commands to accept the Gateway not in network defined by IP address and netmask.
I'm using IPFire which I believe is a Smoothwall fork, will look into the earlier comments and see if it helps. Cheers
Ralph
Newbie
Newbie
Posts: 5
Joined: Mon Feb 14, 2011 8:07 pm

Re: HALF-BRIDGE mode in Routertech 2.2/2.3 UPDATED using 2.9

Post by Ralph » Wed Feb 16, 2011 2:30 pm

Sorry to revive an old thread but I'm thoroughly confused by the instructions...

After many hours googling and tinkering I've managed to get routertech onto my ADSL2MUE and onto the internet and I'm rather impressed by the results, good work there guys! However I want to plug it into a WRT54GS v7 running DD-WRT.

I've followed all the steps in mstombs first post to no avail, to be honest I'm a little confused as to which information is current as his other post (which has an attachment expanding on the first post) is labelled as obsolete.

Assuming the first post is up-to-date I don't understand step e:

e. You can now manually set the WANIP on your PC/router as its IP address, and specify the modem IP address as the gateway 192.168.1.1 and it should all work. The next 2 steps allow you to also use the ISP supplied gateway, access to the modem still works as everything is routed through it.

"You can now manually set the WANIP on your PC/router as its IP address"
What does its refer to? The modem, the router, talktalk's WANIP or something else?

and secondly "and specify the modem IP address as the gateway 192.168.1.1"
What do I do here? Do I set my modem IP to 192.168.1.1 or set the gateway field on my router to the modem's IP address. Presumably the modem IP is the address it had in the first place before I started trying to bridge it?

For reference
My modem is 192.168.1.4
My router is 192.168.1.2

Step h then seems to contradict step e

h) Set the ISP supplied IP, netmask and gateway on your PC or router. NB windows XP does not allow you to manually enter 255.255.255.255 as the netmask, you can use 255.255.255.0, which is what some manufacturers half-bridge does, the only downside is that you will not be able to connect to similar IP addresses because you have told windows they are local, not out on the internet.

So I then change DD-WRT to TalkTalk's settings? Incidentally DD-WRT doesn't permit 255.255.255.255.

Any pointers?

TIA
mstombs
RouterTech Team
RouterTech Team
Posts: 3753
Joined: Wed Jan 10, 2007 11:54 pm

Re: HALF-BRIDGE mode in Routertech 2.2/2.3 UPDATED using 2.9

Post by mstombs » Wed Feb 16, 2011 10:37 pm

I haven't read the instructions for a while, and since I wrote them I read what I expect to see!

The latest version should be in a readme "ppphb.txt" in the firmware download package - it hasn't changed for a while.

I still use a similar combination (with TalkTalk), but with Tomato on the wrt54gs, but have worked with dd-wrt and recent 'pre sp2' dd-wrt builds should work fine with the IP/netmask/gateway set by the modem in 'true halfbridge' mode, older versions need a simple firewall script in dd-wrt.

Firstly your wrt54gs router must use a different local lan IP address range to the modem lan range, or the dd-wrt router will get confused what is wan and lan. Both probably use 192.168.1.1 as default, I suggest changing modem to 192.168.2.1. I also change router to 192.168.0.1 because when you are hacking different routers that leaves the default 192.168.1.1 available! Probably need a direct connection to modem - also set the lease time to 60 seconds while you are there - allows dhcp changes to be propagated fairly quickly.

Firstly you should set up dd-wrt in dhcp wan configuration - it should then get internet access through modem in "double nat" mode. It will have a local IP as WAN port address which will break incoming port forwards etc - but basic internet browsing and access to the modem web gui should work fine.
Ralph
Newbie
Newbie
Posts: 5
Joined: Mon Feb 14, 2011 8:07 pm

Re: HALF-BRIDGE mode in Routertech 2.2/2.3 UPDATED using 2.9

Post by Ralph » Thu Feb 17, 2011 11:59 pm

Cheers mstombs, I'll have to try this next week when I get some free time!

I appreciate the help!
Ralph
Newbie
Newbie
Posts: 5
Joined: Mon Feb 14, 2011 8:07 pm

Re: HALF-BRIDGE mode in Routertech 2.2/2.3 UPDATED using 2.9

Post by Ralph » Tue Feb 22, 2011 8:39 pm

Right, I've got it working with 'double NAT'. All I did was change the subnet as per mstombs suggestion.

But I run

Code: Select all

pppHB.sh init -nofw -v -s 60
and it does this (see bottom of post) and the internet vanishes. Is this a configuration problem on the modem or the router? I upgraded to the 'recommended' version of DD-WRT, that is DD-WRT v24-sp2 (10/10/09) micro - build 13064 and wiped the memory.

Settings on DD-WRT that have been changed from the default are:-

Setup -> Basic
WAN Connection Type: "Automatic Configuration - DHCP"*
Local IP: 192.168.0.1 (modem is on 192.168.1.1)
DHCP Server: enabled
Client lease time: 1 minute

*if I change this to PPPoE and fill in the details, nothing changes.

I haven't change the following, are they required?
Setup -> Advanced Routing
Operating mode: Gateway (this is default) the alternative is router

Services -> Services
DHCP Server
Used Domain: WAN the alternative is WAN & LAN

Code: Select all

root: pppHB.sh: No Firewall
root: pppHB.sh: VerBose logging enabled
root: pppHB.sh: Start Delay: 60
command: IT
root: pppHB.sh: Pausing for 60 seconds as requested
root: pppHB.sh: Configuring, please wait...
root: pppHB.sh: /sbin/ifconfig ppp0 0.0.0.0
root: pppHB.sh: udhcpd started with conf /var/tmp/pppHBdhcpd.conf
root: pppHB.sh: /sbin/route add -host 89.168.172.43 dev br0
root: pppHB.sh: /sbin/route add -host 89.168.160.1 dev ppp0
root: pppHB.sh: /sbin/route add default gw 89.168.160.1
User command: pppHB.sh init -nofw -v -s 60
Thanks for your help
mstombs
RouterTech Team
RouterTech Team
Posts: 3753
Joined: Wed Jan 10, 2007 11:54 pm

Re: HALF-BRIDGE mode in Routertech 2.2/2.3 UPDATED using 2.9

Post by mstombs » Tue Feb 22, 2011 11:18 pm

Did you set the short lease time in the modem, before issuing that pppHB.sh command? The one in dd-wrt applies to its lan.

Don't try PPPoE in the dd-wrt router - you need a DrayTek Vigor with PPPoA to PPPoE conversion in the modem to enable that!

The dd-wrt fix for wan port routing where gateway is not in subnet wasn't implemented until about dd-wrt testbuild 14428, May 2010 so for the version you have will need the following script in dd-wrt firewall script, added via web gui.

Code: Select all

GW=$(nvram get wan_gateway)
IF=$(nvram get wan_iface)
route add -host $GW dev $IF
route add default gw $GW
Do also check with the "peacock thread" http://downloads.dd-wrt.com/phpBB2/view ... hp?t=51486 and its comments about the database "recommended" firmware
Ralph
Newbie
Newbie
Posts: 5
Joined: Mon Feb 14, 2011 8:07 pm

Re: HALF-BRIDGE mode in Routertech 2.2/2.3 UPDATED using 2.9

Post by Ralph » Wed Feb 23, 2011 1:58 pm

mstombs wrote:Did you set the short lease time in the modem, before issuing that pppHB.sh command? The one in dd-wrt applies to its lan.
Er, no, I'll sort that.
mstombs wrote:Do also check with the "peacock thread" http://downloads.dd-wrt.com/phpBB2/view ... hp?t=51486 and its comments about the database "recommended" firmware
Lol, the DD-WRT website confuses the hell out of me (and I'm reasonably computer literate) with endless ramblings and constant switching between articles. I'm writing a guide (for myself) on doing this if I ever need it again, I'll put it online when I get everything working as so many little steps are spread over so many websites, forums and wikis.

Thanks again mstombs.
Ralph
Newbie
Newbie
Posts: 5
Joined: Mon Feb 14, 2011 8:07 pm

Re: HALF-BRIDGE mode in Routertech 2.2/2.3 UPDATED using 2.9

Post by Ralph » Sat Feb 26, 2011 12:24 pm

Right so DD-WRT is upgraded and everything is dandy and PPPHB works a treat. However, when I power cycle my modem PPPHB goes, it returns to running NAT and DHCP, if I setup PPPHB again click Save All and then power cycle it keeps the NAT and DHCP settings but doesn't run in half bridge mode.

Is there a way to get it to stay permanently in half-bridge?

I'm so close!
User avatar
thechief
RouterTech Team
RouterTech Team
Posts: 12067
Joined: Wed Feb 01, 2006 10:22 pm
Location: England, the Centre of Africa
Contact:

Re: HALF-BRIDGE mode in Routertech 2.2/2.3 UPDATED using 2.9

Post by thechief » Sat Feb 26, 2011 12:28 pm

The Chief: :afro: Be sure to read the Firmware FAQ and do a Forum Search before posting!
No support via PM. Ask all questions on the open forum.
Post Reply