(可选)配置Bond4
Bond4是网络接口绑定(Network Interface Bonding)中的模式4,也称为IEEE 802.3ad动态链路聚合或LACP(Link Aggregation Control Protocol)。这种模式通过将多个物理网络接口组合成一个逻辑接口来提升带宽和提供冗余。
配置Bond4需要修改Server端配置以及交换机配置,需要提前知道Server端组Bond4的两张网卡对应交换机上的物理接口以及交换机IP。
交换机动态LACP配置
- 登录交换机。
- 查看交换机上所有可用的物理接口。
1
display interface brief
如上图所示,检查Server端组Bond4的两张网卡Eth1和Eth2对应交换机上的端口是状态为up且没有在Eth-Trunk组内。下文以25GE 1/0/33和25GE 1/0/34端口为例进行Bond4配置。
- 聚合组Eth-Trunk12配25GE 1/0/33和25GE 1/0/34端口。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
system-view interface Eth-Trunk 12 mode lacp-dynamic trunkport 25GE 1/0/33 trunkport 25GE 1/0/34 commit quit interface 25GE 1/0/33 eth-trunk 12 commit quit interface 25GE 1/0/34 eth-trunk 12 commit quit
- 登录Server端。
- 断开Eth1和Eth2网卡的网络连接。
1 2
nmcli con down eth1 nmcli con down eth2
- 备份Eth1网卡和Eth2网卡配置文件“/etc/sysconfig/network-scripts/ifcfg-eth1”和“/etc/sysconfig/network-scripts/ifcfg-eth2”,并删除原文件。
1 2 3 4 5
cd /etc/sysconfig/network-scripts cp ifcfg-eth1 ifcfg-eth1.bak cp ifcfg-eth2 ifcfg-eth2.bak rm -rf ifcfg-eth1 rm -rf ifcfg-eth2
- 将Eth1和Eth2网卡组Bond4,且使其支持802.3ad协议。
1 2 3 4 5 6
nmcli con add type bond con-name bond4 ifname bond4 mode 802.3ad nmcli con add type bond-slave ifname eth1 master bond4 nmcli con add type bond-slave ifname eth2 master bond4 nmcli con up bond-slave-eth1 nmcli con up bond-slave-eth2 nmcli con up bond4
- 修改Bond4的配置文件。
- 打开ifcfg-bond4文件。
1
vi /etc/sysconfig/network-scripts/ifcfg-bond4
- 添加IP地址,将“BOOTPROTO=dhcp”改成“BOOTPROTO=none”。
1 2 3
IPADDR=192.168.xx.xx NETMASK=255.255.255.0 BOOTPROTO=none
- 按Esc键退出编辑模式,输入:wq!,按Enter键保存退出文件。
- 打开ifcfg-bond4文件。
- 重启网络服务和Bond4 。
1 2 3
service NetworkManager restart nmcli con down bond4 nmcli con up bond4
- 查看Bond4的网络信息。
1 2
ip a | grep -C 5 bond4 ip a
- 查看Bond4状态。
1
cat /proc/net/bonding/bond4
满足以下条件则Bond4配置正确:
- Bonding Mode为IEEE 802.3ad Dynamic link aggregation。
- MII Status状态为up。
- 服务器间使用Bond4 IP,服务器之间可以互相连接。
交换机侧检查Bond4配置
在Server端配置完成Bond4并检查配置正确后,在交换机侧查看Eth-Trunk12。
1
|
display eth-trunk 12 |
满足以下条件则表示Bond4配置正确:
- Working Mode为Dynamic。
- Operating Status状态为up。
- Number Of Up Ports In Trunk为2,且在回显中有25GE 1/0/33和25GE 1/0/34两个端口的相关信息。
父主题: 搭建环境和组网