This is a short howto post on configuring interface bonding on oracle enterprise Linux 6. The names of the network interfaces have changed in Oracle Linux 6. For example, it starts from em1, so eth0 = em1, eth1 = em2. And For Intel 10 Gb it is p3p1, p3p2, p4p1, p4p2 and so on. The following steps are based on p3px interface names, you can replace p3px with the network interface on your system.
1. Check current configuration
Check the network interface name on the system, for example p3pX or emX
# ifconfig -a
2. Configure bonding driver
Configuration file /etc/modprobe.conf is deprecated on Oracle Linux 6 and configuration files are in directory /etc/modprobe.d. Create a new file bonding.conf in directory /etc/modprobe.d to tell the kernel that it should use the bonding driver for new device bond0.
# grep bond0 /etc/modprobe.d/bonding.conf alias bond0 bonding
The max_bonds parameter is not interface specific which should be specified in /etc/modprobe.d/bonding.conf. Do not set max_bonds parameter when using ifcfg-bondN files with the BONDING_OPTS directive .
3. Configure under-layer interfaces
Next step is to configure the slave interfaces of the bonding interface. Foe that we will edit the respective network script files and add below configuration.
# cat /etc/sysconfig/network-scripts/ifcfg-p3p1 DEVICE=p3p1 BOOTPROTO=none ONBOOT=yes MASTER=bond0 SLAVE=yes
# cat /etc/sysconfig/network-scripts/ifcfg-p3p2 DEVICE=p3p2 BOOTPROTO=none ONBOOT=yes MASTER=bond0 SLAVE=yes
4. Configure bonding interface with bonding parameters
Add the below setting into the bond configuration file. You can set the BONDING_OPTS in this file as well to specify settings such as bonding mode.
# cat /etc/sysconfig/network-scripts/ifcfg-bond0 DEVICE=bond0 MASTER=yes BOOTPROTO=dhcp ONBOOT=yes BONDING_OPTS="mode=4 miimon=100 lacp_rate=1"
5. Activate bonding interface
As a final step, activate the bonding interface using ifup command.
# ifup bond0
Verify the setup
Once you have successfully configured the bonding interface, you can verify the configuration using commands given below. First check if the bonding module is loaded or not.
# lsmod |grep bond bonding 122351 0
To view the current status of the bonding interface and its slave interface you can use the file /proc/net/bonding/bond0.
# cat /proc/net/bonding/bond0 Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011) Bonding Mode: fault-tolerance (active-backup) Primary Slave: None Currently Active Slave: p3p1 MII Status: up MII Polling Interval (ms): 100 Up Delay (ms): 0 Down Delay (ms): 0 Slave Interface: p3p1 MII Status: up Speed: 100 Mbps Duplex: full Link Failure Count: 0 Permanent HW addr: 00:0e:0c:70:05:ac Slave queue ID: 0 ...
Red Hat / CentOS : How to create interface / NIC bonding
RedHat / CentOS : How to change currently active slave interface of bonding online