1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Dual WAN With Toastman/Shibby?

Discussion in 'Tomato Firmware' started by gfunkdave, Dec 14, 2012.

  1. gfunkdave

    gfunkdave LI Guru Member

    I want to set up an RT-N-16 running Toastman VLAN to have two WAN ports (one DHCP, the other static) where certain traffic from the LAN is routed to one WAN port and the remainder to the other. In addition, if one WAN connection goes down, I want its traffic to fail over to the other WAN until service is restored.

    Is this possible? I understand there's an actual Dual WAN fork of Tomato, but from what I can see it is very unstable. Also, it's in Chinese. :)

    I found this writeup for DD-WRT, but am not quite sure about its adaptability for Tomato: http://www.dd-wrt.com/wiki/index.php/Dual_WAN_with_failover.

    Does anyone have any experience with this? It's easy with Tomato VLAN to put a LAN port onto the WAN bridge; what else is required?

    Thanks for any input.
  2. xtacydima

    xtacydima LI Guru Member

    No Toastman/Shibby or Victek Dual WAN yet.

    Merlin tweaked stock image keeps it though.
  3. mstombs

    mstombs Network Guru Member

    Asus are working on this in the sourcecode but its not in released product and no longer enabled in rmerlin N16 builds - but you can recompile for yourself.

    When I last looked it basically worked but there were GUI issues and failover/recovery was fooled by my half bridge modem.
  4. gfunkdave

    gfunkdave LI Guru Member

    OK, thanks for the pointers...but any ideas on whether DD-WRT's script would work?
  5. mstombs

    mstombs Network Guru Member

    Those scripts will not work without modification on RT-N16 and Tomato - since vlan2 is the normal WAN port. The ports are named differently in Asus firmware IIRC. Guess you could try vlan3? You could definitely do something with Tomato, but I think the broken link detection needs to be a bit more sophisticated/ robust against occasional ping failure, and I am not sure the the iptables stuff is compatible with Tomato.

    I used to have a second modem attached to a second wan port on Tomato wrt54gs, both connections were dhcp so could manually switch with a simple script

    OIF=$(nvram get wan_iface)
    if [ "$OIF" = "vlan1" ]; then
    logger wanswitch from $OIF to $NIF
    # stop WAN
    service wan stop
    # swap active interface
    nvram set wan_iface="$NIF"
    nvram set wan_ifname="$NIF"
    nvram set wan_ifnames="$NIF"
    # restart WAN
    service wan start
    I'm sure you could do an equivalent just making sure all the right nvrams are changed.

    For an example of a robust ping script for the current wan connection see :-


    Chinese dual wan used to have similar (no source available, but scripts seen in firmware!), but without malware concerns it didn't do what I needed with 2 dhcp connections at all.

    I don't know how to reliably bring up 2 WAN interfaces and be able to test the second, Asus have a userspace binary wanduck, not script, that also checks kernel traffic counters and has to cope with all different types of connection.

    Interestingly I have seen some original Broadcom example code which was designed to handle multiple WANs which is probably where the about var "wan_ifnames" comes from - was intended to be used as a list of WANs! To implement this properly in Tomato everywhere something is done to the WAN (port forwards, ddns, custom routes etc) need to consider applying to one individually or to all, which is quite doable but needs a lot of care.
  6. xtacydima

    xtacydima LI Guru Member

    ahh sorry when I last tried it, few months ago on a spare n16 I remember the option being there

    I never messed with it though, was it removed due to being unreliably or not properly functioning... if you know?
  7. mstombs

    mstombs Network Guru Member

    Merlin doesn't have a RTN 16 so can't really support things that need development rather than just flicking the Asus compile switch. He's even unsure of Asus intentions for the other models -if Asus haven't finished their development best to wait? Most of the code must be common even to other chipset routers. I think it would be a great boost to Asus to have this option and they have done a lot...

Share This Page