How to enable redundancy with IP network failure on an AnywhereUSB 24 Plus device.

In this article, we will describe How to enable redundancy with IP network failure on an AnywhereUSB 24 Plus device.

 

The Digi AnywhereUSB/14 family had a feature called  "IP Network Failover" , which allowed forrecovery from an Ethernet uplink failure to the upstream default gateway.

The Digi AnywhereUSB 24 Plus device does not currently support this feature out of the box

It is however possible to implement such feature with the use of ashell script and an Ethernet bonding interface.

To simulate IP Network Failover on an AnywhereUSB 24 Plus, two network cables should be connected to the network interfaces "ETH1" and "ETH2". ETH1 is considered as the primary network interface, and ETH2 is considered as the secondary.

 These two cables should ideally be connected to two different Ethernet switches - ETH1/primary to what we will call the primary switch and ETH2/secondary to what we will call the secondary switch.

In this scenario, if the primary switch fails (either the port that the AnywhereUSB/14 is connected to or the switch as a whole), the secondary switch would take over.

Next, a Bonding interface must be configured on the device according to the knowledge base article below:

https://www.digi.com/support/knowledge-base/ethernet-bonding-configuration-on-digi-awusb-plus

Finally, you need to install and configure the following shell script , which will start to monitor the availability of the upstream default gateway by IP address via the ping utility and switch over the active Ethernet bonding link to the other Ethernet link if the ping utility does not get a reply.

 

Configuration>System>Scheduled tasks>Custom scripts>Script

 

 

Shell script body:

 

#!/bin/bash

ping -c1 10.1.1.23 > /dev/null

if [[ "$?" == "0" ]]; then

    echo "ok"

else

    echo "fail"

    int="$(grep -w '^Currently Active Slave' /proc/net/bonding/bond0 | grep -ow 'eth[0-9]')"

    if [[ "$int" == "eth1" ]]; then

        echo "switching to eth2"

        echo eth2 > /sys/class/net/bond0/bonding/active_slave

    else

        echo "switching to eth1"

        echo eth1 > /sys/class/net/bond0/bonding/active_slave

    fi

fi


You can check the status of the active Ethernet link via shell commands:

# cat /proc/net/bonding/bond0

Ethernet Channel Bonding Driver: v5.17.0-ac0

 

Bonding Mode: fault-tolerance (active-backup)

Primary Slave: eth1 (primary_reselect always)

Currently Active Slave: eth1

MII Status: up

MII Polling Interval (ms): 100

Up Delay (ms): 0

Down Delay (ms): 0

Peer Notification Delay (ms): 0

 

Slave Interface: eth1

MII Status: up

Speed: 100 Mbps

Duplex: full

Link Failure Count: 0

Permanent HW addr:

Slave queue ID: 0

 

Slave Interface: eth2

MII Status: up

Speed: 100 Mbps

Duplex: full

Link Failure Count: 0

Permanent HW addr:

Slave queue ID: 0
 

 

 

Last updated: Dec 20, 2022

Related Articles

Recently Viewed

No recently viewed articles

Did you find this article helpful?