1.bond模式
bond模式最多支持2块网卡
轮询聚合:两块网卡同时工作
主备聚合:一块网卡工作,一块网卡预备
在虚拟机新加一块网卡
nmcli connection show
nmcli connection delete eth0
nmcli connection add con-name bond0 ifname bond0 type bond mode active-backup ip4 172.25.254.221/24 ##添加bond聚合接口
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 ##绑定真实物理网卡
nmcli connection show
ping 172.25.254.21
watch -n1 cat /proc/net/bonding/bond0 ##监控网卡运行状态
ifconfig device down/up ##开启/关闭网卡
2.team模式
在虚拟机新加一块网卡
nmcli connection show
nmcli connection delete eth0
nmcli connection add con-name team0 ifname team0 type team config '{"runner":{"name":"activebackup"}}' ip4 172.25.254.221/24
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
nmcli connection show
watch -n1 "teamdctl team0 stat"
ifconfig eth0 down/up
3.br0
命令的方式开启桥接(命令修改是临时的)
brctl addbr br0
ifconfig br0 172.25.254.121/24
ifconfig
brctl show ##没有真实物理设备与之对应
brctl addif br0 eth0
ping 172.25.254.250
恢复:
brctl delif br0 eth0
brctl show
ifconfig br0 down
brctl show
brctl delbr br0
systemctl restart network