Joined: 06 Apr 2007 Posts: 545 Location: New Hampshire
Posted: Tue Oct 27, 2009 20:14 Post subject: Re: Static DNS; Buffalo WHR-HP-G54; Dual & Triple ADSL
Rizwiz wrote:
clearview wrote:
In reply to Speedy2K ... yes I just added the DNS IP through the Web GUI and my second WAN started working. (under Setup/Basic settings)
I have now just got triple ADSL WAN working as well (2 ISPs,3 lines). I'm using v24SP2 throughout. My config below. Thanks all.
***These port settings work on my BUFFALO WHR-HP-G54***
nvram set vlan0ports="2 1 5*"
nvram set vlan1ports="0 5"
nvram set vlan2ports="4 5"
nvram set vlan3ports="3 5"
nvram set vlan2hwname=et0
nvram commit
reboot
if [ "$(nvram get wan2_ipaddr)" != "$WAN2_IPADDR" ]; then
nvram set wan2_ifname=$WAN2_IFNAME
nvram set wan2_ipaddr=$WAN2_IPADDR
nvram set wan2_gateway=$WAN2_GATEWAY
nvram set wan2_netmask=$WAN2_NETMASK
nvram set wan2_broadcast=$WAN2_BROADCAST
nvram commit
fi
ifconfig $(nvram get wan2_ifname) $(nvram get wan2_ipaddr) netmask $(nvram get wan2_netmask) broadcast $(nvram get wan2_broadcast) up
if [ "$(nvram get wan3_ipaddr)" != "$WAN3_IPADDR" ]; then
nvram set wan3_ifname=$WAN3_IFNAME
nvram set wan3_ipaddr=$WAN3_IPADDR
nvram set wan3_gateway=$WAN3_GATEWAY
nvram set wan3_netmask=$WAN3_NETMASK
nvram set wan3_broadcast=$WAN3_BROADCAST
nvram commit
fi
ifconfig $(nvram get wan3_ifname) $(nvram get wan3_ipaddr) netmask $(nvram get wan3_netmask) broadcast $(nvram get wan3_broadcast) up
=====================================================
For DUAL WAN:
nvram set rc_startup='/jffs/scripts/wan2.firewall
/jffs/scripts/routes.firewall'
nvram set rc_firewall='/jffs/scripts/routes.firewall
/jffs/scripts/firewall.firewall'
nvram commit
reboot
=====================================================
For TRIPLE WAN:
(uses jbarbieri's v23 triple script, but runs on dd-wrt v24SP2 because I'm using his iptables in /jffs)
(check firewall.firewall contains IPTABLES=/jffs/iptables)
Ok I have a BUFFALO WHR-HP-G54 and have tried the above with this error.
\u@\h:\w\$ cd /jffs/
\u@\h:\w\$ wget http://jbarbieri.net/dd-wrt/scripts/iptables
Connecting to jbarbieri.net (65.175.134.126:80)
\u@\h:\w\$ cd /jffs/scripts/
-sh: cd: can't cd to /jffs/scripts/
I'm using DD-WRT v24-sp2 (07/21/09) micro
SVN revision 12533 for the firmware.
Could I get some help on this error.
Riz
You would have to
mkdir scripts
before you could cd into it. _________________
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
Joined: 12 May 2008 Posts: 38 Location: Central Florida
Posted: Thu Nov 05, 2009 18:24 Post subject: updated dual wan guides
i noticed there was some typos in the previous guides i had put together causing the dual wan not to work but hopefully that has now been corrected. currently only wrtgl, 310n, and the 610n are supported. so for those who couldnt get dual wan to work let me know if the corrections help. u can check here:
roadrunnerguide.com/dualwan.html
Last edited by dadoors on Thu Nov 05, 2009 21:44; edited 1 time in total
powerfull thread.. thanks to all. But seems I didn`t get two answers.. maybe I`m wrong:
1. Is D-Link DIR-400 support this method (none JFFS, only nvram)?
2. If supported, then another question: I have 2 ISP, first is ADSL (PPPOE 1mbit/1mbit), second called as Russian DualAccsess PPPOE, is it possible to use it together, or put autoswitch when one of them is fall down?
using the dual wan scripts on dd-wrt Eko-NEWD on a wrt600n wired directly to the router. i can't hit a higher DL speed of around 5MB/s i am wondering if this could be the limitation of the router (wrt600n) since it is an older model, because i had the wrt610n set up as previously posted getting around 8MB/s down. It could also be a number of other things including the cable modems config,gateway,frequency. or possibly the dd-wrt firmware version although i have tried many.(newd-2 was slower)or a number of other factors.
Hey, I have a DDWRT54GL v1.1 with the latest std dd-wrt firmware.
I set up everything according to the roadrunnerguide.com and used their scripts exactly for the NVRAM setup.
When I reboot with just my startup commands it works fine and I seem to have dual WAN?
When I reboot router with startup and firewall commands it won't connect to google.com, but I am still able to connect to the router.
What's going on?
Here is what vlan0 and vlan1 look like. Let me know if there is any other information you would like.
edit: by the way, my router IP is 10.0.50 and my start address is 10.0.0.100
I was looking at the firewall scripts and it mentions 192.168.1.1 I tried changing it to 10.0.0.50, but it still failed to load internet.
What gives? (It also had a 192.168.1.0/24 - what's that?)
Posted: Wed Dec 09, 2009 21:48 Post subject: DSL up/cable down?
Is it possible to create a multi WAN setup where one connection would be favored for upload purposes and the other for download purposes? Obviously, this will only work for bittorrent and similar protocols.
I have access to both DSL and cable connections, hence the question. DSL can often do twice the upstream of cable, while cable can do 4x the downstream of DSL, in my case.
Posted: Fri Jan 08, 2010 13:41 Post subject: DUAL WANS VIA WLAN (WIFI) !
Hey boys, so I think I figured this one out! I have spent hours tracing through the scripts and discovered the culprit that enables the Dual Wan Router to talk over the internal wifi repeater connection on BOTH WANS!
IP: 192.168.60.1
wireless mode: repeater (ssid: abc)
wan IPL 206.65.123.123
wan gateway: 206.65.123.1
This is the router acting as the DUAL WAN interface
2nd router: WRT-160n V3 - DD-WRT v24-sp2 (01/02/10) mini
(SVN revision 13575M NEWD-2 K2.6 Eko)
This router is connected via a cat 5 from any port (1-4) to Port 4(0) on the 1st router (this was configured using on the 1st router:
nvram set vlan0ports="3 2 1 5*"
nvram set vlan2ports="0 5" << this is port 4 on GL
nvram set vlan2hwname=et0
nvram commit
reboot
IP address (which is the gateway): 192.168.70.1
wireless mode: repeater (ssid: xyz)
wan IP: 99.206.123.123
wan Gateway 99.206.123.1
So the reason why this is not working for you guys is because the wan_ifname is routing through vlan1 which is assigned to the hardwired WAN (internet) port(4). When you create a repeater the interface created is called 'eth1' so, just replace all references from vlan1 and wan_ifname to eth1 and BAM! traffic destined for the first interface goes through the repeater of the 1st router. Now because the first router does not care what is on the second router (hence as long as it has the IP, gateway, netmask) the second router can also be created as a repeater (with DHCP on or off) for my case I did not want to run the DHCP on the second router so I statically assigned the wan2 ifconfig specs in the 1st router and deleted the DHCP logic from the script udhcpc-wan2.script:
nvram set wan2_ifname=vlan2
nvram set wan2_gateway=192.168.70.1
nvram set wan2_ipaddr=192.168.70.10
nvram set wan2_netmask=255.255.255.0
nvram set wan2_broadcast=192.168.70.255
nvram commit
ifconfig $(nvram get wan2_ifname) $(nvram get wan2_ipaddr) netmask $(nvram get wan2_netmask) up
Now, I have tested with different flavours of the iptables and found the one that comes with this firmware seems to work so I left it, and made sure that in the script firewall.firewall I was using the /usr/sbin/iptables:
ALSO NOTICE HERE THAT I REPLACED ALL REFERENCES TO WAN_IFNAME and VLAN1 with 'eth1' this allows the traffic to pass through the wirless interface! I cannot verify if eth1 is the standard across models/manf, so just use 'nvram get wan_ifname' from the telnet to get yours! \\ THIS IS NOT A TYPO - DO NOT CHANGE WAN2_IFNAME as that is OK because you want the traffic to flow through the second router as well.
#!/bin/sh
insmod ipt_CONNMARK
insmod ipt_mark
echo "`date` Flushing and adding new firewall rules" >> /var/log/messages
IPTABLES="/usr/sbin/iptables"
#IPTABLES="/jffs/scripts/iptables"
if [ "$STATE" = "on" ]; then
if [ "$PROTO" = "both" ]; then
iptables -A PREROUTING -t nat -p udp -d $(nvram get wan2_ipaddr) --dport $SPORT:$EPORT -j DNAT --to $TO
iptables -A PREROUTING -t nat -p tcp -d $(nvram get wan2_ipaddr) --dport $SPORT:$EPORT -j DNAT --to $TO
else
iptables -A PREROUTING -t nat -p $PROTO -d $(nvram get wan2_ipaddr) --dport $SPORT:$EPORT -j DNAT --to $TO
fi
fi
done
iptables -A PREROUTING -t nat -p icmp -d $(nvram get wan2_ipaddr) -j DNAT --to $(nvram get lan_ipaddr)
if [ $(nvram get remote_management) -eq 1 ]; then
iptables -A PREROUTING -t nat -p tcp -d $(nvram get wan2_ipaddr) --dport $(nvram get http_wanport) -j DNAT --to $(nvram get lan_ipaddr):$(nvram get http_lanport)
fi
if [ $(nvram get dmz_enable) -eq 1 ]; then
DMZ_IP=$(nvram get lan_ipaddr | sed -r 's/[0-9]+$//')$(nvram get dmz_ipaddr)
iptables -A PREROUTING -t nat -d $(nvram get wan2_ipaddr) -j DNAT --to $DMZ_IP
fi
iptables -A PREROUTING -t nat --dest $(nvram get wan2_ipaddr) -j TRIGGER --trigger-type dnat
iptables -A FORWARD -i $(nvram get wan2_ifname) -o $(nvram get lan_ifname) -j TRIGGER --trigger-type in
$IPTABLES -t mangle -N ETH1
$IPTABLES -t mangle -F ETH1
$IPTABLES -t mangle -A ETH1 -j MARK --set-mark 0x100
$IPTABLES -t mangle -A ETH1 -j CONNMARK --save-mark
$IPTABLES -t mangle -N ETH2
$IPTABLES -t mangle -F ETH2
$IPTABLES -t mangle -A ETH2 -j MARK --set-mark 0x200
$IPTABLES -t mangle -A ETH2 -j CONNMARK --save-mark
$IPTABLES -t mangle -N RANDOM
$IPTABLES -t mangle -F RANDOM
$IPTABLES -t mangle -A RANDOM -m random --average 50 -j ETH1
$IPTABLES -t mangle -A RANDOM -m random --average 50 -j ETH2
RP_PATH=/proc/sys/net/ipv4/conf
for IFACE in `ls $RP_PATH`; do
echo 0 > $RP_PATH/$IFACE/rp_filter
done
echo "`date` firewall.firewall is now completed" >> /var/log/messages
#---end firewall.firewall---
And just for sanctity here is the routes.firewall
NOTE HERE AS WELL there was a reference to the wan_ifname which I just replaced with eth1 !
#!/bin/sh
echo "Flushing rules" >> /var/log/messages
ip rule flush
echo "Rebuilding rules and tables" >> /var/log/messages
ip rule add lookup main prio 32766
ip rule add lookup default prio 32767
ip rule add from $(nvram get wan_ipaddr) table 100 prio 100
ip rule add fwmark 0x100 table 100 prio 101
ip rule add from $(nvram get wan2_ipaddr) table 200 prio 200
ip rule add fwmark 0x200 table 200 prio 201
ip route flush table 100
ip route flush table 200
for TABLE in 100 200
do
ip route | grep link | while read ROUTE
do
ip route add table $TABLE to $ROUTE
done
done
ip route add table 100 default via $(nvram get wan_gateway)
ip route add table 200 default via $(nvram get wan2_gateway)
echo "Deleting default route" >> /var/log/messages
ip route delete default
echo "Adding in equalized route" >> /var/log/messages
ip route add default scope global equalize nexthop via $(nvram get wan_gateway) dev eth1 nexthop via $(nvram get wan2_gateway) dev $(nvram get wan2_ifname)
Now remember that I am not using the DHCP from the second router so in your startup script you do not need to call and pass the interface to the startup script so I removed it:
And now I have two wireless wan connections equalized through 1 WRT54GL ($30) router!
After 3 years, its finally here! Have a great new year and enjoy
Oh and use a bittorrent and check the bandwidth monitor on both wl0 devices in each router and you will see traffic flowing across both wireless repeaters!!!
Hi, i'm relatively new to the Dual/triple wan aspect of DD-WRT and i'm trying to get it to work.
I've tried reading through this thread, but its a monster and I haven't quite found even though it seems to be more simple then things already being achieved.
Before I go on I'll outline my situation:
3 dsl connections from the same ISP.
Approximately 7 static IPs per connection.
I need assign at least 3 Static IPs per connection as a form of pseudo-load balance, but each of these should be able to see other computers on our local intranet.
No real need or interest in failover or round-robin load balacing.
Hardware: WRT54GL v1.0 with 16-port Linksys switch.
Firmware: DD-WRT v24-sp2 (10/10/09) mini
I've looked at the results and all i could find was dual wan with round robin and dual wan with failover.
I've read people referring to a triple wan config with static ip setup, but I can't seem to locate it.
Posted: Sun Jan 17, 2010 17:10 Post subject: Re: DUAL WANS VIA WLAN (WIFI) !
killaDUALwans wrote:
Hey boys, so I think I figured this one out! I have spent hours tracing through the scripts and discovered the culprit that enables the Dual Wan Router to talk over the internal wifi repeater connection on BOTH WANS!
killaDualWans
Does this configuration work with 1 DSL connection and having a wireless connection as a back up or round robin?
Posted: Sat Feb 06, 2010 11:55 Post subject: Dual Wan on WRT54Gv4
ok guys i really need help i been trying this so much but with no result so someone please help me out
i did these steps
1. use a mini version of latest ddwrt.
2. port 4 on vlan2, save changes and reboot
3. "Run Commands"
nvram set vlan0ports="1 2 3 5*"
nvram set vlan2ports="0 5"
nvram set vlan2hwname=et0
nvram commit
reboot
4. Set As Startup
udhcpc -i vlan2 -s /jffs/scripts/udhcpc-wan2.script
/jffs/scripts/routes.firewall
5. Set As Firewall
/jffs/scripts/routes.firewall
/jffs/scripts/firewall.firewall
6. in the "services" tab enable sshd, & password login. click save
7. in admin tab. enable jffs2 & clean jffs2. click apply
8. disable clean jffs2, reboot
9. make a new folder called "scripts" in the "jffs" folder. transfer the scripts into the "scripts" folder
9. transfer the iptables file into the jffs folder using "binary" transfer method
10. chmod jffs to 777
reboot
(i also chmod all the scripts and the folder scripts to 777 including the iptables file)
my default wan is working just fine , but when i plug my internet connection to port 4 i get no internet, internet light in front of the router is not blinking either
please advise thankx
and i been following the instructions on http://roadrunnerguide.com/dualwan.html with no success
Posted: Sun Feb 21, 2010 4:01 Post subject: Re: Dual Wan on WRT54Gv4
haiishq wrote:
ok guys i really need help i been trying this so much but with no result so someone please help me out
i did these steps
1. use a mini version of latest ddwrt.
2. port 4 on vlan2, save changes and reboot
3. "Run Commands"
nvram set vlan0ports="1 2 3 5*"
nvram set vlan2ports="0 5"
nvram set vlan2hwname=et0
nvram commit
reboot
4. Set As Startup
udhcpc -i vlan2 -s /jffs/scripts/udhcpc-wan2.script
/jffs/scripts/routes.firewall
5. Set As Firewall
/jffs/scripts/routes.firewall
/jffs/scripts/firewall.firewall
6. in the "services" tab enable sshd, & password login. click save
7. in admin tab. enable jffs2 & clean jffs2. click apply
8. disable clean jffs2, reboot
9. make a new folder called "scripts" in the "jffs" folder. transfer the scripts into the "scripts" folder
9. transfer the iptables file into the jffs folder using "binary" transfer method
10. chmod jffs to 777
reboot
(i also chmod all the scripts and the folder scripts to 777 including the iptables file)
my default wan is working just fine , but when i plug my internet connection to port 4 i get no internet, internet light in front of the router is not blinking either
please advise thankx
and i been following the instructions on http://roadrunnerguide.com/dualwan.html with no success
I followed the same instructions from the same site and had the same results on my WRT54GL v1.1. I'd really like to get this working if someone smarter than me can figure it out.
Joined: 17 Jun 2006 Posts: 184 Location: Essex, England
Posted: Mon Feb 22, 2010 12:54 Post subject:
There is great potential for dual and triple WAN but it's not easy to do.
One route is two different routes to the Internet, say Wireless Client to someones WiFi as well as your own ADSL line on the normal WAN port. Or perhaps a 3G stick as a WAN.
The other route is faster speed vis two or more phone lines and an ISP that supports bonding. Bonded lines mean effectively a single Internet connection with twice the performance. The routers to do this usually cost hundreds.
One reason for bonding could be that you have long line issues and need extra speed. This would not stress the Linksys too much. Another reason could be that you already have a very fast connection but you are such a speed freak you want even faster. This could take the Linksys beyond it's limits. _________________ Buffalo
WRT54G
Just got it running on my WRT54G-TM with DD-WRT v24-sp2 (07/22/09) mega - build 12548M NEWD Eko firmware. Seems to be working pretty good according to a torrent I just downloaded. Will work on mtrg graphs later.
My setup:
2 Cable modems each at 8mb/1mb.
1st plugged into WAN port and 2nd plugged into port 4 on the router.
nvram set vlan0ports="3 2 1 5*"
nvram set vlan2ports="4 5"
nvram set vlan2hwname=et0
nvram set rc_startup="udhcpc -s /jffs/scripts/udhcpc-wan2.scripts -i vlan2 /jffs/scripts/routes.firewall"
nvram set rc_firewall="/jffs/scripts/routes.firewall /jffs/scripts/firewall.firewall"
nvram commit
reboot
For the files I just pulled them off of JB's server but had to change udhcpc-wan2.script and firewall.firewall a bit because of errors.
My udhcpc-wan2.script:
Code:
#!/bin/sh
# udhcpc script edited by Tim Riker <Tim@Rikers.org>
[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
# 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
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
done
;;
esac
exit 0
Had to comment out the if and fi in the $routers part and move done from above nvram to the bottom.
My routes.firewall:
Code:
#!/bin/sh
echo "Flushing rules" >> /var/log/messages
ip rule flush
echo "Rebuilding rules and tables" >> /var/log/messages
ip rule add lookup main prio 32766
ip rule add lookup default prio 32767
ip rule add from $(nvram get wan_ipaddr) table 100 prio 100
ip rule add fwmark 0x100 table 100 prio 101
ip rule add from $(nvram get wan2_ipaddr) table 200 prio 200
ip rule add fwmark 0x200 table 200 prio 201
ip route flush table 100
ip route flush table 200
for TABLE in 100 200
do
ip route | grep link | while read ROUTE
do
ip route add table $TABLE to $ROUTE
done
done
ip route add table 100 default via $(nvram get wan_gateway)
ip route add table 200 default via $(nvram get wan2_gateway)
echo "Deleting default route" >> /var/log/messages
ip route delete default
echo "Adding in equalized route" >> /var/log/messages
ip route add default scope global equalize nexthop via $(nvram get wan_gateway) dev $(nvram get wan_ifname) nexthop via $(nvram get wan2_gateway) dev $(nvram get wan2_ifname)
echo "routes.firewall completed" >> /var/log/messages
Had to change nothing in routes.firewall
My firewall.firewall:
Code:
#!/bin/sh
insmod ipt_CONNMARK
insmod ipt_mark
echo "`date` Flushing and adding new firewall rules" >> /var/log/messages
IPTABLES="/usr/sbin/iptables"
if [ "$STATE" = "on" ]; then
if [ "$PROTO" = "both" ]; then
iptables -A PREROUTING -t nat -p udp -d $(nvram get wan2_ipaddr) --dport $SPORT:$EPORT -j DNAT --to $TO
iptables -A PREROUTING -t nat -p tcp -d $(nvram get wan2_ipaddr) --dport $SPORT:$EPORT -j DNAT --to $TO
else
iptables -A PREROUTING -t nat -p $PROTO -d $(nvram get wan2_ipaddr) --dport $SPORT:$EPORT -j DNAT --to $TO
fi
fi
done
iptables -A PREROUTING -t nat -p icmp -d $(nvram get wan2_ipaddr) -j DNAT --to $(nvram get lan_ipaddr)
if [ $(nvram get remote_management) -eq 1 ]; then
iptables -A PREROUTING -t nat -p tcp -d $(nvram get wan2_ipaddr) --dport $(nvram get http_wanport) -j DNAT --to $(nvram get lan_ipaddr):$(nvram get http_lanport)
fi
if [ $(nvram get dmz_enable) -eq 1 ]; then
DMZ_IP=$(nvram get lan_ipaddr | sed -r 's/[0-9]+$//')$(nvram get dmz_ipaddr)
iptables -A PREROUTING -t nat -d $(nvram get wan2_ipaddr) -j DNAT --to $DMZ_IP
fi
iptables -A PREROUTING -t nat --dest $(nvram get wan2_ipaddr) -j TRIGGER --trigger-type dnat
iptables -A FORWARD -i $(nvram get wan2_ifname) -o $(nvram get lan_ifname) -j TRIGGER --trigger-type in
$IPTABLES -t mangle -N ETH1
$IPTABLES -t mangle -F ETH1
$IPTABLES -t mangle -A ETH1 -j MARK --set-mark 0x100
$IPTABLES -t mangle -A ETH1 -j CONNMARK --save-mark
$IPTABLES -t mangle -N ETH2
$IPTABLES -t mangle -F ETH2
$IPTABLES -t mangle -A ETH2 -j MARK --set-mark 0x200
$IPTABLES -t mangle -A ETH2 -j CONNMARK --save-mark
$IPTABLES -t mangle -N RANDOM
$IPTABLES -t mangle -F RANDOM
$IPTABLES -t mangle -A RANDOM -m random --average 50 -j ETH1
$IPTABLES -t mangle -A RANDOM -m random --average 50 -j ETH2
RP_PATH=/proc/sys/net/ipv4/conf
for IFACE in `ls $RP_PATH`; do
echo 0 > $RP_PATH/$IFACE/rp_filter
done
echo "`date` firewall.firewall is now completed" >> /var/log/messages
Had to change /jffs/iptables back to /usr/sbin/iptables since I didn't need the custom iptables. haven't tried it with the custom one yet to see if it helps. May do that later. Right now it seems fine. Was downloading a torrent at over 1.5MB/sec and the ip changes on the different ipchicken or mywanip sites.
JB do you think the custom iptables would help randomize it even better or not?
BTW, Thanks goes out to JB for putting a lot of hard work into this and helping others along. Now if we could just get that fork build of dual-wan so we wouldn't have to do all this mess.