FAQ-Bonding NICs on the RedHat OS

Publication Date:  2015-06-16 Views:  273 Downloads:  0
Issue Description
Bonding NICs on the RedHat OS.
Solution
Software and Hardware Preparations:

RHELS 5.3 installation CD-ROM
Network interface card (NIC) testing tool Netperf
One T6000 blade and two client hosts
One S5328C switch
One DVD-ROM drive and several network cables

Procedure:

The following uses the RHELS 5.3 operating system (OS) as an example.

1.  Install the driver.

The bonding driver exists in the OS as a module, but it is not automatically installed. Run modprobe bonding to install the driver.

NOTE:
If bonding needs to be enabled upon system startup, add one row to the /etc/modprobe.conf:

alias bondX bonding

X indicates the serial number of a bonding device. To create ifcfg-bond0, add the following:

alias bond0 bonding

2.  Create a configuration file for a network port.

a.On the command-line interface (CLI), run system-config-network to enable Dynamic Host Configuration Protocol (DHCP) startup for network ports eth0 and eth1, and then save the configuration and exit.

b.Run cd to switch to the /etc/sysconfig/network-scripts directory and query configuration file ifcfg-eth0 or ifcfg-eth1 of port eth0 or eth1, as shown in Figure 1.

Figure 1 Network port configuration file



c.Modify parameters.

Modify the following parameter:

BOOTPROTO='none'

Add the following parameters:

MASTER=bond0

SLAVE=yes

Save the configuration and exit. Figure 2 shows the new settings.

Figure 2 New settings



Modify the configuration file ifcfg-eth1 of network port eth1 in the same way, as shown in Figure 3.

Figure 3 New settings



d.Create the bond0 configuration file.

Create the ifcfg-bond0 file in the /etc/sysconfig/network-scripts directory, as shown in Figure 4.

Figure 4 ifcfg-bond0 file



Set BROADCAST, IPADDR, NETMASK, and NETWORK according to actual situations.

NOTE:
Early-version RedHat OSs, such as REHLS 4.7, do not support BONDING_OPTS. In this case, add the following commands to the tail of the /etc/modprobe.conf file:

alias bond0 bonding

options bond0 mode=0 miimon=100

If the bonding configuration file supports BONDING_OPTS, you do not need to modify the /etc/modprobe.conf file.

The working mode of bonded network ports is set to load balancing: mode = 2 (balance-xor). To use the redundancy mode, set mode to 1 (active-backup). For details about the working modes, see Reference Information(http://support.huawei.com/enterprise/KnowledgebaseReadAction.action?contentId=KB1000079098).

e.Run network restart to make the configuration take effect.
# /etc/init.d/network restart

Verifying the Bonding:

1. Run ifconfig on the command-line interface (CLI).

In the command output, the Media Access Control (MAC) address of bond0 is the same as those of network ports eth0 and eth1, and bond0 and network ports eth0 and eth1 share IP address 192.168.18.10, as shown in Figure 5.

Figure 5 Querying the MAC address and IP address




2. Run cat /proc/net/bonding/bond0 to query the bond0 status, as shown in Figure 6.

Figure 6 Querying bond0 status



 NOTE:
To delete network port bonding, uninstall the bonding driver, delete the ifcfg-bond0 bonding configuration file and configuration files of network ports eth0 and eth1, and restart the network.

END