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 运行模式为主备

team

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

team

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

team

5  ifconfig

team

6  watch -n 1 teamdctl team0 stat

team

第二个界面
ping 172.25.254.44

team

第三个界面
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不通
team

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











本文转自 如何何如  51CTO博客,原文链接:http://blog.51cto.com/12778805/1928791,如需转载请自行联系原作者