multiple wan/connection failover

Discussion in 'Tomato Firmware' started by jon124, Oct 8, 2007.

  1. jon124

    jon124 LI Guru Member

    I would really really really like this. Ive read around and searched and it seems the farthest anybodys gotten is getting 2 wan interfaces to work. how hard would it be to implement a script or something that uses wan 1 for internet all the time, and if it detects that connection cant be pinged out of or something then it switches to wan 2?

    something like this - (could any of these commands be used?

  2. mstombs

    mstombs Network Guru Member

    I have a script that's attempts this - but I find pinging the gateway unreliable (regularly get dropped packets symptoms of ISP ignoring ping when routers busy?), whereas manually running a "/jffs/" is 100% supported under Tomato via GUI bandwith logs etc.

    I also never solved the slow dhcp renew on a secondary WAN connection so not sure if dual dynamic is going to be a reliable option under Tomato. There seems to be working examples under OpenWRT (no GUI issues!), maybe dd-wrt would be a better place to try this - no point in breaking Tomato!

    re the link

    I didn't know you could have 2 default gateways - when done accidentally it seems to break internet access. If you have static WAN IP addresses the linked scripts could certainly be tried the "/proc/sys/net/ipv4/route/gc_timeout" is new to me! I suspect auto switching of the gateway under Linux may not be compatible with GUI defined upnp, port forwards, QOS, dnsmasq etc that all only know about 1 WAN Iface.
  3. jon124

    jon124 LI Guru Member

    a decent amount of what you said went somewhat over my head, I am not new to networking whatsoever, just all these linux commands and scripts are losing me, lol. Thats awesome that you have gotten somewhere on this, I would love, and probably pay, for something like this inside tomato. I love tomato so much and would hate having to spend 200 dollars on a dual wan router and be stuck with their firmware, or have to switch back to ddwrt or openwrt.

    if you get anywhere with this id love to know! I don't want this idea or thread disappearing into the abyss
  4. mstombs

    mstombs Network Guru Member

    Well if you want to try:-

    If you have 2 modems which work with auto-dhcp, I am using the dual wan and script in this thread which works for me:-

    My half bridge modem needs extra route commands via the firewall script here:-

    For the failure monitoring I have experimented with variants of the wan-restart script discussed in here - but would really like a better way of detecting this without false positives before publishing!
  5. jon124

    jon124 LI Guru Member

    ah thank you very much. sadly my primary connection is pppoe, and the backup could either be static ip or dhcp.
  6. mstombs

    mstombs Network Guru Member

    OK, harder but not impossible - you would need to establish exactly what nvram variables change when you switch from one to the other and write a pair of scripts so that between

    service wan stop


    service wan start

    the non volatile variables that define your connection get changed. I don't have PPPOE so can't help you there!
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice