bond网卡绑定(centos6.5 + centos 7)

----------------------CentOS 6.5-------------------------------

1.添加bond内核模块

modprobe bonding   

2.添加四块网卡

3.编辑网卡进行配置

eth0:

vim  /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=static
USERCTL=no
MASTER=bond0
SLAVE=yes

eth1:
vim /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=static
USERCTL=no
MASTER=bond0
SLAVE=yes

eth2:
vim /etc/sysconfig/network-scripts/ifcfg-eth2
DEVICE=eth2
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=static
USERCTL=no
MASTER=bond0
SLAVE=yes

eth3:
vim /etc/sysconfig/network-scripts/ifcfg-eth3
DEVICE=eth3
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=static
USERCTL=no
MASTER=bond0
SLAVE=yes

4.编辑bond虚拟主网卡
vim /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=static
USERCTL=no
PEERDNS=yes
IPV6INIT=no
IPADDR=192.168.187.200
NETMASK=255.255.255.0
BROADCAST=192.168.187.255
GATEWAY=192.168.187.2
BONDING_OPTS="miimon=20 mode=6"    

//表示这里配置的工作模式是mode6(adaptive load balancing), miimon表示监视网络链接的频度 (毫秒), 我们设置的是100毫秒, 根据你的需求也可以指定mode成其它的负载模式。

 

5.创建一个加载bonding的专属设定文件/etc/modprobe.d/bonding.conf

echo "alias netdev-bond0 bonding" > /etc/modprobe.d/bonding.conf

cat /proc/net/bonding/bond0

ethtool bond0

6.重启系统

reboot




-------------------CentOS 7---------------------------------------------

nmcli connection add type bond ifname bond0 mode 6
nmcli connection add type bond-slave ifname ens33 master bond0
nmcli connection add type bond-slave ifname ens37 master bond0
nmcli connection add type bond-slave ifname ens38 master bond0
nmcli connection add type bond-slave ifname ens39 master bond0
systemctl restart network
cat /proc/net/bonding/bond0
ethtool bond0

转载于:https://www.cnblogs.com/Leonardo-li/p/9071224.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值