userdoc:tt_wan_failover

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
userdoc:tt_wan_failover [2018/06/18 14:32]
abelbeck [Example: 4G/LTE Modem Failover]
userdoc:tt_wan_failover [2021/01/19 13:15] (current)
mkeuter [AVM FRITZ!Box 6820v3 LTE as LTE Router]
Line 48: Line 48:
 The above network options define the "External Failover Interface" settings, just as the primary external interface is defined in the Network tab. The above network options define the "External Failover Interface" settings, just as the primary external interface is defined in the Network tab.
  
-!!Tip ->!! Any changes to these External Failover Interface settings will require a system reboot to be applied.+!!Note ->!! Any changes to these External Failover Interface settings will require a system reboot to be applied.
  
  
Line 97: Line 97:
   exit 0   exit 0
  
 +\\
 +===== Exit Action Script (optional) =====
 +
 +!!Note: AstLinux 1.3.7 or later is required!!
 +
 +Conditionally test when a Secondary -> Primary WAN link change is allowed to occur, by executing a script.
 +
 +If this script has an exit value of ''0'' the link change occurs, else with any other exit value the failover remains on the Secondary WAN.
 +
 +The script must be found at ''/mnt/kd/wan-failover-exit.script'' and be made executable...
 +
 +  chmod 755 /mnt/kd/wan-failover-exit.script
 +
 +Example: ''/mnt/kd/wan-failover-exit.script''
 +
 +  #!/bin/sh
 +  
 +  ##
 +  ## wan-failover-exit action script
 +  ##
 +  ## Automatically called before any Secondary -> Primary WAN link change
 +  ## and the Primary WAN link is reachable.
 +  ##
 +  ## If this script has an exit value of 0 the link change occurs.
 +  ## Else with any other exit value, the failover remains on the Secondary WAN.
 +  ##
 +  ## Note: Do not 'sleep' in this script, exit promptly.
 +  ##
 +  state="$1"
 +  primary_if="$2"
 +  primary_gw="$3"
 +  secondary_if="$4"
 +  secondary_gw="$5"
 +  secondary_gw_ipv6="$6"
 +  
 +  ## Sanity check, 'state' must be set properly
 +  if [ "$state" != "SECONDARY_EXIT" ]; then
 +    exit 0
 +  fi
 +  
 +  . /etc/rc.conf
 +  
 +  ##
 +  ## Allow Secondary -> Primary WAN link change ?
 +  ##
 +  
 +  ## Custom user.conf variable, if "yes" failover will not return to the Primary WAN link
 +  if [ "$CUSTOM_WAN_FAILOVER_STICKY" = "yes" ]; then
 +    exit 1
 +  fi
 +  
 +  ## Check Asterisk active calls, remain on the Secondary WAN link until no active calls
 +  active_calls="$(asterisk -rx 'core show channels' | sed -n -r -e 's/^([0-9]+) +active +call.*$/\1/p')"
 +  if [ -n "$active_calls" ] && [ $active_calls -gt 0 ]; then
 +    exit 1
 +  fi
 +  
 +  exit 0
 +
 +\\
 ===== Testing Failover ===== ===== Testing Failover =====
  
Line 113: Line 173:
 ===== PPPoE on Failover Interface ===== ===== PPPoE on Failover Interface =====
  
-AstLinux supports at most one instance of PPPoE internally, which can be defined for the primary external interface via the Network tab If instead, you want to use the only instance of PPPoE for the failover external interface, you need to manually define a few variables in the user.conf file. +AstLinux supports at most one instance of PPPoE internally, and when configured, it is always the Default Route destination. 
- +If you need PPPoE for the failover external interface, your only options are to perform the PPPoE encapsulation on another device.
-In this example, PPPoE is configured on the Failover interface using the interface ''eth2''... +
- +
-  PPPOEUSER="user" +
-  PPPOEPASS="pass" +
-  PPPOEIF="eth2" +
-  EXT2IF="ppp0"+
  
-As an alternative, some PPPoE modems can be configured to perform the PPPoE functionality in the modem and offer an IP address via DHCP to the connected client In this setup an instance of PPPoE internally is not required.  This is good solution if the modem can be configured in "bridgemode that does not add an extra NAT to the network path.+This can be achieved in two ways: 
 +  *   Terminating the WAN connection with a PPPoE capable router. In this scenario both Astlinux and the router will perform NAT which can be problematic for some traffic types such as voice. If voice traffic is being tunnelled through a VPN however, this should not be an issue. 
 +  *   Terminating the WAN connection with PPPoE capable modem configured into half bridge mode. In this scenario, the modem authenticates via PPPoE but bridges the Public IP Address to the Astlinux failover external interface via DHCP. This may be a better solution as an extra NAT is not added to the network path
 +!!Note ->!! If you are using half bridge mode, unless you have a static IP Address from your ISP the modem will not update the IP when it is changed until the next dhcp renewal. Due to this, most half-bridge modems use extremely short dhcp lease times which is not optimal. It is better to avoid dynamic IP's altogether and set the Astlinux failover external interface statically to the Public IP, with the DHCP client disabled in the modem.
  
 ===== Example: 4G/LTE Modem Failover ===== ===== Example: 4G/LTE Modem Failover =====
Line 283: Line 340:
     ... do stuff ...     ... do stuff ...
   fi   fi
 +  
 +===== AVM FRITZ!Box 6820v3 LTE as LTE Router =====
 +
 +The AVM FRITZ!Box series is very common in Germany and parts of Europe. The 6820 LTE should work across Europe.
 +
 +[[https://en.avm.de/products/fritzbox/fritzbox-6820-lte/|Product Info]]
 +
 +  * on the FRITZ!Box overview page click on the 3 dots in the upper right corner and enable "Advanced View"
 +  * under "Home Network/Network/Network Settings/IP Addresses" click on "IPv4 Addresses" and change the "IPv4 Address" (to e.g. ''192.168.5.1''), cause every FRITZ!Box by default uses ''192.168.178.1'' and that can lead to problems when using VPNs or other FRITZ!Boxes.
 +  * setup your AstLinux Failover interface with a static address from the same network (best below ''.20'' because of DHCP) e.g. ''192.168.5.11'' and reboot AstLinux.
 +  * under "Internet/Permit Access" click "Add Device for Sharing" and enable the "Exposed Host" function for your AstLinux Failover interface.
  • userdoc/tt_wan_failover.1529350376.txt.gz
  • Last modified: 2018/06/18 14:32
  • by abelbeck