Setting up channel bonding on RHEL 7

RHEL 7 provides several possibilities for configuring network settings (including channel bonding):
  • NetworkManager with the GNOME control-center utility
  • NetworkManager text user interface (nmtui) tool
  • NetworkManager command line (nmcli) tool

You can also perform manual configuration using the command line interface.

The article "How do I configure a bonding device on Red Hat Enterprise Linux (RHEL)?" (https://access.redhat.com/articles/172483) provides examples showing how to use nmcli to set up a bond device.

In addition, Red Hat Customer Portal Labs provides a Network Bonding Helper for automatically generating a network bond, based on your environment and deployment goals. (See "Red Hat Network Bonding Helper" [https://access.redhat.com/labs/networkbondinghelper/]). This is a web application that helps generate configuration files with the setup information given by user.

Note: This tool has only limited possibilities for setting bonding options. Be sure to review and manually modify the configuration files before applying to the system.

The examples here use the NetworkManager text user interface (nmtui). For more details about the other tools, refer to the corresponding RHEL 7 documentation.

To start the NetworkManager text user interface tool, issue the command nmtui in a terminal window on RHEL 7. Within the tool, use the arrow, Tab, Enter, or Shift+Enter keys to step forwards and backwards. To create a new connection select Edit a connection, then <Add> and Bond, as shown in Figure 1.

Figure 1. RHEL 7--Adding a bond connectionRHEL 7--Adding a bond connection

The system displays the Edit Connection screen:

Figure 2. RHEL 7--Editing a bond connectionRHEL 7--Editing a bond connection
On this screen, you can do these tasks:
  • Specify the bond device
  • Choose the bonding mode with corresponding parameters
  • Configure the IP address of the bond interface

In this example, we set bonding mode to Active Backup, the primary slave device is eth1, and MII monitor is used for link monitoring with a frequency of 1000ms.

Note: This screen does not allow users to configure all possible bonding options. If you need specific configurations that are not listed on this screen, you will have to add them manually later in the bonding device configuration file.

To add additional slave devices for this bond, select Add on the right-hand side, and choose Ethernet type of connection. The system displays the following screen:

Figure 3. RHEL 7--Adding a slave deviceRHEL 7--Adding a slave device

On this screen you can specify the device name of the slave and the unique MAC address. The slave device does not have an IP address.

Note: Always add the bond master first, and then add the slave device within the Edit Connection screen of the bond master.

After adding all the slave devices, select OK and quit the nmtui tool. The corresponding network configuration files are then generated automatically. The network configuration files are located under the directory /etc/sysconfig/network-scripts/.

Figure 4 shows the bonding master configuration file, ifcfg-bond0.

Figure 4. Example: RHEL 7--Configuration file of a bonding master

/etc/sysconfig/network-scripts/ifcfg-bond0:

DEVICE=bond0
TYPE=Bond
NAME=bond0
BONDING_MASTER=yes
IPADDR=192.0.2.0
PREFIX=24
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
UUID=7099226a-66ac-42a3-a41f-da8284e34838
ONBOOT=yes
BOOTPROTO=none
BONDING_OPTS="<bonding options>"
In this example file:
BONDING_MASTER
Is set to yes.
IPADDR
Shows the IP address configured in the bond connection menu.
UUID
Identifies a bond connection generated by NetworkManager.
BONDING_OPTS
Contains all the default values for bonding options. It is important to go through these options and customize them to fit your own system.

Figure 5 shows a slave device configuration file ifcfg-eth1.

Figure 5. Example: RHEL 7--Configuration file of a slave device

/etc/sysconfig/network-scripts/ifcfg-eth1:

MACADDR=02:00:00:D3:FE:A0
SLAVE=yes
DEVICE=enccw0.0.b230
TYPE=Ethernet
NAME=eth1
UUID=4a8e29c7-fb39-457b-8edd-46cbc6ed49f9
ONBOOT=yes
MASTER=7099226a-66ac-42a3-a41f-da8284e34838

In this example file:

MACADDR
Specifies the unique MAC address of the slave device.
UUID
Specifies the unique UUID of the slave device.
MASTER
Specifies the UUID of the bonding master.