网络桥接bridge

mv ifcfg-br0 ifcfg-enp0s25 /mnt/ ##保存文件
Linux——高级网络控制
vim ifcfg-enp0s25
Linux——高级网络控制

reboot

ifconfig
Linux——高级网络控制

systemctl stop NetworkManager.service

vim ifcfg-enp0s25
Linux——高级网络控制

vim ifcfg-br0
Linux——高级网络控制

systemctl restart network
Linux——高级网络控制
ifconfig ##重启后br0启用成功
Linux——高级网络控制
rm -rf ifcfg-enp0s25 ifcfg-br0 ##还原
mv /mnt/ifcfg-* .
reboot

网络接口

nm-connection-editor ##删除eth0
brctl show ##查看接口
brctl addbr br0 ##添加br0
ifconfig br0 172.25.254.108 netmask 255.255.255.0 ##配置br0
ping 172.25.254.250 ##网络不通
Linux——高级网络控制
brctl addif br0 eth0 ##添加物理接口
ping 172.25.254.250 ##网络通畅
Linux——高级网络控制
ifconfig br0 down ##去掉br0
brctl delbr br0 ##去掉br0
brctl show ##再次查看
Linux——高级网络控制

bond主备

添加网卡
nm-connection-editor ##清除环境
systemctl start NetworkManager
nmcli connection add con-name bond0 ifname bond0 type bond mode active-backup ip4 172.25.254.108/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
ping 172.25.254.250 ##网络通畅
Linux——高级网络控制
ifconfig
Linux——高级网络控制
ifconfig eth0 down ##将eth0关掉
ping 172.25.254.250 ##网络依然通畅
Linux——高级网络控制

team主备

nm-connection-editor
nmcli connection delete bond0
nmcli connection delete eth0
nmcli connection delete eth1 ##清除环境

nmcli connection add con-name team0 type team ifname team0 config ‘{“runner”:{“name”:”activebackup”}}’ ip4 172.25.254.108/24
Linux——高级网络控制
ifconfig
Linux——高级网络控制
teamdctl team0 state ##查看team状态
Linux——高级网络控制
nmcli connection add con-name eth0 ifname eth0 type team-slave master team0
ping 172.25.254.250 ##添加eth0后网络通畅
Linux——高级网络控制
nmcli connection add con-name eth1 ifname eth1 type team-slave master team0
ping 172.25.254.250 ##再次添加eth1后网络依然通畅
Linux——高级网络控制
ifconfig eth0 down ##将eth0关掉
ping 172.25.254.250 ##网络通畅
Linux——高级网络控制
teamdctl team0 state ##查看team状态

相关文章: