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 ... 57, 58, 59 ... 66, 67, 68  Next
Author Message
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10141

PostPosted: Wed Apr 01, 2009 18:51    Post subject: Reply with quote
corotte wrote:
but i don't know how to map a port range like the upper script ?


Use colons to indicate a range and you can use it in conjunction with commas.

-m multiport --destination-ports 500,4500:4510,52428
Sponsor
yzy-oui-fi
DD-WRT Guru


Joined: 03 Mar 2009
Posts: 2826
Location: France

PostPosted: Wed Apr 01, 2009 21:58    Post subject: Reply with quote
hi,

do you have expériences using thoses settings with a router set as "Client" or "Repeater"? :shock:

I mean Wan1->Wireless / Wan2-> RJ45 Ethernet

B.R.


P.S: Please excuse my english....I'm french! Very Happy

_________________
DD-WRT WDS MESH + DASHBOARD (fr), DD-WRT network setting tool (tools.yzy-oui-fi.com), Wifi Business and IT guy After hours, My Blog, Free DD-WRT VPN Community(www.wrt-pptp-ww.com), DD-WRT pré-réglés pour réseau outdoor(hotspot.yzy-oui-fi.com), Nouveau Forum DD-WRT francophone
dadoors
DD-WRT Novice


Joined: 12 May 2008
Posts: 38
Location: Central Florida

PostPosted: Wed Apr 01, 2009 23:08    Post subject: wrt610n working with dual wan v24 sp2 Reply with quote
i recently picked up a wrt610n. the router its self is not cheap but for the features well worth it. currently there is only a mega build for this model which leaves it no room to enable jffs and the space left in the nvram is too little to be able to run the scrips (only like 3000 bytes). however, this router has a usb port and ddwrt firmware supports it. simply enable this feature, and mount the drive. vlan setup is like the 310n. the dual wan performance is much better than my wrt54gl. load is only around 10-20% at full download with close to a 1000 connections. this router can easily handle a triple wan setup due to its faster cpu. and this is where i was hoping i could get some help. which scripts do i use for a triple wan setup using v24 firmware and do i rename them to firewall.firewall, and routes.firewall? i tried various different configurations without success.

i also forgot to mention that the dhcp scripts downloaded from jbarbieri site dont work on this router, the wrt54gl, (and maybe more) but thanks to leoforti on page 51 i was able to correct the errors. this is probably the reason why so many people using dhcp are having issues pulling an address.

below is the code for the current udhcpc-wan2.script that does not work with my router.

---------------------------------------------------
#!/bin/sh
# udhcpc script edited by Tim Riker <Tim@Rikers.org>
[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1

ifconfig $interface up

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
echo "$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
# echo "$router"
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
nvram set wan2_ifname=$interface
nvram set wan2_gateway=$router
nvram set wan2_ipaddr=$ip
nvram set wan2_netmask=$subnet
nvram set wan2_broadcast=$broadcast
nvram commit
ifconfig $(nvram get wan2_ifname) $(nvram get wan2_ipaddr) netmask $(nvram get wan2_netmask) up
;;
esac

exit 0
--------------------------------------------------

this is the corrected code below

--------------------------------------------------
#!/bin/sh
# udhcpc script edited by Tim Riker <Tim@Rikers.org>
[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1

ifconfig $interface up

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
echo "$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
echo "$router"
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
nvram set wan2_ifname=$interface
nvram set wan2_gateway=$router
nvram set wan2_ipaddr=$ip
nvram set wan2_netmask=$subnet
nvram set wan2_broadcast=$broadcast
nvram commit
ifconfig $(nvram get wan2_ifname) $(nvram get wan2_ipaddr) netmask $(nvram get wan2_netmask) up
;;
esac

exit 0


Last edited by dadoors on Fri Apr 03, 2009 20:53; edited 2 times in total
corotte
DD-WRT Novice


Joined: 01 Aug 2008
Posts: 26

PostPosted: Thu Apr 02, 2009 4:03    Post subject: Reply with quote
phuzi0n wrote:
corotte wrote:
but i don't know how to map a port range like the upper script ?


Use colons to indicate a range and you can use it in conjunction with commas.

-m multiport --destination-ports 500,4500:4510,52428


Thanks again

i got into trouble with my configuration after 2 hour of utilisation. some site wont display, some other will display correctly, games and other software will connect and be disconnect without any reason ....

I'm searching were it come from...

any idea ?
dadoors
DD-WRT Novice


Joined: 12 May 2008
Posts: 38
Location: Central Florida

PostPosted: Sat Apr 04, 2009 22:46    Post subject: Reply with quote
after looking at the firewall.firewall script i see some lines of code that reference the vlan's and eth. since my router's wan and wan2 connections use vlan2 and vlan3 respectively, would i have to edit the firewall code to reflect the difference?

example:

$IPTABLES -t mangle -A FORWARD -i vlan1 -j ETH1
$IPTABLES -t mangle -A FORWARD -i vlan2 -j ETH2

to:

$IPTABLES -t mangle -A FORWARD -i vlan2 -j ETH1
$IPTABLES -t mangle -A FORWARD -i vlan3 -j ETH2
ccbiker
DD-WRT Novice


Joined: 30 May 2007
Posts: 20

PostPosted: Sun Apr 05, 2009 20:29    Post subject: Reply with quote
dadoors wrote:
after looking at the firewall.firewall script i see some lines of code that reference the vlan's and eth. since my router's wan and wan2 connections use vlan2 and vlan3 respectively, would i have to edit the firewall code to reflect the difference?

example:

$IPTABLES -t mangle -A FORWARD -i vlan1 -j ETH1
$IPTABLES -t mangle -A FORWARD -i vlan2 -j ETH2

to:

$IPTABLES -t mangle -A FORWARD -i vlan2 -j ETH1
$IPTABLES -t mangle -A FORWARD -i vlan3 -j ETH2


I've wondered the same thing... I'm not sure what difference it makes, honestly, but I've personally changed vlan1 and vlan2 in those lines to $(nvram get wan_ifname) and $(nvram get wan2_ifname), respectively. (which in the case of your router would probably result in vlan2 and vlan3). Sadly I don't know what all of these commands actually do :/

_________________
WRT350N 11793 NEWD mega Eko -- Quad WAN
krneki1
DD-WRT Novice


Joined: 10 Apr 2009
Posts: 1

PostPosted: Mon Apr 13, 2009 15:09    Post subject: Dual-WAN Reply with quote
Hi!

I managed to make the WAN2 work for my WRT54GL, but it's weird.


When I'm testing my WAN2, this is what I get:
Code:
root@DD-WRT:~# ping google.com
PING google.com (209.85.171.100): 56 data bytes

--- google.com ping statistics ---
3 packets transmitted, 0 packets received, 100% packet loss


root@DD-WRT:~# ping 208.67.222.222
PING 208.67.222.222 (208.67.222.222): 56 data bytes
64 bytes from 208.67.222.222: seq=0 ttl=55 time=170.696 ms
64 bytes from 208.67.222.222: seq=1 ttl=55 time=97.373 ms
64 bytes from 208.67.222.222: seq=2 ttl=55 time=100.399 ms

--- 208.67.222.222 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 97.373/122.822/170.696 ms


After 5 min it will start to work, but I get random errors every time I try to access a new DNS name.

Code:
C:\>ping www.google.co.uk -t

Pinging google.navigation.opendns.com [208.69.34.231] with 32 bytes of data:

Request timed out.
Request timed out.
Reply from 192.168.0.186: Destination host unreachable.
Request timed out.
Reply from 192.168.0.186: Destination host unreachable.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for 208.69.34.231:
    Packets: Sent = 10, Received = 2, Lost = 8 (80% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms
Control-C
^C
C:\>ping www.google.com

Pinging google.navigation.opendns.com [208.69.34.231] with 32 bytes of data:

Reply from 208.69.34.231: bytes=32 time=110ms TTL=55
Reply from 208.69.34.231: bytes=32 time=103ms TTL=55
Reply from 208.69.34.231: bytes=32 time=224ms TTL=55
Reply from 208.69.34.231: bytes=32 time=99ms TTL=55


192.168.0.186 is the IP of WAN2

After 5 min from the first ping, www.google.co.uk starts to work.
itaintrite
DD-WRT Novice


Joined: 03 Apr 2008
Posts: 5

PostPosted: Wed Apr 29, 2009 4:26    Post subject: oh man... Reply with quote
Man, I just can NOT get my WRT54GS v2 to work with DUAL WAN. And it's not for the lack of trying. Been reading as much as I can and still going nowhere. I'm currently on v24 no SP, but have also tried various BS presp2 builds (can't find v23 SP2 to try though). Followed jbar's instructions to the dot...

The thing is, I have two cable modems for two Road Runner lines. One is business class and one is residential. Both can pull separate WAN (I've tested by plugging modem directly to PC).

Anybody kind enough to give me the latest info on how to get this to work? Smile I'll be very grateful. Thank you.

update: I flash back to v24 again and tried this guide. http://roadrunnerguide.com/dualwan_jffs.html. I used vlan0ports="1 2 3 5*" and vlan2ports="4 5" like what jbar used for this wrt54gs v2 as well. Everything else I did exactly as the guide says.

How do I know if the Dual Wan set up is working or not? My speed seems to be the same.. Upload maxing out at 240kBps. The two lines combine should give me 300kBps.

update2: I think my problem is that my router (or wireless laptop) picks out a random connection to use and not necessarily the faster (or combine) upstream.
itaintrite
DD-WRT Novice


Joined: 03 Apr 2008
Posts: 5

PostPosted: Tue May 05, 2009 7:58    Post subject: Reply with quote
Anybody at all? Sad
betillo33
DD-WRT Novice


Joined: 14 Jan 2009
Posts: 11

PostPosted: Wed May 13, 2009 15:27    Post subject: Reply with quote
dilosolid wrote:
Guide to get dual wan working with the WRT350n

port settings

nvram set vlan1ports="1 2 3 8*"
nvram set vlan3ports="4 8"
nvram set vlan3hwname=et0
nvram commit
reboot


change this
udhcpc -s /jffs/scripts/udhcpc-wan2.script -i vlan2
to
udhcpc -s /jffs/scripts/udhcpc-wan2.script -i vlan3


everything else is the same to the wrt54g


Hi dilosolid.

could you write a full guide to WRT350N?.

I read the 58 pages of this issue that just confuses me more. There are many codes and I do not know what the correct code. Can you post step by step the right way?
thanks
betillo33
DD-WRT Novice


Joined: 14 Jan 2009
Posts: 11

PostPosted: Wed May 13, 2009 16:22    Post subject: Re: Help with Dual DHCP Cable Modems v24presp2 newd mega 112 Reply with quote
Apex-XT wrote:
ccbiker wrote:
Krusty_47 wrote:
I have a WRT-350n.
DD-WRT v24 pre sp2 ver newd mega 11218
Two cable Modem on Cox Communications

I've been reading through everything on this thread but when it comes to the 350n there are some specific things that you need to do that are not covered in this thread. I would really appreciate some guidance on what to do.

I know I need to setup the vlans via telnet or ssh. as they are not changed by the gui. Also when I try to setup all the vlan ports the router stops functioning. I figure this is because I'm movie vlan1ports "1 2 3 4 8*" to vlan0ports. I am in the middle of further testing. hopefully switching them around and putting port 4 on to vlan3port will fix this issue.

After that I'm lost by what I need to do to get the iptables to function properly with this router and firmware. Do I need a different firmware to make it work correctly and reliably I would love to be able to use the random functions? I do not believe I can downgrade to v23 as I do not believe it supports my router. If anyone can give me some pointers or would like to help me out by sshing into my router that would be a great help.


I too have a wrt350n...version 11207 mega NEWD

Code:
root@DD-WRT:~# nvram show|grep vlan|grep ports
size: 24358 bytes (8410 left)
vlan2ports=0 8
vlan1ports=1 2 3 4 8*


I haven't figured out how to set up the vlans. Any help would be appreciated, although I'll be leaving town for a while and won't be able to fiddle with my router for a week or two.

Thanks in advance Smile



I'm in the same boat. I'm trying to use a 350N to run dual/triple wan. I wanted the 350N because of the 1G LAN ports to potentially increase speed. I'm planning to set up triple using the stock WAN port, then plug in 2 lines to 2 new 1G WAN ports. BUT, need help sorting out how to use JB's scripts to work with the 350N.

Has anyone gotten one to work? JB, what output would you need to look into it? Do you have time?

Thanks for your efforts in making Dual/Triple happen.

WRT-350N V1
v.11482 std-nokaid,usb NEWD EKO


I have the same problem. do you fix it? could you post all steps to do

thanks
betillo33
DD-WRT Novice


Joined: 14 Jan 2009
Posts: 11

PostPosted: Wed May 13, 2009 22:54    Post subject: Re: wrt350n Reply with quote
ccbiker wrote:
roothuser wrote:

Where does the route.firewall file get used?

It gets used at the end of the startup scripts. This script is absolutely necessary.
roothuser wrote:

Why do i need to specify vlan3 when calling udhcpc-wan2.script when other setups seem to use vlan2?

Lots of routers use vlan0 for lan and vlan1 for wan, then vlan2 for the second wan; however, the 350n uses vlan1 for lan, vlan2 for wan, and VLAN3 for wan2.
roothuser wrote:

Has anyone succesfully set things up with a newer release?

1. Install dd-wrt.v24_std_generic.bin (RC3)

I have no experience with RC3. I have had success with the others\eko\tng builds or whatever (the preSP2 ones). For example svn11779 is very recent and seems stable to me, works with dual (or trip/quad wan).

roothuser wrote:

4. Set Port 4 under its own LAN
Go to "Setup"->"VLANs"
Click off port 4 under VLAN 0
Click on port 4 under VLAN 2 and click "Save"
Force a reboot by going to Services and clicking Reboot Router

This isn't necessary. In fact, I have come across trouble when setting vlans in the web gui. You can ignore this step.
roothuser wrote:

5. Setup new VLAN settings
ssh to the box and type the following commands

--- start ---
nvram set vlan1ports="1 2 3 8*"
nvram set vlan3ports="4 8"
nvram set vlan3hwname=et0
nvram commit
reboot
--- end ---

This is correct. It will make port 4 into your wan2.

roothuser wrote:

7. Ensure scripts run automatically
Go to "Administration"->"Commands"

Enter the following and click "Save Startup"
udhcpc -s /jffs/scripts/udhcpc-wan2.script -i vlan3

This is where you would have:
Code:
udhcpc -s /jffs/scripts/udhcpc-wan2.script -i vlan3
sh /jffs/scripts/routes.firewall

roothuser wrote:

Enter the following and click "Save Firewall"
/jffs/scripts/firewall.firewall

Yup.


Good luck Very Happy


Hi .

There are many codes and I do not know which is correct. Can I use the code in this link?

http://www.jbarbieri.net/dd-wrt/scripts/iptables
http://www.jbarbieri.net/dd-wrt/scripts/firewall.firewall
http://www.jbarbieri.net/dd-wrt/scripts/routes.firewall
http://www.jbarbieri.net/dd-wrt/scripts/udhcpc-wan2.script

iptables is required download to this model?


thanks.
ccbiker
DD-WRT Novice


Joined: 30 May 2007
Posts: 20

PostPosted: Fri May 15, 2009 4:48    Post subject: Re: wrt350n Reply with quote
betillo33 wrote:
ccbiker wrote:
roothuser wrote:

Where does the route.firewall file get used?

It gets used at the end of the startup scripts. This script is absolutely necessary.
roothuser wrote:

Why do i need to specify vlan3 when calling udhcpc-wan2.script when other setups seem to use vlan2?

Lots of routers use vlan0 for lan and vlan1 for wan, then vlan2 for the second wan; however, the 350n uses vlan1 for lan, vlan2 for wan, and VLAN3 for wan2.
roothuser wrote:

Has anyone succesfully set things up with a newer release?

1. Install dd-wrt.v24_std_generic.bin (RC3)

I have no experience with RC3. I have had success with the others\eko\tng builds or whatever (the preSP2 ones). For example svn11779 is very recent and seems stable to me, works with dual (or trip/quad wan).

roothuser wrote:

4. Set Port 4 under its own LAN
Go to "Setup"->"VLANs"
Click off port 4 under VLAN 0
Click on port 4 under VLAN 2 and click "Save"
Force a reboot by going to Services and clicking Reboot Router

This isn't necessary. In fact, I have come across trouble when setting vlans in the web gui. You can ignore this step.
roothuser wrote:

5. Setup new VLAN settings
ssh to the box and type the following commands

--- start ---
nvram set vlan1ports="1 2 3 8*"
nvram set vlan3ports="4 8"
nvram set vlan3hwname=et0
nvram commit
reboot
--- end ---

This is correct. It will make port 4 into your wan2.

roothuser wrote:

7. Ensure scripts run automatically
Go to "Administration"->"Commands"

Enter the following and click "Save Startup"
udhcpc -s /jffs/scripts/udhcpc-wan2.script -i vlan3

This is where you would have:
Code:
udhcpc -s /jffs/scripts/udhcpc-wan2.script -i vlan3
sh /jffs/scripts/routes.firewall

roothuser wrote:

Enter the following and click "Save Firewall"
/jffs/scripts/firewall.firewall

Yup.


Good luck Very Happy


Hi .

There are many codes and I do not know which is correct. Can I use the code in this link?

http://www.jbarbieri.net/dd-wrt/scripts/iptables
http://www.jbarbieri.net/dd-wrt/scripts/firewall.firewall
http://www.jbarbieri.net/dd-wrt/scripts/routes.firewall
http://www.jbarbieri.net/dd-wrt/scripts/udhcpc-wan2.script

iptables is required download to this model?


thanks.


Yes, those links, including the iptables should be what you need. I'd recommend a recent eko build; that's all I've had experience with and it's worked.

ps: I think all that's missing in the above quotation is that you save the iptables binary in /jffs/ and you save the 3 scripts in /jffs/scripts/ and make all 4 of those files executable w/ chmod +x

all the instructions for the wrt350n should be in the last few pages, but if you need anything cleared up let me know where you're confused

_________________
WRT350N 11793 NEWD mega Eko -- Quad WAN
phiqtion
DD-WRT Novice


Joined: 15 May 2009
Posts: 3

PostPosted: Sat May 16, 2009 15:40    Post subject: Reply with quote
i usually try not to bother but here is my situation, my isp gives me an address with DHCP but i need to use a static ip for both modems.

everybody here seems to have used a diff conf and setup, which one should i follow for a static ip?

WRT54G-TM - v24-sp2 (05/12/09) mini - build 12103M NEWD Eko

i have followed every setup but the router only uses 1 modem when i issue a speed test.
betillo33
DD-WRT Novice


Joined: 14 Jan 2009
Posts: 11

PostPosted: Sun May 17, 2009 20:15    Post subject: Re: wrt350n Reply with quote
ccbiker wrote:
betillo33 wrote:
ccbiker wrote:
roothuser wrote:

Where does the route.firewall file get used?

It gets used at the end of the startup scripts. This script is absolutely necessary.
roothuser wrote:

Why do i need to specify vlan3 when calling udhcpc-wan2.script when other setups seem to use vlan2?

Lots of routers use vlan0 for lan and vlan1 for wan, then vlan2 for the second wan; however, the 350n uses vlan1 for lan, vlan2 for wan, and VLAN3 for wan2.
roothuser wrote:

Has anyone succesfully set things up with a newer release?

1. Install dd-wrt.v24_std_generic.bin (RC3)

I have no experience with RC3. I have had success with the others\eko\tng builds or whatever (the preSP2 ones). For example svn11779 is very recent and seems stable to me, works with dual (or trip/quad wan).

roothuser wrote:

4. Set Port 4 under its own LAN
Go to "Setup"->"VLANs"
Click off port 4 under VLAN 0
Click on port 4 under VLAN 2 and click "Save"
Force a reboot by going to Services and clicking Reboot Router

This isn't necessary. In fact, I have come across trouble when setting vlans in the web gui. You can ignore this step.
roothuser wrote:

5. Setup new VLAN settings
ssh to the box and type the following commands

--- start ---
nvram set vlan1ports="1 2 3 8*"
nvram set vlan3ports="4 8"
nvram set vlan3hwname=et0
nvram commit
reboot
--- end ---

This is correct. It will make port 4 into your wan2.

roothuser wrote:

7. Ensure scripts run automatically
Go to "Administration"->"Commands"

Enter the following and click "Save Startup"
udhcpc -s /jffs/scripts/udhcpc-wan2.script -i vlan3

This is where you would have:
Code:
udhcpc -s /jffs/scripts/udhcpc-wan2.script -i vlan3
sh /jffs/scripts/routes.firewall

roothuser wrote:

Enter the following and click "Save Firewall"
/jffs/scripts/firewall.firewall

Yup.


Good luck Very Happy


Hi .

There are many codes and I do not know which is correct. Can I use the code in this link?

http://www.jbarbieri.net/dd-wrt/scripts/iptables
http://www.jbarbieri.net/dd-wrt/scripts/firewall.firewall
http://www.jbarbieri.net/dd-wrt/scripts/routes.firewall
http://www.jbarbieri.net/dd-wrt/scripts/udhcpc-wan2.script

iptables is required download to this model?


thanks.


Yes, those links, including the iptables should be what you need. I'd recommend a recent eko build; that's all I've had experience with and it's worked.

ps: I think all that's missing in the above quotation is that you save the iptables binary in /jffs/ and you save the 3 scripts in /jffs/scripts/ and make all 4 of those files executable w/ chmod +x

all the instructions for the wrt350n should be in the last few pages, but if you need anything cleared up let me know where you're confused



How do I know that is working correctly?

I have another question. Chmod + x ¿I run it in telnet / shh?

I understood that I have to copy files scripts. in the directory to / jffs / scripts /. and the iptables file in the directory / jffs / correct?

I have the dd-wrt.v24_mega_generic.bin version. Do you think that works?

Excuse my poor English
Goto page Previous  1, 2, 3 ... 57, 58, 59 ... 66, 67, 68  Next Display posts from previous:    Page 58 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