Your original post states that you did this on a WRT54G v1.1, but your port number was switched to a newer version. What do you mean? What is your port numbering scheme? I'm a newbie at all this, though I've been using DD-WRT for quite a while on both my routers.
Could you post the updated revised coding please. You added in VLAN3 but was in assumption that VLAN2 already there, which you defined earlier. The simplification of SNAT suggested by vhoang also not clear to noob like me for replacing which lines of your codes.
I am so happy to find this thread. Thanks to jbarbieri for all the work and the detailed explanation.
I'm interested in trying this. In my case, I have two PCs on the LAN that are using Internet Connection Sharing. They are connected to the WANs, via Sprint Mobile Broadband Cards.
I planned to statically number the router and the shared PCs as 192.168.0.1-3. I will then connect the rest of the LAN to these machines via the WET54G with the scripts provided.
However, I am unsure how to modify the scripts to handle that fact. While the PCs have static IPs, the actual WAN address is handled by the gateway PCs, not the router. The script wants to know the WAN network infomation, which changes if a PC reboots or its broadband device disconnects and reconnects.
In this situation, what do I do with the WAN parameters in the script?
Joined: 21 Jul 2006 Posts: 1898 Location: Fortaleza Ce Brazil
Posted: Thu Oct 11, 2007 8:23 Post subject:
Great JOB ..
But if i have 2 bufallos WHR HP54 G , how can i link the wires ? Which Lan ports a use to link each one ? I am think to use one with Dsl and other with cable ISP . _________________ DDwrt ...it rocks ....
1 R7800 54420 AP Wireguard webserver JFFS SAMBA FTP usb HD Mesh
1 R7800 54420 Cli Mesh
1 WZR1750 54389 AP Webserver Samba Wireguard
1 TP link Archer C7v5 54420 Cli Mesh
1 DD x86_64 48296 Gateway Samba Ftp Webserver
For those of you who would like to have DHCP assigned network parameters from ISPs on WAN, DD-WRT includes DHCP client udhcpc (brief manual here). Well, at least version "v23 SP2 (09/15/06) voip" does
For example, for vlan3 you can try it out like so (via telnet or on the Administration | Commands | Command Shell):
Code:
udhcpc -i vlan3 -q
which should get network parameters (IP, network address, gateway..) by issuing a DHCP request over interface vlan3. (-q means quit after getting the answer).
Unfortunately, the udhcpc does just the request, it does not make any configurations of the interface in question automatically, but instead it can call a script which does that. Basicly, this script normally calls ifconfig to configure the interface properly. I noticed here on the forum that the script is called "udhcpc" or "udhcpc.sc", but I cannot find it on my router (it probably shows up if you set DHCP mode for the first WAN port; I have PPPOE on it, so...). Well, its basic content is
Code:
#!/bin/sh
# udhcpc script edited by Tim Riker <Tim@Rikers.org>
[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
-p option notes the udhcpc process ID (?), and -s points to the above script. As you can see, the script provides also for the DHCP release; udhcpc client stays resident.
This is only a description how the DHCP on WAN can be made, some more work should be done for a nice general how-to wiki, and combine it with jbarbieri work (as you can see, the above script can do some additional configuration besides ifconfig, like updating the routing tables when network parameters become known).
Great job jbarbieri.
Have you any thought about failover script?
A little script which pings the gateways on each VLAN interface. If a ping on one of those gateways fails the routing rules could be switched dynamically.
It would be great if have some spare time to explain your scripts a bit (why do the packets have to be mangled by iptables? Why are spoof interfaces necessary using iptabels?). Some words about the ip route lines would be great as well.
Very neat shit you got there.
I can only imagine what your downloads will be if you ever got three
verizon Fios 50 Megabit connections and did this! Although, I guess
you would have to use a gigabit router to do this since two 50 megabit
internet connections would be maxing out the Ethernet chipset!
Joined: 26 Jun 2006 Posts: 75 Location: окружающий мир
Posted: Sat Nov 10, 2007 16:11 Post subject:
HI!
I read your post 20 times about your dual wan config ... but understood nothing
Tried it 2 times but it did not work for me.
I am using a wrt54g v2.2 v24rc4 should i try it with v23sp2 ???
I got as you 2 lines from my isp -> one on 10.0.0.1 (gw) and the another on 192.168.0.1 (gw)
First I tried to setup a vlan to port 4 ->
telneted into router and copied the nvram ... to nvram commit script into the console ...
but I saw nothing which changed in the routers vlan config --> webinterface.
this should be the fault I think but there are more thing I need to knwo.
I connect ISP1 to the WAN Port and the WAN2 to Port4 and my PC to Port 1-3 right?
What should I change in this line?
ifconfig vlan2 216.yyy.yyy.132 netmask 255.255.255.0 broadcast 216.yyy.yyy.255 up
to
ifconfig vlan2 192.168.0.132 netmask 255.255.255.0 broadcast 192.168.0.255 up
???
Right?
How do I change the Vlan settings or what should it look like - in webinterface ?
Thank you and PLEASE help me
I tried many dual wan routers from my friends but nothing worked the right way I needed ... the last I tested was a netgear ... Never buy such routers ... they do not work on dual wan ... for long time.
Okay written too much and asked too much but hopefully you can help me ... and Thank you for your Posting REALLY NICE JOB...