This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Failover between interfaces

Does anyone out there know if it is possible for ASL4 to failover to a secondary interfase in the invent that the primary one goes down.  This would be to safe guard from internet outages should one ISP go down.  


This thread was automatically locked due to age.
Parents
  • I dont believe this is possible...

    Matter of interest, if you are looking for resilience, are you not doing this at the router level using a protocol such as BGP4 ?  
  • I'm no Linux expert, but you might be able to run VRRP (virtual router redndancy protocol) or compile it into the kernel if it is not already supported?  VRRP would create a virtual address that your ISP could point to.  As long as at least one real interface is up, then the VRRP virtual address will be valid.  
Reply
  • I'm no Linux expert, but you might be able to run VRRP (virtual router redndancy protocol) or compile it into the kernel if it is not already supported?  VRRP would create a virtual address that your ISP could point to.  As long as at least one real interface is up, then the VRRP virtual address will be valid.  
Children
  • I do this with the following script which runs from cron every 5 minutes:-

    #
    # Check for response from several hosts - if they fail switch default
    # gateway to another interface.
    #
    DG1IF=eth1 # Primary Default gateway interface
    DG2IF=eth3 # Secondary default gateway interface
    DG1IP=10.0.0.1 # Primary interface IP address
    DG2IP=10.0.0.2 # Secondary interface IP address
    #
    # List of remote hosts to be checked against
    #
    CHECKHOST1=www.utvinternet.com # First remote host to check
    CHECKHOST2=www.google.com # Second remote host to check
    CHECKHOST3=www.bbc.co.uk # Third remote host to check
    #
    # List to email addreses to be alerted when change takes place
    #
    EMAILADDR=abc@xyz.com
    MSG=/tmp/err_msg.txt
    #
    # Send a mail message to alert admin of route change
    #
    send_mail ()
    {
       echo "\nFirewall default route has been automatically changed to $1 $2\n" >> $MSG
       /usr/local/bin/anotifier "NOTICE: Firewall default route changed" $MSG $EMAILADDR
    rm  -f $MSG
    }
    #
    # Try to ping each host 5 times
    #
    PINGCOUNT=5
    ping -c ${PINGCOUNT} $CHECKHOST1 2>&1 > /dev/null
    retval1=$?
    ping -c ${PINGCOUNT} $CHECKHOST2 2>&1 > /dev/null
    retval2=$?
    ping -c ${PINGCOUNT} $CHECKHOST3 2>&1 > /dev/null
    retval3=$?

    if [ "${retval1}" -eq "1" -a "${retval2}" -eq "1"  -a "${retval3}" -eq 1 ]
    then
    echo "Network problems ${CHECKHOST1}=${retval1} ${CHECKHOST2}=${retval2} ${CHECKHOST3}=${retval3}" > ${MSG}
    /bin/ip route del default via ${DG1IP}
    /bin/ip route add default via ${DG2IP} dev ${DG2IF}
    /bin/ip route add default via ${DG1IP} dev ${DG1IF}
    send_mail ${DG2IP} ${DG2IF}
    /bin/ip route ls >> /root/route/.switch
    else
    echo "Network OK  ${CHECKHOST1}=${retval1} ${CHECKHOST2}=${retval2} ${CHECKHOST3}=${retval3}" 2>&1 > /dev/null
    fi
    touch /root/route/.done


    Change the interface and IP addresses to suit your configuration.
    I used this with v3 of ASL and it works very well - it may work with v4 but I have not tested it.

    John