centos7,ubuntu14.04 multi-NIC configuration bond, bind multiple NICs together

Source: Internet
Author: User

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 a new Bond (BOND0):

      # echo +bond0 >/sys/class/net/bonding_masters

    • To delete an existing Bond (BOND1):

      # Echo-bond1 >/sys/class/net/bonding_masters

    • Show all existing Bond:

      # cat/sys/class/net/bonding_masters

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.