The Linux bonding driver provides a method for aggregating multiple network devices into a single logical interface which named “bonded” interface. Behave of bonding interface depends on bonding mode.
- Mode 1 (active-backup policy)
- Mode 2 (XOR policy)
- Mode 4 (IEEE 802.3ad policy)
- Mode 5 (adaptive transmit load balancing policy)
You can get detail information about bonding mode which link I added below. (Red Hat Bonding Mode) (Bonding Configuration)
At this post I ‘ll try to explain another subject which related service up-time. We are planning huge environment to backing up our services but as you know IT Application parameters always changing and IT Infrastructure and Planning activity must be flexible to meet IT Applications’ needs. Otherwise It ‘won’t be possible to manage all changes.
For these reason it’s important to improve your infrastructure element like networking,system,application etc. in service operational state. At this post I’ll describe how to change your bonding interface without any down time on server and application side.
We will check this object;
- ifenslave
- Bonding Configurations
- NetworkManager
*Before start operation check if your NetworkManager service is down. It must be disabled.
#service NetworkManager status
Step 1: Check Bonding Configurations
#cat /proc/net/bonding/bond1 Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009) Bonding Mode: fault-tolerance (active-backup) Primary Slave: None Currently Active Slave: eth2 MII Status: up MII Polling Interval (ms): 100 Up Delay (ms): 0 Down Delay (ms): 0 Slave Interface: eth2 MII Status: up Speed: 1000 Mbps Duplex: full Link Failure Count: 0 Permanent HW addr: 6c:3b:e5:a4:3f:4a Slave queue ID: 0 Slave Interface: eth3 MII Status: up Speed: 1000 Mbps Duplex: full Link Failure Count: 0 Permanent HW addr: 6c:3b:e5:a4:3f:4b Slave queue ID:
Bonding Master Interface : bond1
Slave 1:Eth2
Slave 2:Eth3
Active Slave:Eth2
Step 2: Check your new network element
-Before start operation please make double check on your new network interface cable and vlan configuration. Also you need to check Network switch side about agg. mode.
Step 3:Drop old ethernet device
-Now we will remove eth2 from bonding interface.At this step we run ifenslave command.
#ifenslave -d bond1 eth2
# cat /proc/net/bonding/bond1
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth3
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth3
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 6c:3b:e5:a4:3f:4b
Slave queue ID: 0
Step 4:Add new ethernet device
-Before adding new device check link state with “ethtool” command.
#ethtool eth7[/shell] [shell]# ifenslave bond1 eth7[/shell] [shell]# cat /proc/net/bonding/bond1 Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009) Bonding Mode: fault-tolerance (active-backup) Primary Slave: None Currently Active Slave: eth3 MII Status: up MII Polling Interval (ms): 100 Up Delay (ms): 0 Down Delay (ms): 0 Slave Interface: eth3 MII Status: up Speed: 1000 Mbps Duplex: full Link Failure Count: 0 Permanent HW addr: 6c:3b:e5:a4:3f:4b Slave queue ID: 0 Slave Interface: eth7 MII Status: down Speed: 1000 Mbps Duplex: full Link Failure Count: 0 Permanent HW addr: ac:16:2d:83:40:63 Slave queue ID: 0
Step 5: Drop Other old ethernet device “eth3”
-After this operation our active Slave ethernet device ‘ll be eth7 which we added to bonding at last step.
# ifenslave -d bond1 eth3
Step 6: Add new device to the bonding
# ifenslave bond1 eth11 # cat /proc/net/bonding/bond1 Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009) Bonding Mode: fault-tolerance (active-backup) Primary Slave: None Currently Active Slave: eth7 MII Status: up MII Polling Interval (ms): 100 Up Delay (ms): 0 Down Delay (ms): 0 Slave Interface: eth7 MII Status: up Speed: 1000 Mbps Duplex: full Link Failure Count: 0 Permanent HW addr: ac:16:2d:83:40:63 Slave queue ID: 0 Slave Interface: eth11 MII Status: down Speed: 1000 Mbps Duplex: full Link Failure Count: 0 Permanent HW addr: ac:16:2d:83:3b:4f Slave queue ID: 0
Step 7: Add new configuration to the config file
Change eth2 interface config file and add “#” to MASTER and SLAVE line. And also change ONBOOT option to “no”.
#cd /etc/sysconfig/network-scripts/ # vi ifcfg-eth2 HWADDR=”6C:3B:E5:A4:3F:4A” DEVICE=eth2 BOOTPROTO=none ONBOOT=no #MASTER=bond1 #SLAVE=yes USERCTL=no
Also apply these changes for eth3 to.
#cat ifcfg-eth3 HWADDR=”6C:3B:E5:A4:3F:4B” DEVICE=eth3 BOOTPROTO=none ONBOOT=no #MASTER=bond1 #SLAVE=yes USERCTL=no
Edit new interface eth7-eth11 like this configuration.
#vi ifcfg-eth7 DEVICE=”eth7″ NM_CONTROLLED=”no” ONBOOT=yes TYPE=”Ethernet” NAME=”System eth7″ BOOTPROTO=none HWADDR=AP:16:2D:83:30:63 << Mac address must be your interface mac address which comes from “ip a” command >> MASTER=bond1 SLAVE=yes
#vi ifcfg-eth11 DEVICE=”eth11″ NM_CONTROLLED=”no” BOOTPROTO=”none” ONBOOT=yes TYPE=”Ethernet” NAME=”System eth11″ HWADDR=AK:26:2D:83:3B:4F MASTER=bond1 SLAVE=yes