搭建环境
至少两块网卡或不超过八块(包含八块)
bond模式,只支持两块网卡桥接
team模式,最多支持八块网卡桥接
bond
模式
watch -n 1 'cat /proc/net/bonding/bond0'
nmcli connection add con-name bond0 ifname bond0 type bond mode active-backup ip4 172.25.254.130/24
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
ifconfig eth0 down
ifconfig eth0 up
ifconfig eth1 down
nmcli connection delete bond0
nmcli connection delete eth0
nmcli connection delete eth1
ifconfig eth0 down
ifconfig eth1 down
ifconfig
team
模式
nmcli connection add con-name team0 ifname team0 type team config '{"runner":{"name":"activebackup"}}' ip4 172.25.254.130/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
teamdctl team0 stat
ifconfig eth0 down
teamdctl team0 stat
ifconfig eth0 up
ifconfig eth1 down
teamdctl team0 stat
nmcli connection delete team0
nmcli connection delete eth0
nmcli connection delete eth1
命令方式开启桥接(命令修改是临时的)
brctl addbr br0
添加br0
ifconfig br0 172.25.254.130/24
br0 添加 ip
ifconfig
查看 br0
brctl show
没有真实物理设备与之对应
brctl addif br0 eth0
给 br0 添加真实物理设备
ping 172.25.254.250
测试网络
删除
brctl delif br0 eth0
删除 br0 所对应的真实物理设备
brctl show
查看状态
i
fconfig br0 down
关闭br0
brctl show
查看状态
brctl delbr br0
删除br0
systemctl restart network