Configure 3G modem as backup WAN link

This article explains how to configure 3G wireless modem as a backup to WAN connection.

Use 3G wireless modem as a back up to Internet/WAN connection and also achieve fallback to the primary link when Internet connectivity is back on the primary link. In a usual setup we would want to monitor the primary Internet/WAN connection and fail-over to 3G modem if there is no Internet access .
The main challenge would be to detect the failure, when a non-direct link failure happens.

Example : In case of ADSL connection, when telephone line goes down,the Ethernet link would still stay up but there would be no internet.

The configuration would be divided into 3 steps:

Step 1: Configure 3G wireless modem

To configure 3G wireless modem please refer: 3G Wireless Modem Configuration Overview
To trigger dialing of 3G modem interface you may use watch-list or dialer-filter

Step 2: Configure static default routes via both primary-link and dialer interface

In this step we would configure 2 default routes one pointing out via primary link and the other via dialer interface with qualified-next-hop option.
Note that we would configure the route via primary internet link with a preference of 5 and route via the dl0 interface with preference of 4.

Reason for the above is explained in the Expected Behavior section.

Step 3: Detect failure of primary Internet/WAN connection

This is achieved by using rpm and ip-monitoring

Basic configuration :

Configure rpm-probes and test :

For further details please refer: IP Monitoring with Route Fail-over Configuration and Behavior

Configure ip-monitoring :

Expected Behavior :

  • As long as the rpm probes are successful, the dl0.0 (dialer interface) would stay administratively down.
  • This would cause the route via dl0 interface to stay down
  • Once the primary internet connection goes down, this would trigger rpm to fail and IP-monitoring would cause dl0.0 interface to administratively go up.
  • This would in turn cause via dl0 interface to active in the forwarding table, as it has better preference that the route via primary internet link.
  • Fail-over to backup 3G link has been achieved.
  • Now when the internet is up via the primary internet link, the rpm test passes, this would trigger
  • IP-monitoring to bring down the dl0 interface down.
  • This would in turn cause the route via dl0 to be removed from the forwarding table.
  • Fail-over back to primary link is achieved.

About the author

Prasanna

Leave a Comment