Network Interface Failover using FONA



Similar documents
Quick Note 53. Ethernet to W-WAN failover with logical Ethernet interface.

BASIC TCP/IP NETWORKING

4G Business Continuity Solution. 4G WiFi M2M Router NTC-140W

Sample Configuration Using the ip nat outside source static

Common Application Guide

HOWTO: Set up a Vyatta device with ThreatSTOP in router mode

VM-Series Firewall Deployment Tech Note PAN-OS 5.0

How To Configure A Network Monitor Probe On A Network Wire On A Microsoft Ipv6 (Networking) Device (Netware) On A Pc Or Ipv4 (Network) On An Ipv2 (Netnet) Or Ip

netkit lab static-routing Università degli Studi Roma Tre Dipartimento di Informatica e Automazione Computer Networks Research Group

Smart Tips. Enabling WAN Load Balancing. Key Features. Network Diagram. Overview. Featured Products. WAN Failover. Enabling WAN Load Balancing Page 1

MN-700 Base Station Configuration Guide

Guide for Updating Firmware and Troubleshooting Connection Issues

Setting up a Raspberry Pi as a WiFi access point

GlobalSCAPE DMZ Gateway, v1. User Guide

Legal Disclaimers. For C-UL Listed applications, the unit shall be installed in accordance with Part 1 of the Canadian Electrical Code.

+ iptables. packet filtering && firewall

Configuring SSL VPN on the Cisco ISA500 Security Appliance

Load Balancing. Outlook Web Access. Web Mail Using Equalizer

Network Management and Debugging. Jing Zhou

Chapter 1 Configuring Basic Connectivity

Policy Based Forwarding

Advanced Computer Network Technologies Project Configuration of mvpn. Noha Pavol noh031

Sample Configuration Using the ip nat outside source list C

Chapter 2 Connecting the FVX538 to the Internet

3.1 RS-232/422/485 Pinout:PORT1-4(RJ-45) RJ-45 RS-232 RS-422 RS-485 PIN1 TXD PIN2 RXD PIN3 GND PIN4 PIN5 T PIN6 T PIN7 R+ PIN8 R-

Wireless Router Setup Manual

FioranoMQ 9. High Availability Guide

1 Basic Configuration of Cisco 2600 Router. Basic Configuration Cisco 2600 Router

User s Manual TCP/IP TO RS-232/422/485 CONVERTER. 1.1 Introduction. 1.2 Main features. Dynamic DNS

Architecture and Data Flow Overview. BlackBerry Enterprise Service Version: Quick Reference

Wireless Communication With Arduino

Adafruit's Raspberry Pi Lesson 3. Network Setup

WiFi Anywhere. Multi Carrier 3G/4G WiFi Router. IntraTec Solutions Ltd

HOWTO: Set up a Vyatta device with ThreatSTOP in bridge mode

AXIS 205 Network Camera Goes anywhere your network goes

Broadband Phone Gateway BPG510 Technical Users Guide

Prestige 310. Cable/xDSL Modem Sharing Router. User's Guide Supplement

Configuring PA Firewalls for a Layer 3 Deployment

Packet filtering with Linux

Configuring your network settings to use Google Public DNS

Deploying the BIG-IP System with Oracle E-Business Suite 11i

Chapter 1 Configuring Internet Connectivity

Technical Notes TN 1 - ETG FactoryCast Gateway TSX ETG 3021 / 3022 modules. How to Setup a GPRS Connection?

Configuring WAN Failover with a Cisco 881 Router and an AirLink ES440

Mediatrix 4404 Step by Step Configuration Guide June 22, 2011

SSH to BeagleBone Black over USB

How To Connect A Raspberry Pi To The Internet On A Microsoft Moonstone 2 (Microsoft) Microsoft Powerbook 2 (Powerbook 2) (Powerboard 2) And Powerbook 3 (Powerstation 2)

Linksys Gateway SPA2100-SU Manual

Welcome. Unleash Your Phone

RMCS Installation Guide

Configuring Health Monitoring

Lab 1: Introduction to the network lab

Introduction To Computer Networking

Broadband ADSL2+ Modem DM111PSPv2

Protecting the Home Network (Firewall)

THE HONG KONG POLYTECHNIC UNIVERSITY Department of Electronic and Information Engineering

IP Power Stone 4000 User Manual

TW100-BRV204 VPN Firewall Router

Using IPM to Measure Network Performance

Phone Adapter. with 2 Ports for Voice-over-IP. Installation and Troubleshooting Guide. Model No. PAP2 Ver. 2. Voice

이 기기는 업무용 급 으로 전자파적합등록을 한 기기이오니 판매자 또는 사용자는 이점을 주의하시기 바라며 가정 외의 지역에서 사용하는 것을 목적으로 합니다

How to establish a Leased Line Connection

If you are unable to set up your Linksys Router by using one of the above options, use the steps below to manually configure your router.

Broadband Router ALL1294B

Load Balancing Trend Micro InterScan Web Gateway

Managing Multiple Internet Connections with Shorewall

Subnetting,Supernetting, VLSM & CIDR

Configuring Failover

Network Configuration Example

1:1 NAT in ZeroShell. Requirements. Overview. Network Setup

Broadband Router User s Manual

Note: This case study utilizes Packet Tracer. Please see the Chapter 5 Packet Tracer file located in Supplemental Materials.

Load Balancing McAfee Web Gateway. Deployment Guide

Configuring Static and Dynamic NAT Simultaneously

Chapter 4 Managing Your Network

! encor e networks TM

TW100-BRF114 Firewall Router. User's Guide. Cable/DSL Internet Access. 4-Port Switching Hub

IP Address and Pre-configuration Information

Nokia Siemens Networks. CPEi-lte User Manual

Managed Appliance Installation Guide

Guideline for setting up a functional VPN

CS 326e F2002 Lab 1. Basic Network Setup & Ethereal Time: 2 hrs

AdRadionet to IBM Bluemix Connectivity Quickstart User Guide

Chapter 7 Troubleshooting

Lab Configure Cisco IOS Firewall CBAC

LAB THREE STATIC ROUTING

Load Balancing Web Proxies Load Balancing Web Filters Load Balancing Web Gateways. Deployment Guide

TCP/IP Network Essentials. Linux System Administration and IP Services

WiFi Cable Modem Router C3700

Configuring Enhanced Object Tracking

Chapter 8 Router and Network Management

PePWave Surf Series PePWave Surf Indoor Series: Surf 200, AP 200, AP 400

Digicom Remote Control for the SRT

Configuring Switch Ports and VLAN Interfaces for the Cisco ASA 5505 Adaptive Security Appliance

Barracuda Link Balancer Administrator s Guide

Using RADIUS Agent for Transparent User Identification

Scalable Linux Clusters with LVS

Configuring the BIG-IP and Check Point VPN-1 /FireWall-1

Hylas 2 - freedomsat Installation Guide

Transcription:

Network Interface Failover using FONA Created by Adam Kohring Last updated on 2014-10-20 12:30:12 PM EDT

Guide Contents Guide Contents Overview Prerequisites Wiring Raspberry Pi to Fona ifacefailover Service Install the Source Code Routes Route Verifiers Route Handlers Property Configuration Logging Configuration General Packet Radio Service (GPRS) Configuration Point-to-Point Protocol (PPP) Configuration Restart the Service Log Verification Primary Route Verification Simulate a Network Outage Automatic Recovery from a Network Outage 2 3 6 7 7 8 8 8 8 9 9 11 11 12 12 13 13 14 16 Adafruit Industries https://learn.adafruit.com/network-interface-failover-using-fona Page 2 of 17

Overview Adafruit Industries https://learn.adafruit.com/network-interface-failover-using-fona Page 3 of 17

Adafruit Industries https://learn.adafruit.com/network-interface-failover-using-fona Page 4 of 17

Do you hate it when the internet goes down in your area? Do you want to be notified when your internet goes down when you are away from home? Do you have a project that needs 100% internet availability where you would need to be notified of service disruption? This guide will show you how use FONA as a secondary cellular connection to the internet with automatic failover and real time notifications. I built a home security system to set off an alarm and notify me in the event of an intruder break in. The home security system requires an internet connection to route a message to my phone when the house is under attack. In the event of an internet outage someone could break into my house without my knowledge. To resolve this issue, I wrote a service to monitor my primary internet connection. When the service detects an internet outage it will automatically reroute all outbound traffic over a cellular network using the Adafruit FONA. A message will then be sent to my phone over the data plan to let me know my that my data plan is actively being used to route traffic. Once the primary internet connection is available, the data plan will no longer be used and all traffic will be automatically routed back to the primary interface. Adafruit Industries https://learn.adafruit.com/network-interface-failover-using-fona Page 5 of 17

Prerequisites For Raspberry Pi and BeagleBone Black, follow the FONA Tethering Setup Guide (http://adafru.it/e2n) to install and configure the Point-to-Point Protocol daemon for Fona. If you are already familiar with the tethering setup guide and installing ifacefailover on a fresh Raspberry Pi, in the next section you can execute the bin/raspberrypiinstall.sh script instead of the bin/install.sh script to automatically disable the kernel's use of the hardware serial connection, install ppp, and download the Fona ppp peer prior to installing the ifacefailover service. Adafruit Industries https://learn.adafruit.com/network-interface-failover-using-fona Page 6 of 17

Wiring Raspberry Pi to Fona Power Status (PS) and Key pins are tied to GPIO pins so the Fona can be turned on and off programmatically. Your data plan is only used in the event of a failover. Adafruit Industries https://learn.adafruit.com/network-interface-failover-using-fona Page 7 of 17

ifacefailover Service Install the Source Code We will be using the open source python service ifacefailo ver to monitor a network interface and reroute all outbound network traffic to Fona in the event of an outage. Clone the ifacefailover repository from GitHub and execute the install.sh script from the bin directory. This will create the appropiate directory structure under /opt, link to the recently checked out source code, install the required python dependencies, and create the startup service /etc/init.d/ifacefailover. The following commands should be executed on the device you wish to install ifacefailover. sudo mkdir -p /opt/git/ifacefailover sudo git clone https://github.com/shellbit/ifacefailover.git /opt/git/ifacefailover sudo /opt/git/ifacefailover/bin/install.sh Routes Routes are how your device connects to the internet and other devices. Routes are established on a network interface through an ethernet cable, wireless card, or even UART pins. ifacefailover routes are configured in the ifacefailover.properties file. You can define as many failover routes as you wish. The order you define the routes in the properties file matters! The first route defined in the properties file is your primary route. The ifacefailover service will always try to restore connection to your primary route in the event of a failover. If your primary route goes down, ifacefailover will try to failover to your secondary route. If your primary route and secondary route are down, ifacefailover will try to failover to your tertiary route, and so on and so forth until it detects an available route. You can view the current routes on a Linux device by running the following command. ifacefailover simply rewrites your default route (0.0.0.0) to a different gateway and interface in the event of a failover. $ route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 wlan0 192.168.1.0 0.0.0.0 255.255.255.0 U 2 0 0 wlan0 Route Verifiers ifacefailover uses Route Verifiers to determine if a route is healthy and capable routing Adafruit Industries https://learn.adafruit.com/network-interface-failover-using-fona Page 8 of 17

packets. Route verifiers are implemented as python classes and must return a boolean value to determine if the route is available. We will be using an ICMP route verifier to send ping echo request packets to target servers outside our network. Route verifiers are not limited to ICMP requests. We could have used HTTP, a raw socket connection, or even implemented our own custom protocol to verify the route. Checkout the ifacefailover wiki (http://adafru.it/e2o) on GitHub for more examples and if you write a route verifier that could be used by others, please consider contributing it to the ifacefailover open source project. Route Handlers Route Handlers provide hooks into the ifacefailover service. They allow you to log failover events, send event notifications, start or stop running processes, and anything else you want to do throughout the lifecycle of the route. You can associate as many route handlers as you wish to a route. We will be using the Log Handler to log events, the HTTP Handler to send failover events to the Google Cloud Messaging service, and the Fona Raspberry Pi Handler to turn the Fona on and off pre and post failover. Checkout the ifacefailover wiki (http://adafru.it/e2o) on GitHub for more examples and if you write a route handler that could be used by others, please consider contributing it to the ifacefailover open source project. Property Configuration Routes, Route Handlers, and Route Verifiers must be configured in the ifacefailover.properties file. To configure a route, open the /opt/ifacefailover/config/ifacefailover.properties file in your favorite editor. This property file contains key/value pairs of properties used by the ifacefailover service. The route configuration format is route.name.property=value. So the property route.primary.gateway=192.168.1.1 means configure a route named primary and set its gateway property to 192.168.1.1. Below are a list of configurable route properties. gateway (required): This is the IP address used to access other networks internally or across the internet. For home networks, this is typically 192.168.1.1. For the Fona route, use 0.0.0.0. iface (required): This is a string value representing the network interface associated with the route. If your device is connected to the internet via an ethernet cable, this will probably be eth0. The number may vary based on how many network interfaces are on your device. For a wireless connection, you will probably use wlan0. For Fona, use ppp0. targets (optional): This is a comma delimited list of IP Addresses used to verify if the route is available. The IP Addresses will be created as static routes (pegged to the defined route interface) on startup. This allows ifacefailover to verify the route by sending requests to the target on the specific interface that failed. For our example, Adafruit Industries https://learn.adafruit.com/network-interface-failover-using-fona Page 9 of 17

we will be using the Google primary and secondary DNS servers of 8.8.8.8 and 8.8.4.4. You can specify any number of IP addresses. The ICMP Verifier we will be using will only failover if all targets are unavailable. Verifiers are 100% configurable, so you can change this functionality as needed by updating the isrouteavailable method on the verifier or by creating your own custom verifier. verifier (optional): This is a route verifier (as described above) that has been serialized to a Python pickle file. This value should be the absolute path to the serialized pickle file of the route verifier. Check under /opt/ifacefailover/src/verifier for a list of preserialized verifiers. verifierdelay (optional): This is the interval in seconds to wait between verification requests. If not specificed, this will default to 0 seconds. verifierkwargs (optional): This is a Python dictionary of Keyword Arguments (Kwargs) that will be passed to the route verifier. Use verifierkwargs to externally configure your route verifiers. handlers (optional): This is a Python list of route handlers (as described above) that have been serialized to Python pickle files. Each item of the list should be an absolute path to a pickle file. You can specify as many handlers as you want and they will be executed in the order defined. Check under /opt/ifacefailover/src/handler for a list of preserialized handlers. handlerkwargs (optional): This is a list of Python dictionaries of Keyword Arguments (Kwargs) that will be passed to the route handler. Use handlerkwargs to externally configure your route handlers. Each dictionary item in the list will passed to the corresponding handler defined in the handler property. You will need to create the following ifacefailover.properties file under /opt/ifacefailover/config. This will define a primary route on eth0 (ethernet connection) and a secondary route on ppp0 (fona). You can specify any number of routes in this file, they will be loaded in the order specified. Please be sure to update each property value accordingly. If you change the location or name of this file, you will need to update the /etc/init.d/ifacefailover startup script with the new value. # Defines the location of the external Python logging configuration file log.properties=/opt/ifacefailover/config/log.properties # The following properties configure the primary route # This is the gateway of your router route.primary.gateway=192.168.1.1 # This will probably be eth0 for wired connections and wlan0 for wireless connections route.primary.iface=eth0 # We are using the Google primary and secondary DNS servers for route verification route.primary.targets=8.8.8.8,8.8.4.4 # Wait 10 seconds between verification requests route.primary.verifierdelay=10 # We are using an ICMP route verificer to send ping echo requests route.primary.verifier=/opt/ifacefailover/config/icmprouteverifier.pkl Adafruit Industries https://learn.adafruit.com/network-interface-failover-using-fona Page 10 of 17

route.primary.verifier=/opt/ifacefailover/config/icmprouteverifier.pkl # The ICMP verifier is configured with a response timeout of 1 second and will retry 2 times route.primary.verifierkwargs={'timeout':1, 'maxretry':2} # We will use the loghandler to log the lifecycle of the route and the httphandler to send failover events to a web route.primary.handlers=['/opt/ifacefailover/config/loghandler.pkl','/opt/ifacefailover/config/httphandler.pkl' # The loghandler is configured with a name property to log the route name # The httphandler is configured with an authentication tuple, a url, and url suffixes to send different types of even route.primary.handlerkwargs=[{'name':'primary'}, {'auth':('username', 'password'), 'url':'https://localhost:5000/my # The following properties configure the secondary route used for failover # Fona's gateway is 0.0.0.0 route.fona.gateway=0.0.0.0 # Fona is running on the ppp0 interface route.fona.iface=ppp0 # Fona is configured with a loghandler to log lifecycle events # A fonaraspberrypihandler to turn the Fona on and off and start and stop the point-to-point protocol daemon # And an httphandler to send failover events route.fona.handlers=['/opt/ifacefailover/config/loghandler.pkl','/opt/ifacefailover/config/fonaraspberrypihandler.pk # The loghandler is configured with a name property to log the route name # The fonaraspberrypihandler is configured with the GPIO pin number connected to the Fona PS pin and the GPIO # The httphandler is configured with an authentication tuple, a url, and url suffixes to send different types of even route.fona.handlerkwargs=[{'name':'fona'},{'powerstatuspin':23, 'keypin':24},{'auth':('username', 'password' Logging Configuration ifacefailover loads its Python logging configuration from an external property file. The location of the property file must be specified as a property in /opt/ifacefailover/config/ifacefailover.properties. The property name is lo g.pro perties and the value should be the absolute path to the logging configuration file. The default file is /opt/ifacefailover/config/log.properties. Read the Python Reference Documentation (http://adafru.it/e2p) for more information on the logging configuration file format. General Packet Radio Service (GPRS) Configuration If you followed the prerequisites section of the guide, you should already have chatscripts installed with a gprs config at /etc/chatscripts/gprs. Use the root user to edit this file and reduce the default timeout value from 12 to 1 for a quicker timeout. # cease if the modem is not attached to the network yet Adafruit Industries https://learn.adafruit.com/network-interface-failover-using-fona Page 11 of 17

ABORT "+CGATT: 0" "" AT TIMEOUT 1 OK ATH OK ATE1 Point-to-Point Protocol (PPP) Configuration If you followed the prerequisites section of the guide, you should already have Point-to-Point Protocol Daemon (pppd) installed with a fona peer listed under /etc/ppp/peers. Use the root user to add the following configuration properties to /etc/ppp/peers/fona. # If this option is given, pppd will send an LCP echo-request frame to the # peer every n seconds. Normally the peer should respond to the echo-request # by sending an echo-reply. This option can be used with the # lcp-echo-failure option to detect that the peer is no longer connected. lcp-echo-interval 5 # If this option is given, pppd will presume the peer to be dead if n # LCP echo-requests are sent without receiving a valid LCP echo-reply. # If this happens, pppd will terminate the connection. Use of this # option requires a non-zero value for the lcp-echo-interval parameter. # This option can be used to enable pppd to terminate after the physical # connection has been broken (e.g., the modem has hung up) in # situations where no hardware modem control lines are available. lcp-echo-failure 1 # Terminate after n consecutive failed connection attempts. # A value of 0 means no limit. The default value is 10. maxfail 0 # Specifies how many seconds to wait before re-initiating the link after # it terminates. This option only has any effect if the persist or demand # option is used. The holdoff period is not applied if the link was # terminated because it was idle. holdoff 1 Restart the Service Once you have updated all the ifacefailover properties, you will need to restart the service. Adafruit Industries https://learn.adafruit.com/network-interface-failover-using-fona Page 12 of 17

$ sudo service ifacefailover restart Restarting ifacefailover Stopping ifacefailover Starting ifacefailover Log Verification You should now see a log statement every 10 seconds letting you know ifacefailover is monitoring your primary route. $ tail -f /opt/ifacefailover/logs/out.log 2014-10-02 03:00:10,075 root : INFO uproutes=8.8.8.8, 8.8.4.4; downroutes= 2014-10-02 03:00:20,163 root : INFO uproutes=8.8.8.8, 8.8.4.4; downroutes= 2014-10-02 03:00:30,252 root : INFO uproutes=8.8.8.8, 8.8.4.4; downroutes= ^C Press ctrl+c to exit Primary Route Verification We also need to verify ifacefailover service setup our primary route correctly by running the following command. We should see the primary route with default destination of 0.0.0.0 on the correct interface and two static routes on this interface with destinations set to the Google primary and secondary DNS servers. $ route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0 8.8.4.4 192.168.1.1 255.255.255.255 UGH 0 0 0 eth0 8.8.8.8 192.168.1.1 255.255.255.255 UGH 0 0 0 eth0 You should be able to ping adafruit through your primary interface. $ ping -I eth0 adafruit.com PING adafruit.com (207.58.139.247) from 192.168.1.143 eth0: 56(84) bytes of data. 64 bytes from vps3.ladyada.net (207.58.139.247): icmp_req=1 ttl=55 time=38.3 ms 64 bytes from vps3.ladyada.net (207.58.139.247): icmp_req=2 ttl=55 time=38.1 ms 64 bytes from vps3.ladyada.net (207.58.139.247): icmp_req=3 ttl=55 time=38.0 ms Adafruit Industries https://learn.adafruit.com/network-interface-failover-using-fona Page 13 of 17

^C --- adafruit.com ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2003ms rtt min/avg/max/mdev = 38.042/38.189/38.366/0.208 ms Simulate a Network Outage Unplug the ethernet cable from your modem. Within 10 seconds, ifacefailover should detect your primary route is down and failover to Fona. A blue light on the Fona will turn on indicating that Fona is booted and running. A red light will start blinking to indicate signal strength. You should also see the following output in the logs. This can take up to 5 minutes so be patient. $ tail -f /opt/ifacefailover/logs/out.log 2014-10-03 01:18:01,179 root : INFO uproutes=8.8.8.8, 8.8.4.4; downroutes= 2014-10-03 01:18:15,203 root : INFO uproutes=; downroutes=8.8.8.8, 8.8.4.4 2014-10-03 01:18:15,206 root : INFO Tearing down connection to primary 2014-10-03 01:18:15,210 root : INFO Setting up connection to fona 2014-10-03 01:18:18,612 root : INFO Adding route ppp0; attempt 1 of 120 2014-10-03 01:18:18,620 root : ERROR (19, 'No such device') 2014-10-03 01:18:19,131 root : INFO Adding route ppp0; attempt 2 of 120 2014-10-03 01:18:19,135 root : ERROR (19, 'No such device') 2014-10-03 01:18:19,639 root : INFO Adding route ppp0; attempt 3 of 120 2014-10-03 01:18:19,643 root : ERROR (19, 'No such device')... 2014-10-03 01:18:35,892 root : INFO Adding route ppp0; attempt 35 of 120 2014-10-03 01:18:35,895 root : ERROR (19, 'No such device') 2014-10-03 01:18:36,400 root : INFO Adding route ppp0; attempt 36 of 120 2014-10-03 01:18:36,404 root : INFO Connection failed on primary 2014-10-03 01:18:36,407 root : INFO Attempting POST request 1 of 120 2014-10-03 01:18:36,734 requests.packages.urllib3.connectionpool: INFO Starting new HTTPS connection 2014-10-03 01:18:56,762 root : ERROR ('Connection aborted.', gaierror(-2, 'Name or service not known' 2014-10-03 01:18:57,266 root : INFO Attempting POST request 2 of 120 2014-10-03 01:18:57,287 requests.packages.urllib3.connectionpool: INFO Starting new HTTPS connection 2014-10-03 01:19:17,309 root : ERROR ('Connection aborted.', gaierror(-2, 'Name or service not known' 2014-10-03 01:19:17,815 root : INFO Attempting POST request 3 of 120 2014-10-03 01:19:17,836 requests.packages.urllib3.connectionpool: INFO Starting new HTTPS connection 2014-10-03 01:19:37,859 root : ERROR ('Connection aborted.', gaierror(-2, 'Name or service not known'... 2014-10-03 01:22:22,830 root : INFO Attempting POST request 12 of 120 Adafruit Industries https://learn.adafruit.com/network-interface-failover-using-fona Page 14 of 17

2014-10-03 01:22:39,225 requests.packages.urllib3.connectionpool: DEBUG "POST /app/event/primaryconnection 2014-10-03 01:22:51,506 requests.packages.urllib3.connectionpool: DEBUG "POST /app/event/fonaconnected HTT 2014-10-03 01:22:22,868 requests.packages.urllib3.connectionpool: INFO Starting new HTTPS connection 2014-10-03 01:22:39,260 root : INFO Failing over to fona 2014-10-03 01:22:39,263 root : INFO Attempting POST request 1 of 120 2014-10-03 01:22:39,285 requests.packages.urllib3.connectionpool: INFO Starting new HTTPS connection 2014-10-03 01:22:55,129 root : INFO uproutes=; downroutes=8.8.8.8, 8.8.4.4 2014-10-03 01:22:58,129 root : INFO uproutes=; downroutes=8.8.8.8, 8.8.4.4 2014-10-03 01:23:01,129 root : INFO uproutes=; downroutes=8.8.8.8, 8.8.4.4 You should now see the ppp0 interface (Fona) defined as your default destination and your static routes should still be visible. $ route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 0.0.0.0 0.0.0.0 U 0 0 0 ppp0 8.8.4.4 192.168.1.1 255.255.255.255 UGH 0 0 0 eth0 8.8.8.8 192.168.1.1 255.255.255.255 UGH 0 0 0 eth0 10.64.64.64 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0 You should be able to ping adafruit.com using your new default destination (Fona) but not by specifying your primary route interface (Ethernet). $ ping adafruit.com PING adafruit.com (207.58.139.247) 56(84) bytes of data. 64 bytes from vps3.ladyada.net (207.58.139.247): icmp_req=1 ttl=46 time=1001 ms 64 bytes from vps3.ladyada.net (207.58.139.247): icmp_req=2 ttl=46 time=559 ms 64 bytes from vps3.ladyada.net (207.58.139.247): icmp_req=3 ttl=46 time=555 ms ^C64 bytes from vps3.ladyada.net (207.58.139.247): icmp_req=4 ttl=46 time=555 ms --- adafruit.com ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3284ms rtt min/avg/max/mdev = 555.530/668.125/1001.435/192.446 ms, pipe 2 $ ping -I ppp0 adafruit.com PING adafruit.com (207.58.139.247) from 100.117.205.166 ppp0: 56(84) bytes of data. 64 bytes from vps3.ladyada.net (207.58.139.247): icmp_req=1 ttl=46 time=959 ms 64 bytes from vps3.ladyada.net (207.58.139.247): icmp_req=2 ttl=46 time=560 ms 64 bytes from vps3.ladyada.net (207.58.139.247): icmp_req=3 ttl=46 time=560 ms ^C64 bytes from vps3.ladyada.net (207.58.139.247): icmp_req=4 ttl=46 time=560 ms Adafruit Industries https://learn.adafruit.com/network-interface-failover-using-fona Page 15 of 17

--- adafruit.com ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3638ms rtt min/avg/max/mdev = 560.197/660.109/959.702/172.970 ms $ ping -I eth0 adafruit.com PING adafruit.com (207.58.139.247) from 100.117.205.166 eth0: 56(84) bytes of data. From 192.168.1.143 icmp_seq=1 Destination Host Unreachable From 192.168.1.143 icmp_seq=2 Destination Host Unreachable From 192.168.1.143 icmp_seq=3 Destination Host Unreachable ^C --- adafruit.com ping statistics --- 4 packets transmitted, 0 received, +3 errors, 100% packet loss, time 5146ms pipe 4 Automatic Recovery from a Network Outage Plug the ethernet cable back into your modem. Within 10 seconds, ifacefailover should detect your primary route is back online and turn off Fona. You should no longer see the solid blue or the red blinking lights on the Fona. You should see the following output in the logs. 2014-10-03 01:25:03,350 requests.packages.urllib3.connectionpool: DEBUG "POST /app/event/primaryconnection $ tail -f /opt/ifacefailover/logs/out.log 2014-10-03 01:24:52,139 root : INFO uproutes=; downroutes=8.8.8.8, 8.8.4.4 2014-10-03 01:24:53,970 root : INFO uproutes=8.8.8.8, 8.8.4.4; downroutes= 2014-10-03 01:24:53,973 root : INFO Tearing down connection to fona 2014-10-03 01:24:56,272 root : INFO Setting up connection to primary 2014-10-03 01:24:56,279 root : INFO Adding route eth0; attempt 1 of 120 2014-10-03 01:24:56,282 root : INFO Connection restored to primary 2014-10-03 01:24:56,285 root : INFO Attempting POST request 1 of 120 2014-10-03 01:24:56,318 requests.packages.urllib3.connectionpool: INFO Starting new HTTPS connection 2014-10-03 01:25:13,544 root : INFO uproutes=8.8.8.8, 8.8.4.4; downroutes= 2014-10-03 01:25:23,643 root : INFO uproutes=8.8.8.8, 8.8.4.4; downroutes= 2014-10-03 01:25:33,734 root : INFO uproutes=8.8.8.8, 8.8.4.4; downroutes= And your default destination should now be pointed back to your primary route. $ route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0 Adafruit Industries https://learn.adafruit.com/network-interface-failover-using-fona Page 16 of 17

8.8.4.4 192.168.1.1 255.255.255.255 UGH 0 0 0 eth0 8.8.8.8 192.168.1.1 255.255.255.255 UGH 0 0 0 eth0 Adafruit Industries Last Updated: 2014-10-20 12:30:13 PM EDT Page 17 of 17