2

If I create a connection using network bonding (using the mode active-backup), then although automatic switching to the backup network occurs if I pull out the network cable, it does not occur when the problem is no packets getting through.

What can I do to enable automatic switching to the backup network when there is packet loss on the primary with switching back when the primary is working properly (much like how network bonding with mode active-backup seamlessly switches between primary and backup and back when pulling out and plugging back in the network cable)?

5
  • @RuiFRibeiro I am interested in a solution that deals with failover (which need not use network bonding).
    – mcarans
    Mar 6, 2019 at 14:44
  • @RuiFRibeiro this is incorrect. Bonding manages failover, there is even a mode that does nothing but failover, active-backup.
    – wazoox
    Mar 6, 2019 at 15:22
  • If I understand your question correctly, you'd like to detect the absence of network traffic on a determined interface? This isn't in the realm of failover and bonding. You must provide more information on what you are trying to achieve.
    – wazoox
    Mar 6, 2019 at 15:25
  • @wazoox I have completed reworded it. Is it clearer now?
    – mcarans
    Mar 6, 2019 at 15:37
  • @mcarans Yes I got it :) I'm writing an answer.
    – wazoox
    Mar 6, 2019 at 15:43

1 Answer 1

2

By default (AFAIK), the bonding driver uses only mii monitoring to test for interface availability, i.e. carrier presence.

However you may want to use ARP monitoring, eventually for only some specific targets (for instance your main router) to test for incoming arp packets instead.

The process is described in the Linux bonding documentation.

Basically you may monitor a target (up to 16 overall) this way:

echo +192.168.1.1 > /sys/class/net/bond0/bonding/arp_ip_target

Generally you'll want to set a correct value (not too long, not too short, to be tested in operation) for the arp monitoring interval (in ms):

echo 100 > /sys/class/net/bond0/bonding/arp_interval

 

3
  • 1
    This sounds promising. So using nmcli I guess I would do: nmcli con add type bond con-name bond ifname bond0 mode active-backup primary myeth0 +bond.options "fail_over_mac=active,arp_interval=100,arp_ip_target=192.168.1.1,primary_reselect=always,updelay=200" right?
    – mcarans
    Mar 6, 2019 at 16:10
  • @mcarans seems right, well, unless your router IP isn't 192.168.1.1 of course :)
    – wazoox
    Mar 6, 2019 at 17:07
  • Thanks, I will test this for a few days to make sure it works without issue and also because the problem that causes the packet loss and required me to ask this question is intermittent.
    – mcarans
    Mar 7, 2019 at 8:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .