Tech Tip: Network Bonding with CentOS
This week on our weekly video tech tips series we are talking about network bonding on CentOS and why it’s useful. Check it out below to learn more.
Hey guys, Mitch here with 45Drives, welcome back to our weekly tech tip video. Today I’m going to be talking about network bonding on CentOS and why it’s useful.
Network bonding is when you take two or more network interfaces and bond them into a single logical network interface. It can be great for two reasons:
- Provides higher bandwidth & throughput
- Provides fault tolerance & high availability
One great thing about network bonding is if one interface goes down or is unplugged, another network interface in the bond will pick up the slack and keep the network connection online.
Linux uses a special kernel module called “bonding” that includes 7 different modes that can be used. However, most use cases are covered with 2-3 of those modes.
Next, I’m going to show you how to set up a network bond on CentOS. This is a very simple and straightforward process.
- To begin just type “nmtui” into the terminal to enter the network text user interface
- Select “Edit a connection” and select “Add”
- Select “Bond” and then “Create”
- Once inside the edit a connection tab, under device, type “bond0” or whatever you want your bond to be named. Select “Add” and begin adding the network interfaces you want to be part of the bond.
- When choosing Ethernet ports, EN01 and EN02 are you motherboards Ethernet ports so you may want to stay away using these for your bond if you have NIC cards installed.
- You can configure the type of bond in this menu or leave it default round robin configuration. At 45Drives we like active-backup (802.3AD mode) also known as LACP mode.
- Once you finish adding interfaces to your bond, in the “IPv4 CONFIGURATION” section you can either leave it as is or allow DHCP to assign an IP to your newly created bond, or edit this to a static IP, which is recommended. If you do assign a static IP be sure to use an address outside of your DHCP servers range to avoid clashes. You can get this information from your local network admin.
- Finally, back out to the “Activate a connection” screen, scroll down to your new bond0 interfaces and select deactivate. Wait for it to finish and re-activate. When this is complete exit your NMTUI as you are now ready to test the bond. One this to note is that the activation of your bond could take a while to complete.
- When back in the terminal type “ip addr show bond0” to show the addresses for your new bond. You can also type “ip a” to pull up all network interfaces.
One thing to note about modes 1 active-backup – it’s just like it sounds. It provides no extra bandwidth but it does provide fault tolerance. One great benefit about this is it’s the easiest one to set up.
Now for Mode 4 or LACP. It provides load balancing for extra bandwidth as well as fault tolerance. However, your switch must support this.
If you want to find out more such as detailed guides on how to do everything talked about in this video be sure to check out our knowledgebase articles.
To find out more check out our knowledge base!