1. 程式人生 > >team

team

team

#####team######
1.
team也是鏈路聚合的一種方式。最多支持8塊網卡
Team 接口:
Team 和 bond0 功能類似
Team 不需要手動加載相應內核模塊
Team 有更強的拓展性
– 支持 8 快網卡
支持模式:
broadcast 廣播容錯
roundrobin 輪詢
activebackup 主備
loadbalance 負載均衡
2.
配置

nmcli connection add con-name team0ifname team0 type team config‘{"runner":{"name":"activebackup"}}‘ ip4172.25.254.144/24

####添加team 運行模式為主備
nmcli connection add con-name eth0 ifname eth0 type team-slave masterteam0 ####給team添加網卡eth0
nmcli connection add con-name eth1 ifname eth1 type team-slave masterteam0 ###給team添加網卡eth1
3
測試

watch -n 1 teamdctl team0 stat ###監視team0的運行狀態
ifconfig eth0 down ####控制eth0掛掉
ifconfig eth0 up ####控制eth0恢復
ifconfig eth1 down ####控制eth1掛掉
ifconfig eth1 up ####控制eth1恢復

做之前必須要有兩塊及以上網卡。重置虛擬機.用命令nm-connection-editor刪除eth0原有IP。
第一個界面
1 ifconfig ####查看網絡
2 nmcli connection add con-name team0 ifname team0 type team config‘{"runner":{"name":"activebackup"}}‘ ip4172.25.254.144/24
####添加team 運行模式為主備

技術分享

3 nmcli connection add con-name eth0 ifname eth0 type team-slave masterteam0 ####給team添加網卡eth0

技術分享

4 nmcli connection add con-name eth1 ifname eth1 type team-slave masterteam0 ###給team添加網卡eth1

技術分享

5 ifconfig

技術分享

6 watch -n 1 teamdctl team0 stat

技術分享

第二個界面
ping 172.25.254.44

技術分享

第三個界面
ifconfig eth0 down ####控制eth0掛掉
ifconfig eth0 up ####控制eth0恢復
ifconfig eth1 down ####控制eth1掛掉
ifconfig eth1 up ####控制eth1恢復
ifconfig eth0 down ####控制eth0掛掉
ifconfig eth1 down ####控制eth1掛掉
eth0 掛掉 eth1運行;eth0恢復,eth1運行;eth1掛掉,才會換eth0運行
兩張都掛掉,ping不通
技術分享

######刪除team0######
13 nmcli connection delete team0
14 nmcli connection delete eth0
15 nmcli connection delete eth1
16 nmcli connection show


team