On CentOS7:
Modprobe bonding
echo +bond1 >/sys/class/net/bonding_masters
The Bonding is configured through the Sysfs interface.
More information
Network Bonding can be configured via the Sysfs interface. This interface allows for dynamic configuration of all Bond in the system without the need to unload the Bonding module. In addition, it allows you to add or remove Bond at run time. You no longer need to use the ifenslave command, even though the command is still supported.
With the Sysfs interface, users can use multiple Bond with different configurations without reloading the module.
Create and delete Bond:
Add and remove Slave:
With file /sys/class/net/<bond>/bonding/slaves, you can make an interface subordinate to a bond. The semantics of this file are the same as the bonding_masters file.
Make the interface eth0 subordinate to BOND0:
# ifconfig Bond0 up
# echo +eth0 >/sys/class/net/bond0/bonding/slaves
Release Slave (eth0) from Bond (BOND0):
# Echo-eth0 >/sys/class/net/bond0/bonding/slaves
#echo-eth1 >/sys/class/net/bond0/bonding/slaves
When the interface is subordinate to a Bond, the Sysfs file system creates a symbolic link between the two. In this case, the user can see /sys/class/net/bond0/slave_eth0 pointing to /sys/class/net/eth0, and /sys/class/net/eth0/ Master points to /sys/class/net/bond0.
Network card After joining Bond Nic does not need to set the IP address, IP address must be configured on the bond
[email protected] network-scripts]# cat ifcfg-bond0
Device=bond0
Onboot=yes
Name=bond0
Bootproto=static
ipaddr=172.27.34.18
netmask=255.255.255.0
[[email protected] network-scripts]# cat Ifcfg-eth0 nic eth0 configuration point to BOND0
Device=eth0
Onboot=yes
Name=eth0
Bootproto=no
Master=bond0
Slave=yes
[[email protected] network-scripts]# cat ifcfg-eth1 nic eth0 configuration point to BOND0
Device=eth1
Onboot=yes
Name=eth1
Bootproto=no
Master=bond0
Slave=yes
This article is from the "Devops" blog, so be sure to keep this source http://yanglunkai.blog.51cto.com/7745171/1575006
centos7,ubuntu14.04 multi-NIC configuration bond, bind multiple NICs together