Configuring a bonded NIC
Network Interface Card (NIC) bonding (also known as teaming) enables you to join two NICs as a single physical device so that they appear as one interface. This is usually performed to provide failover capabilities or load balancing. Bonding can be configured on the BMC Atrium Discovery hardware appliance. It is not something that you should consider on a virtual appliance, because failover and load balancing should be provided by the virtualization platform.
Network configuration
When changing network configuration on your appliance, you should always be able to access the system console in case the new configuration does not work correctly.
Netadmin does not work with bonded NICs
If you configure your appliance to use bonded NICs, you can no longer use the netadmin user to perform any networking configuration.
The BMC Atrium Discovery appliance relies on eth0
having an IP address. When the appliance starts, it requires an IP address on eth0
for configuration and start-up services. In a default bonded NIC configuration, the IP address would be assigned to the bond point bond0
, and the BMC Atrium Discovery services would be unable to start without additional configuration.
The ifconfig
output for bonded NIC cards is shown in the following example. Note that bond0
has an IP address but eth0
and eth1
do not.
bond0 Link encap:Ethernet HWaddr 00:11:43:FD:9A:B1 inet addr:192.168.0.25 Bcast:192.168.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1 RX packets:58071 errors:0 dropped:0 overruns:0 frame:0 TX packets:1465 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:4315472 (4.1 Mb) TX bytes:120360 (117.5 Kb) eth0 Link encap:Ethernet HWaddr 00:11:43:FD:9A:B1 UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1 RX packets:26447 errors:0 dropped:0 overruns:0 frame:0 TX packets:1262 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1992430 (1.9 Mb) TX bytes:95078 (92.8 Kb) Interrupt:16 eth1 Link encap:Ethernet HWaddr 00:11:43:FD:9A:B1 UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1 RX packets:31624 errors:0 dropped:0 overruns:0 frame:0 TX packets:203 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:2323042 (2.2 Mb) TX bytes:25282 (24.6 Kb) Interrupt:17
Creating a bond point called eth0
To create a bond point called eth0
you need to:
- Configure the network interface scripts in
/etc/sysconfig/network-scripts
to force the hardware to bond to the names eth1 and eth2 using their MAC addresses. Note the "SLAVE=yes" and "MASTER=eth0" options. - Create the eth0 interface which is actually assigned the IP configuration options.
- Configure the boot process to include the
bonding
module and to useeth0
as the bond point, with the various options associated with that bond.
To do this, log in as the tideway user and perform the following steps:
- Stop the tideway, omniNames and appliance services. Enter:
[tideway@localhost] $ sudo /sbin/service tideway stop [tideway@localhost] $ sudo /sbin/service omniNames stop [tideway@localhost] $ sudo /sbin/service appliance stop
- Change to the
/etc/sysconfig/network-scripts
directory and determine the MAC addresses (HWaddr
of the network cards that you want to bond. Enter:[tideway@localhost] $ cd /etc/sysconfig/network-scripts [tideway@localhost network-scripts] $ /sbin/ifconfig -a | grep HWaddr eth0 Link encap:Ethernet HWaddr 00:11:43:FD:9A:B1 eth1 Link encap:Ethernet HWaddr 00:11:43:FD:9A:B2 [tideway@localhost network-scripts] $
In this example the MAC Addresses are as follows:eth0
–00:11:43:FD:9A:B1
eth1
–00:11:43:FD:9A:B2
- Change to the root user and using a text editor, edit, or create and edit
ifcfg-eth1
to contain the following:
DEVICE=eth1 BOOTPROTO=none ONBOOT=yes HWADDR=00:11:43:FD:9A:B1 # The MAC address of eth1 as determined in the previous step. TYPE=Ethernet MASTER=eth0 SLAVE=yes
- Using a text editor, edit or create and edit
ifcfg-eth2
to contain the following:
DEVICE=eth2 BOOTPROTO=none ONBOOT=yes HWADDR=00:11:43:FD:9A:B2 # The MAC address of eth2 as determined in the previous step. TYPE=Ethernet MASTER=eth0 SLAVE=yes
- Using a text editor, edit or create and edit
ifcfg-eth0
to contain the following. Complete the IPADDR, NETMASK, and GATEWAY information
Note that options such asDEVICE=eth0 BOOTPROTO=none ONBOOT=yes IPADDR=<required IP address> NETMASK=<required netmask> GATEWAY=<required gateway>
BROADCAST
andNETWORK
must be defined inifcfg-eth0
if they are required. - Modify
/etc/modprobe.conf
. The lines that must be changed containeth0
and possiblyeth1
. These need to be modified to specify thateth0
is now a bonded interface. For example, if the file looks like this:
Depending on the options required, edit it to look like this:alias eth0 e1000 alias eth1 e1000 alias scsi_hostadapter ata_piix
alias eth0 bonding options eth0 miimon=100 mode=balance-rr alias scsi_hostadapter ata_piix
Note
The entries after
options eth0
are the bonding options. They might not be required, or might be device specific, but the ones shown are good defaults.miimon=100
means check the link state every 100 milliseconds, andmode=balance-rr
provides load balancing and tolerance. Thebalance-rr
mode uses sequential order transmissions. There are other mode options available, some of which require changes to other items. - Reboot the system.
- Log in as the tideway user and run the following command:
The output should look like the following, note the[tideway@localhost ] $ /sbin/ifconfig -a
bond0
interface:bond0 Link encap:Ethernet HWaddr 00:00:00:00:00:00 BROADCAST MASTER MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) eth0 Link encap:Ethernet HWaddr 00:11:43:FD:9A:B1 inet addr:192.168.0.5 Bcast:192.168.0.255 Mask:255.255.255.0 inet6 addr: fe80::250:56ff:fea7:362/64 Scope:Link UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1 RX packets:21026 errors:0 dropped:0 overruns:0 frame:0 TX packets:175 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:1405048 (1.3 MiB) TX bytes:61541 (60.0 KiB) eth1 Link encap:Ethernet HWaddr 00:11:43:FD:9A:B1 UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1 RX packets:10529 errors:0 dropped:0 overruns:0 frame:0 TX packets:87 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:703475 (686.9 KiB) TX bytes:30280 (29.5 KiB) eth2 Link encap:Ethernet HWaddr 00:11:43:FD:9A:B1 UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1 RX packets:10498 errors:0 dropped:0 overruns:0 frame:0 TX packets:90 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:701633 (685.1 KiB) TX bytes:31793 (31.0 KiB)
- Check
/var/log/messages
to check for a successful bonding:The list of running kernel modules should include the bonding module.Nov 18 15:47:18 localhost kernel: Ethernet Channel Bonding Driver: v3.4.0-1 (October 7, 2008) Nov 18 15:47:18 localhost kernel: bonding: MII link monitoring set to 100 ms Nov 18 15:47:18 localhost kernel: bonding: eth0 is being created... Nov 18 15:47:18 localhost kernel: ADDRCONF(NETDEV_UP): eth0: link is not ready Nov 18 15:47:18 localhost kernel: bonding: eth0: Adding slave eth1. Nov 18 15:47:18 localhost kernel: bonding: eth0: enslaving eth1 as an active interface with a down link. Nov 18 15:47:18 localhost kernel: e1000: eth1 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None Nov 18 15:47:18 localhost kernel: bonding: eth0: link status definitely up for interface eth1. Nov 18 15:47:18 localhost kernel: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready Nov 18 15:47:18 localhost kernel: bonding: eth0: Adding slave eth2. Nov 18 15:47:18 localhost kernel: e1000: eth2 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None Nov 18 15:47:18 localhost kernel: bonding: eth0: enslaving eth2 as an active interface with an up link.
- Run the following command:
[tideway@localhost ] $ /sbin/lsmod | sort ac 38729 0 acpi_memhotplug 40517 0 asus_acpi 50917 0 ata_piix 57541 0 autofs4 63049 3 backlight 39873 1 video battery 43849 0 *bonding 142537 0* button 40545 0 cdrom 68713 1 ide_cd crypto_api 42945 1 xfrm_nalgo ...
Comments