bond与team链路聚合
网桥br0的建立
实验环境真机
删除原有网络配置(保留virbr0、virbr0)
输入以下命令
cd /etc/sysconfig/network-scipts/
vim ifcfg-br0
vim ifcfg-enp0s25
编内容如下
重启后查看
命令方式搭建网桥
brctl addbr br0 建立网桥
brctl addif br0 eth0
brctl show 查看桥接
删除
brctl delif br0 eth0
brctl delbr br0
实验环境虚拟机
bond建立
删除原有配置,给虚拟机配两个网卡
通过命令方式建立
创建bond链路
nmcli connection add con-name bond0 ifname bond0 type bond mode active-backup ip4 ip地址/子网掩码
查看方式ifconfig | cat /proc/net/bonding/bond0;Currently Active Slave值为None表示当前没有物理网卡工作,没有物理网卡是ping不通的
添加两块物理网卡,这时eth0处于工作状态,ping测试成功
nmcli connection add con-name eth0 ifname eth0 type bond-slave master bond0
nmcli connection add con-name eth1 ifname eth1 type bond-slave master bond0
ifconfig eth0 down当eth0故障关闭后,eth1就会接替继续工作,还是可以ping通
通
删除配置
文件方式建立
建立如下三个文件分别,之后重启网络服务
vim /etc/sysconfig/network-scripts/ifcfg-bond0
vim /etc/sysconfig/network-scripts/ifcfg-eth0
vim /etc/sysconfig/network-scripts/ifcfg-eth1
ping命令测试连通
teame建立
通过以下命令建立teame链路聚合
nmcli connection add con-name team0 ifname team0 type team config '{"runner":{"name":"activebackup"}}' ip4 ip地址/子网掩码
nmcli connection add con-name eth0 ifname eth0 type team-slave master team0
nmcli connection add con-name eth1 ifname eth1 type team-slave master team0
通过teamdctl team0 stat查看eth0在工作,ping通
同样测试当eth0关闭后,eth1接替工作
文件方式建立
vim /etc/sysconfig/network-scripts/ifcfg-team0
vim /etc/sysconfig/network-scripts/ifcfg-eth0
vim /etc/sysconfig/network-scripts/ifcfg-eth1
重启服务后处于工作状态