bonding配置案例

做bond的目的:

拓宽上联带宽,网络优化。

为什么不做双口,乃至四口外网bond呢?

因为做bond,将耗费大量的交换机端口,占用资源。如果对带宽要求很高,完全可以更换万兆网卡,协商速率10000MB/S 效果更好。

双内网bond:
2根内网网线,插同一个内网接入交换机的2个口。
双内网bond+外网:
2根内网线,+1根外网线
两个外网bond:
2根外网线 【没用应用】

内网bond叫做bond0 外网bond叫做bond1

  1. 接口配置文件
[root@install network-scripts]# cat ifcfg-bond0 
DEVICE=bond0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
IPADDR=172.16.8.100
PREFIX=24
IPV6INIT=no
USERCTL=no
[root@install network-scripts]# cat ifcfg-eth0 
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
IPV6INIT=no
USERCTL=no
MASTER=bond0
SLAVE=yes
[root@install network-scripts]# cat ifcfg-eth1
DEVICE=eth1
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
IPV6INIT=no
USERCTL=no
MASTER=bond0
SLAVE=yes
  1. bonding参数
[root@install ~]# tail -2 /etc/modprobe.d/bond0.conf 
alias  bond0 bonding
options bonding mode=0 miimon=100

  1. 重启网络服务
[root@install ~]# systemctl restart network

查看:ethtool bond0

[root@install ~]# cat /proc/net/bonding/bond0 
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)

解绑:
rm -rf /etc/sysconfig/network-scripts/ifcfg-bond0
rm -rf /etc/modprob.d/bond0.conf
rm -rf /etc/sysconfig/network-scripts/ifcfg-ens37
vim ifcfg-ens33 配置
rmmod bonding
systemctl restart network
systemctl restart sshd

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值