linux——bont,team网桥的搭建

1.br0网桥的搭建(只能搭一个)

先删掉eth0

linux——bont,team网桥的搭建linux——bont,team网桥的搭建


brctl show        ##查看是否有br0
brctl addbr br0         ##添加br0
ifconfig br0 172.25.254.xx netmask 255.255.255.0       ##此时虽有br0,但是无法连接
brctl addif br0 eth0        ##将eth0连接上br0
ping 172.25.254.zz      ##查看是否可以连接172.25.254.zz

linux——bont,team网桥的搭建



2.bond网络(最多可创建2个网卡)

删掉br0,添加网卡(点击灯泡,add添加NIC)

brctl delif br0 eth0       ##删除br0与eth0的连接

brctl delbr br0           ##删除br0

linux——bont,team网桥的搭建


nmcli connection add con-name bond0 ifname bond0 type bond mode active-backup ip4 172.25.254.xx/24    ##创建bond
nmcli connection add con=name eth0 ifname eth0 type bond-slave master bond0        ##在bond上添加eth0

nmcli connection add con=name eth1 ifname eth1 type bond-slave master bond0

linux——bont,team网桥的搭建


监控:
watch -n 1 cat /proc/net/bonding/bond0
ifconfig eth0 down|up       ##eth0的关开
nmcli connection delete eth0      ##若eth0坏掉,删除eth0在重新添加即可

ping 172.25.254.zz      ###看是否连通

linux——bont,team网桥的搭建


删除eth0之后,eth1接替它的工作

linux——bont,team网桥的搭建

linux——bont,team网桥的搭建



3.team(最多可添加8个)

删除eth1,eth0,bond0

linux——bont,team网桥的搭建


nmcli connection add con-name team0 type team ifname team0 config '{"runner":{"name":"activebackup"}}' ip4 172.25.254.xx/24            ##添加team网络,名为team0
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

linux——bont,team网桥的搭建


监控:
watch -n 1 teamdctl team0 state

ifconfig eth0 down     ##停掉eth0后(模拟eth0坏掉),eth1接替工作

linux——bont,team网桥的搭建linux——bont,team网桥的搭建