Reply
Highlighted
New Member
Posts: 3
Registered: ‎03-01-2018
Accepted Solution

WAN failover ERlite

[ Edited ]

I new to edge routers.....just purchased the ER Lite router. and have upgraded it to EdgeRouter Lite v1.9.7+hotfix.4.   I ran the "Load Balacing" wizard and selected ETH1 to failover if ETH0 becomes inactive. Everything seems to be working fine, but when I perform a failover test and disconnect ETH0, all of the internet traffic does switch over to ETH1 as expected.   Except for my VOIP ATA.  It will  not fail over.  If i plug ETH0 back in, all of the internet traffic does switch back over and the ATA will re-register.


I tried pasting the confguration into this post via the "insert code" button, but it keeps telling me "unable to post messages over 25,0000 characters".......so i attached it in a txt file


Accepted Solutions
Regular Member
Posts: 339
Registered: ‎02-16-2014
Kudos: 40
Solutions: 7

Re: WAN failover ERlite

Here is a copy and paste of a little help doc I have for creating such a script that dumps the contrack

 

## Log into the router via Putty 
## then copy and paste line one then line 2, after line 2 it drops you to a blank line, you then need to
## copy and paste everything between the the #### lines and press <CTRL> d

cd /config/scripts
cat > failback.sh

########################## copy and paste from below ###########################

#!/bin/bash

GROUP=$1
INTF=$2
STATUS=$3

MYLOG="/var/log/wlb"
TS=$(date +"%Y%m%d-%T")

run=/opt/vyatta/bin/vyatta-op-cmd-wrapper
INTFDSCR=$($run show interfaces | grep $INTF | awk '{print $4}')

/usr/sbin/conntrack -F                                                                               

case "$STATUS" in
  active)
    msg="$TS: Internet connection $GROUP:$INTF:$INTFDSCR is active."   
    /config/scripts/pushover.sh "Router $(hostname) WAN fail-over event" "$msg" &
  ;;
  inactive)
   msg="$TS: Internet connection $GROUP:$INTF:$INTFDSCR is inactive."
  ;;
  failover)                                                                                                                          
    msg="$TS: Internet connection $GROUP:$INTF:$INTFDSCR is failover."                                                               
  ;;                                                                                                                                 
  *)                                                                                                                                 
   msg="$TS: Oh crap, $GROUP:$INTF:$INTFDSCR going [$STATUS]"                                                                        
  ;;                                                                                                                                 
esac                                                                                                                                 
                                                                                                                                     
echo $msg >> $MYLOG                                                                                                                  
logger $msg                                                                                                                          
exit 0 
############################# Stop copy at exit line ###############################

**Press <CTRL> d**
sudo chmod +x failback.sh
configure
set load-balance group G transition-script /config/scripts/failback.sh
commit
save

View solution in original post


All Replies
SuperUser
Posts: 20,367
Registered: ‎09-17-2013
Kudos: 5104
Solutions: 1455

Re: WAN failover ERlite

it's most likely that the VOIP thing has an active connection when the failover happens, so conntrack keeps trying to keep it up.

 

You'll need to have a failover script that dumps the conntrack table (forget the syntax offhand, I'll have to look it up)

Regular Member
Posts: 339
Registered: ‎02-16-2014
Kudos: 40
Solutions: 7

Re: WAN failover ERlite

Here is a copy and paste of a little help doc I have for creating such a script that dumps the contrack

 

## Log into the router via Putty 
## then copy and paste line one then line 2, after line 2 it drops you to a blank line, you then need to
## copy and paste everything between the the #### lines and press <CTRL> d

cd /config/scripts
cat > failback.sh

########################## copy and paste from below ###########################

#!/bin/bash

GROUP=$1
INTF=$2
STATUS=$3

MYLOG="/var/log/wlb"
TS=$(date +"%Y%m%d-%T")

run=/opt/vyatta/bin/vyatta-op-cmd-wrapper
INTFDSCR=$($run show interfaces | grep $INTF | awk '{print $4}')

/usr/sbin/conntrack -F                                                                               

case "$STATUS" in
  active)
    msg="$TS: Internet connection $GROUP:$INTF:$INTFDSCR is active."   
    /config/scripts/pushover.sh "Router $(hostname) WAN fail-over event" "$msg" &
  ;;
  inactive)
   msg="$TS: Internet connection $GROUP:$INTF:$INTFDSCR is inactive."
  ;;
  failover)                                                                                                                          
    msg="$TS: Internet connection $GROUP:$INTF:$INTFDSCR is failover."                                                               
  ;;                                                                                                                                 
  *)                                                                                                                                 
   msg="$TS: Oh crap, $GROUP:$INTF:$INTFDSCR going [$STATUS]"                                                                        
  ;;                                                                                                                                 
esac                                                                                                                                 
                                                                                                                                     
echo $msg >> $MYLOG                                                                                                                  
logger $msg                                                                                                                          
exit 0 
############################# Stop copy at exit line ###############################

**Press <CTRL> d**
sudo chmod +x failback.sh
configure
set load-balance group G transition-script /config/scripts/failback.sh
commit
save
Regular Member
Posts: 339
Registered: ‎02-16-2014
Kudos: 40
Solutions: 7

Re: WAN failover ERlite

But on a side note, wouldn't your VOIP provider be looking for your static IP from the primary wan connection, and when it fails over to the secondary its not using a different IP??

New Member
Posts: 3
Registered: ‎03-01-2018

Re: WAN failover ERlite

THANKS!!! Works perfectly
New Member
Posts: 3
Registered: ‎03-01-2018

Re: WAN failover ERlite

During all of my testing and with the previous router (TP-Link) I didn't have an issue with changing IP addresses.  I would assume, it would fail if both tried to connect at the same time... haven't ever tested that since I only have the one ATA (SPA 8000) that controls all of the phones.

Regular Member
Posts: 738
Registered: ‎11-06-2013
Kudos: 229
Solutions: 26

Re: WAN failover ERlite


@klinders5wrote:

But on a side note, wouldn't your VOIP provider be looking for your static IP from the primary wan connection, and when it fails over to the secondary its not using a different IP??


Not typically. Most providers use registration outbound form the site so they do not have to deal with updating IP addresses.

Emerging Member
Posts: 87
Registered: ‎09-05-2014
Kudos: 11

Re: WAN failover ERlite

have the same problem

voip will not switch back completely or something (the audio will only go 1 way, cannot hear the caller)
so every time failover happens I have to manually disable second line for all traffic to return to main line

is it going to be fixed or we have to use this custom script?

or anything can be done on voip ata? 

I also tried load balance instead of failover , all done with wizard
in load balance case I configured voip atas to be sticky to 1 line, but in event of failover same problem accures

currently I'm on v1.10.6

Reply