Dual / Triple WAN HowTo | DHCP scripts on Page 5!!!!

Post new topic   This topic is locked: you cannot edit posts or make replies.    DD-WRT Forum Index -> Broadcom SoC based Hardware
Goto page Previous  1, 2, 3, ... 66, 67, 68  Next
Author Message
cody206
DD-WRT Novice


Joined: 14 Aug 2007
Posts: 1

PostPosted: Tue Aug 14, 2007 0:55    Post subject: Reply with quote
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.
Sponsor
jbarbieri
DD-WRT Guru


Joined: 06 Apr 2007
Posts: 545
Location: New Hampshire

PostPosted: Tue Aug 14, 2007 20:53    Post subject: Reply with quote
I used what is in the first post on my WRT54g 1.1

1 2 3 4 all respond to the same #'d ports

and 5 is the wan port.



Or at least, thats how its working for me........

_________________


Linksys EA6500v2 | 5GHz 1st Floor AP | Advanced Tomato 1.28.0000 -2.9-131 K26ARM USB AIO-64K
Netgear WNR2000v3 | 2nd Floor AP | DD-WRT v3.0-r27805 std

Behind a Raspberry Pi Dual WAN router
rhijaen
DD-WRT Novice


Joined: 31 May 2007
Posts: 11

PostPosted: Wed Aug 15, 2007 10:36    Post subject: Reply with quote
Hi,

Trying to set up dual wan on my Buffalo whr-hp-g54...

I used the scripts in your updated post (the one a few posts down)...

Also used the

Code:

nvram set vlan0ports="0 1 2 5*"
nvram set vlan2ports="3 5"
nvram set vlan2hwname=et0
nvram commit
reboot


Rebooted the router...the weird thing was that I couldn't connect to anything, but my torrents still worked fine.

Any ideas?

EDIT: 2nd try...couldn't connect to anything besides the router's config page...
KK
DD-WRT User


Joined: 08 Jun 2006
Posts: 72

PostPosted: Wed Aug 15, 2007 14:08    Post subject: Reply with quote
This Wiki explained quite well about the WRT54G configuration
http://www.dd-wrt.com/wiki/index.php/Default_Configuration_Overview

This one explained the port numbering:
http://www.dd-wrt.com/wiki/index.php/Switched_Ports
KK
DD-WRT User


Joined: 08 Jun 2006
Posts: 72

PostPosted: Wed Aug 15, 2007 14:27    Post subject: Reply with quote
jbarbieri,

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.

Thanks a million and great job done.
steeven
DD-WRT Novice


Joined: 25 Sep 2007
Posts: 32

PostPosted: Thu Sep 27, 2007 3:22    Post subject: Reply with quote
hi, my router working in repeater mode with autoap scripts. is it possible to make my adsl model share?
steeven
DD-WRT Novice


Joined: 25 Sep 2007
Posts: 32

PostPosted: Fri Sep 28, 2007 0:26    Post subject: Reply with quote
the router has been configured to repeater mode, firewall was disableed.
will it work if I ignore the iptables section?
djinks
DD-WRT Novice


Joined: 10 Oct 2007
Posts: 10

PostPosted: Wed Oct 10, 2007 19:43    Post subject: Reply with quote
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?
stalonge
DD-WRT Guru


Joined: 21 Jul 2006
Posts: 1898
Location: Fortaleza Ce Brazil

PostPosted: Thu Oct 11, 2007 8:23    Post subject: Reply with quote
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
eftomi
DD-WRT Novice


Joined: 19 Jun 2007
Posts: 8

PostPosted: Thu Oct 11, 2007 10:24    Post subject: Reply with quote
Thanks jbarbieri for these excellent tips!

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 Smile

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

RESOLV_CONF="/etc/resolv.conf"
[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
[ -n "$subnet" ] && NETMASK="netmask $subnet"

case "$1" in
   deconfig)
      /sbin/ifconfig $interface 0.0.0.0
      ;;

   renew|bound)
      /sbin/ifconfig $interface $ip $BROADCAST $NETMASK

      if [ -n "$router" ] ; then
         echo "deleting routers"
         while route del default gw 0.0.0.0 dev $interface ; do
            :
         done

         for i in $router ; do
            route add default gw $i dev $interface
         done
      fi

      echo -n > $RESOLV_CONF
      [ -n "$domain" ] && echo search $domain >> $RESOLV_CONF
      for i in $dns ; do
         echo adding dns $i
         echo nameserver $i >> $RESOLV_CONF
      done
      ;;
esac

exit 0


and udhcpc should be called within the startup script like so:

Code:

udhcpc -i vlan3 -p /var/run/udhcpc.pid -s /tmp/udhcpc


-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).
ghost48
DD-WRT User


Joined: 07 Jun 2006
Posts: 51

PostPosted: Thu Oct 11, 2007 10:33    Post subject: Reply with quote
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.
SirSilentBob
DD-WRT User


Joined: 09 Oct 2007
Posts: 258

PostPosted: Thu Oct 11, 2007 12:45    Post subject: Wow Reply with quote
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!

But if you did do it, then holy shit!
The -e(i*pi)
DD-WRT Novice


Joined: 12 Oct 2007
Posts: 37

PostPosted: Wed Nov 07, 2007 10:44    Post subject: Reply with quote
I am limited to .364k upload bandwidth by my "ISP" but I can get as many connections as I want as it is limited by mac address only.

I have a P4 2.8 ghz 384 MB DDR RAM with 4 nics so far (3 WAN, and 1 LAN)

That being said, I have a few 16 port switches so I can get as many interfaces as I can fit in my box on the network.

Is there any way to do this with only one network card that will act as like 10 different NICs each with its own MAC and DHCP address.

If not, thats ok, I can just either get a BUNCH of USB adapters off newegg ($15 ea), or a few 2 or 4 port NICs ($170/$420)

Now can you do it for N WAN interfaces? where N is large, like 5-10.

also, i will probably mess up my router so is there any reset button on desktops like there is on the normal routers?
The -e(i*pi)
DD-WRT Novice


Joined: 12 Oct 2007
Posts: 37

PostPosted: Wed Nov 07, 2007 14:02    Post subject: Reply with quote
I think the linksys ones maxes out at 20mbps approx

PCI busses have approx 1 gbit total bandwidth so 500mbps on 2 ports would max it out, but it should be much much lower for the real value.
loom2005
DD-WRT User


Joined: 26 Jun 2006
Posts: 75
Location: окружающий мир

PostPosted: Sat Nov 10, 2007 16:11    Post subject: Reply with quote
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...

Hope to hear from you soon

Steve
Goto page Previous  1, 2, 3, ... 66, 67, 68  Next Display posts from previous:    Page 2 of 68
Post new topic   This topic is locked: you cannot edit posts or make replies.    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum