IBM Support

Creating a new bond in RHEL5 without interrupting the network

Troubleshooting


Problem

You want to set up a new bond for interfaces already on the system. However, you do not want to reload the bonding module or do a service network restart which would cause an interruption of service.

Resolving The Problem

Sysfs is a virtual file system provided by Linux 2.6. Sysfs exports information about devices and drivers from the kernel device model to userspace, and it is also used for configuration.

Network bonding can be configured by using the sysfs interface.  This interface allows dynamic configuration of all bonds in the system without unloading the bonding module.  It also allows for adding and removing bonds at runtime. 

In the following example, we will set up bond2 with two slaves, eth4 and eth11. 


1. To add a new bond, view the existing bonds (as root) as shown in the following example:

[root@nps_server ~]# cat /sys/class/net/bonding_masters
bond0 bond1


2. Next, add the new bond:

echo +bond2 > /sys/class/net/bonding_masters

We then can add the slave interfaces to the bond using the /sys/class/net/<bond>/bonding/slaves file.  The syntax for this file is the same as for the bonding_masters file.



3. Bring the new bond up:

ifconfig bond2 up


4. Your bond will now be viewable in ifconfig:
[root@nps_server ~]# ifconfig bond2

bond2     Link encap:Ethernet  HWaddr 00:00:00:00:00:00
          UP 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)
 



5. To enslave interfaces eth4 and eth11 to bond2 (as root):

echo +eth4 > /sys/class/net/bond2/bonding/slaves
echo +eth11 > /sys/class/net/bond2/bonding/slaves




6. You can then view the slaves attached to the bond:
[root@nps_server ~]# cat /sys/class/net/bond2/bonding/slaves
eth4 eth11


[root@nps_server ~]# cat /proc/net/bonding/bond2
Ethernet Channel Bonding Driver: v3.2.4 (January 28, 2008)
Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0


Slave Interface: eth4
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:21:5e:53:ea:06


Slave Interface: eth11
MII Stajavascript:void(0);tus: up
Link Failure Count: 0
Permanent HW addr: 00:21:5e:53:ea:07
 


Your new bond (bond2) will now be up with your two slaves. This was accomplished without having to reload the bonding module or having to restart the network services.

[{"Product":{"code":"SSULQD","label":"IBM PureData System"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":null,"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"1.0.0","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Historical Number

NZ825927

Document Information

Modified date:
17 October 2019

UID

swg21573039