linux——bont,team网桥的搭建

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

先删掉eth0


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



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

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

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

brctl delbr br0           ##删除br0



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



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

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



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



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

删除eth1,eth0,bond0



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


监控:
watch -n 1 teamdctl team0 state

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



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值