Results 1 to 5 of 5

Thread: Script for switching between WAN connections (in case of failure)

  1. #1

    Lightbulb Script for switching between WAN connections (in case of failure)

    Hello,

    two years I used a Koppel firmware, but because
    some limitations (old kernel 2.4.20, some issues
    with 3G modems, ftdi drivers, usb webcam drivers),
    I switched to OpenWrt and then DD-WRT.

    At last I am using the renewed Oleg's firmware
    from http://code.google.com/p/wl500g/.
    (WL500gp-1.9.2.7-d-r2624.trx; Kernel 2.4.37.11)

    I like it and has some improvements.
    It recognize easily 3G modems as ZTE MF637,
    connects to Internet through it; also the
    firmware has System Utilization (in GUI),
    a nice feature.

    I liked the Koppel's firmware, GUI:
    ---USB Connection and Backup Connection---
    * Setup [enable backup connection],
    * IP address [Primary, Secondary IP for ping tests],
    * Time [time in minutes for ping testing cycle],
    * Primary [wired, WAN], Backup [radio, GPRS/EDGE/UMTS],
    mean: if the primary connection failed, the backup
    connection takes over.

    I have a question: does someone are using this renewed
    Oleg's firmware and has a script that switch automatically
    the connections in case of failure (and switch back to
    wired connection when it's available again) ?
    I've noticed that with this version (in GUI)
    I can only manually switch the connections
    [IP Config - WAN & LAN: Automatic IP, Static IP,
    PPPoE, PPPTP, L2TP, BigPond, WiMAX, USB Modem]
    and has no special page in the tree e.g. backup connection.

    That's all, thank you for any ideas.

  2. #2
    Join Date
    Nov 2004
    Location
    Sweden
    Posts
    259
    Quote Originally Posted by fukushimaku View Post
    Hello,
    I have a question: does someone are using this renewed
    Oleg's firmware and has a script that switch automatically
    the connections in case of failure (and switch back to
    wired connection when it's available again) ?
    I've noticed that with this version (in GUI)
    I can only manually switch the connections
    [IP Config - WAN & LAN: Automatic IP, Static IP,
    PPPoE, PPPTP, L2TP, BigPond, WiMAX, USB Modem]
    and has no special page in the tree e.g. backup connection.

    That's all, thank you for any ideas.
    That sounds very interesting. I guess that with a cron or fork process pinging the primary interface and then altering the routing table can be an option. My concern is about the firewall. Would this imply having two set of firewall rules one for every interface?
    twitter

  3. #3
    Quote Originally Posted by Tamadite View Post
    That sounds very interesting. I guess that with a cron or fork process pinging the primary interface and then altering the routing table can be an option. My concern is about the firewall. Would this imply having two set of firewall rules one for every interface?
    This evening, after I opened this thread I saw this:

    http://wl500g.info/showthread.php?t=18004&page=32

    (sorry, last time I pasted a different link here)

    and I think also would be a problem if let's say I switch to another wan adapter and I offer services over wan as tftp
    serving a cisco router in upstream [with r/w rights to save it's configurations] and/or run onto asus router syslog-ng,
    snmpd and snmptrapd.

    If I am in trouble with iptables I can double the lines for each wan adapter (openvpn) like:

    iptables -t nat -I PREROUTING -i vlan1 -p udp --dport 1194 -j DNAT --to-destination `nvram get wan0_ipaddr`:1194

    iptables -t nat -I PREROUTING -i vlan1 -p udp --dport 1194 -j DNAT --to-destination `nvram get wan_modem_ipaddr`:1194


    BTW: I've noticed that this renewed Oleg firmware has different names
    for wan addapters than Koppel's as: wan is now wan0,
    modem's is wan0_modem, wimax's is wan0_wimax and so on...
    just check it all with nvram show | sort >nvram.txt
    The other part is switching "on the fly" the 3G modem from storage
    to modem (I'm not so experienced with it)...
    Last edited by fukushimaku; 10-04-2011 at 00:43.

  4. #4
    Join Date
    Nov 2004
    Location
    Sweden
    Posts
    259
    By bridging both interfaces WAN-eth and WAN-3G and then binding all services to it can be a solution. In other words firewall, FTP, WEB servers, etc. will be using the bridged WAN interface.
    twitter

  5. #5
    Quote Originally Posted by Tamadite View Post
    By bridging both interfaces WAN-eth and WAN-3G and then binding all services to it can be a solution. In other words firewall, FTP, WEB servers, etc. will be using the bridged WAN interface.
    well, switching-between-wan-adapters & storage-to-modem scripts are now my concern... about xinetd [tftp], probably an `only_from = ...` will solve it.

    ftp, http (served by router) are disabled / and/or through openvpn...

Similar Threads

  1. Two WAN connections at the same time
    By holla in forum WL-500gP Q&A
    Replies: 2
    Last Post: 27-09-2008, 15:28
  2. Enable TFTP on WAN port
    By Atter in forum WL-500gP Q&A
    Replies: 2
    Last Post: 22-09-2008, 08:37
  3. connection guard on an WL500g-XXXXX
    By rj.2001 in forum WL-500g/WL-500gx Tutorials
    Replies: 0
    Last Post: 03-05-2007, 11:18

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •