做bond的目的:
拓宽上联带宽,网络优化。
为什么不做双口,乃至四口外网bond呢?
因为做bond,将耗费大量的交换机端口,占用资源。如果对带宽要求很高,完全可以更换万兆网卡,协商速率10000MB/S 效果更好。
双内网bond:
2根内网网线,插同一个内网接入交换机的2个口。
双内网bond+外网:
2根内网线,+1根外网线
两个外网bond:
2根外网线 【没用应用】
内网bond叫做bond0 外网bond叫做bond1
- 接口配置文件
[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
- bonding参数
[root@install ~]# tail -2 /etc/modprobe.d/bond0.conf
alias bond0 bonding
options bonding mode=0 miimon=100
- 重启网络服务
[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