LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-28-2018, 03:00 AM   #1
denydias
Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 112

Rep: Reputation: Disabled
Lightbulb Slackware network interface bonding with failover


For the past few years I've been dealing with a pretty common use case for notebook users: connect to the network through an ethernet cable and Wi-Fi, then move from one to the other and back and forth.

Slackware's NetworkManager could deal with this just fine as it is more than capable to keep the two connections up and just 'rewire' stuff when needed.

There's only one catch: the two interfaces (eth0 and wlan0 in my case) have different IPs each. This is the norm: a single IP per interface.

This design leads to some very annoying issues. Just to list a few:
  • SSH sessions halted;
  • NFS exports needs to be remounted;
  • IP dependent services are dropped.
I have many years of expertise with LACP. IEEE 802.3ad link aggregation protocol requires network interfaces of the same type and speed so you can stitch together multiple links, providing more transfer speed and fault tolerance if one of the links disconnect. But LACP is for corporate stuff as it requires network appliance support to work properly. This equipment in general is somewhat expensive. I can't afford that.

I don't need the extra performance of multiple links working as a team. 1Gbps is enough to my needs. What I really need is the fault tolerance within a single IP. Resilience is the name of the game.

To know that I can start working with an ethernet cable attached or not and I'll bee online is enough. NetworkManager can provide this out of the box. To move from Wi-Fi to ethernet, or the other way around, keeping the same IP and services connected as if anything have changed is my goal. This NM could not (at least not in Slackware).

Enter Linux ethernet bonding driver in active-backup mode.

I have this setup running right now and you know what? Works like a charm! There's no single packet dropped when I pull the cable, nor when I put it back. The IP is kept no matter what interface is active.

The only protocols still requiring some effort are the networked file systems like NFS itself, SMB/CIFS or AFP. Those guys demand that I stop a running transfer when I switch the link. No remount needed. Halt transfer, switch links, resume transfer. That's it.

If you are curious to try anything similar, I've put all together here. Go check it out.
 
Old 08-28-2018, 10:59 AM   #2
TracyTiger
Member
 
Registered: Apr 2011
Location: California, USA
Distribution: Slackware
Posts: 485

Rep: Reputation: 224Reputation: 224Reputation: 224
Quote:
Originally Posted by denydias View Post
There's only one catch: the two interfaces (eth0 and wlan0 in my case) have different IPs each. This is the norm: a single IP per interface.
...
Enter Linux ethernet bonding driver in active-backup mode.
...
I have this setup running right now and you know what? Works like a charm! There's no single packet dropped when I pull the cable, nor when I put it back. The IP is kept no matter what interface is active.
...
If you are curious to try anything similar, I've put all together here. Go check it out.
Thanks for this. Several years ago I had a client connected to multiple ISPs for redundancy when one ISP had a failure. A Gateway/Router with 3 WAN connections took care of failures with individual ISPs but the IP address ranges were all different so sessions needed to be restarted on a network failure of an active session.

Your bonding configuration wouldn't help on a WAN level but provides a configuration to use on a LAN. In the past I've had challenges with multiple Ethernet connections between various servers and clients on multiple connected LANs. The Ethernet bonding would have been a welcome addition to iptables and mitigating ARP flux in those situations

Thanks for the education and "cookbook" instructions.
 
Old 08-28-2018, 12:03 PM   #3
denydias
Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 112

Original Poster
Rep: Reputation: Disabled
Thanks, @TracyTiger!

You've made a very good point I forgot to mention: the benefits of bonding are for LAN scope only. It brings no plus to WAN.

Regardless, if the user has services in the LAN scope (e.g. NAS, webserver, a TV set-top box with SSH access, a Raspberry PI or gaming console), this will be of good use. I've updated the article in the gist to reflect this. Thank you.

I've a friend with this failover layout for WAN. He has a pretty cheap D-Link router with three WAN ports and modified to run OpenWRT (which is also the router OS I use myself). He subscribed for two fiber optical and one 4G LTE ISPs. When one ISP goes down, the next in the queue takes over. As there's no way to keep the IP address the same for WAN, there's indeed a momentarily service disruption when things change on the WAN level. At least it becomes very unlikely to have a total internet blackout.

Last edited by denydias; 08-28-2018 at 12:05 PM.
 
Old 08-28-2018, 02:06 PM   #4
denydias
Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 112

Original Poster
Rep: Reputation: Disabled
BTW, inspiration source here.

Credits and kudos to @moesasji.
 
Old 08-30-2018, 01:31 AM   #5
denydias
Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 112

Original Poster
Rep: Reputation: Disabled
I've updated the script.

Code:
$ /etc/rc.d/rc.bond
Usage: /etc/rc.d/rc.bond {start|stop|restart|release <-s>|renew <-s|0> <-r>|status|monitor}
Demo here.

Last edited by denydias; 08-30-2018 at 02:34 PM.
 
Old 09-13-2018, 03:56 PM   #6
lazardo
Member
 
Registered: Feb 2010
Location: SD Bay Area
Posts: 196

Rep: Reputation: Disabled
Quote:
But LACP is for corporate stuff as it requires network appliance support to work properly.
You need a managed switch in the loop. A netgear prosafe GS108 is about $70 US.
https://www.netgear.com/business/pro...spx#tab-models

Cheers,
 
  


Reply

Tags
bonding, failover, lacp, network, slackware


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How to configure failover and high availability network bonding on Linux LXer Syndicated Linux News 0 10-06-2016 08:33 PM
LXer: Configure NIC(Network Interface Card) bonding in CentOS 7 / RHEL 7 LXer Syndicated Linux News 0 08-31-2015 08:52 PM
Is bond0 ready and a bonding interface? - Bonding Problems (RPI) Elliottlc Linux - Networking 6 10-24-2014 06:04 AM
Is bond0 ready and a bonding interface? - 4G Bonding Router Problems Elliottlc Linux - Networking 5 10-22-2014 02:37 PM
bonding and vlans. Bonding a vlan interface vs applying vlans to a bond interface JasonCzerak Linux - Networking 0 09-11-2008 09:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration