Centos7,Ubuntu14.04多网卡配置bond,将多网卡绑定在一起

时间:2014-11-10 15:39:44   收藏:0   阅读:5050

CentOS7上:

modprobe bonding
echo +bond1 > /sys/class/net/bonding_masters


通过 sysfs 接口配置 Bonding。

详细信息


可以通过 sysfs 接口配置网络 Bonding。 该接口允许在系统中动态配置所有 Bond,而无需卸载 Bonding 模块。 此外,它还允许在运行时添加或删除 Bond。 不再需要使用ifenslave 命令,即使该命令仍受支持。

借助 sysfs 接口,用户可以使用具有不同配置的多个 Bond,而无需重新加载该模块。

创建和删除 Bond:

添加和删除 Slave:

使用文件 /sys/class/net/<bond>/bonding/slaves,可以使接口从属于某个 Bond。 该文件的语义与 bonding_masters 文件相同。


网卡加入BOND以后网卡不需要设置IP地址,IP地址需在BOND上配置

[root@localhost network-scripts]# cat ifcfg-bond0 

DEVICE=bond0

ONBOOT=yes

NAME=bond0

BOOTPROTO=static

IPADDR=172.27.34.18

NETMASK=255.255.255.0


[root@localhost network-scripts]# cat  ifcfg-eth0    网卡eth0配置指向BOND0

DEVICE=eth0

ONBOOT=yes

NAME=eth0

BOOTPROTO=no

MASTER=bond0

SLAVE=yes

[root@localhost network-scripts]# cat  ifcfg-eth1  网卡eth0配置指向BOND0

DEVICE=eth1

ONBOOT=yes

NAME=eth1

BOOTPROTO=no

MASTER=bond0

SLAVE=yes






本文出自 “Devops” 博客,请务必保留此出处http://yanglunkai.blog.51cto.com/7745171/1575006

原文:http://yanglunkai.blog.51cto.com/7745171/1575006

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!