redhat7 team bonding 双网卡绑定 主备 负载均衡

team简介

team也被称为网络组,是将多个网卡聚合在一起,从而实现冗错和提高吞吐量。适用于redhat7.0以上版本,至多可支持8块网卡。
team相对于之前的bonding技术,能提供更好的性能和扩展性。team由内核驱动和teamd守护进程实现。


一,建立team

1 nmcli connection add type team con-name team0 ifname team0 config '{"runner":{"name":"activebackup"}}'
 #nmcli con add type team con-name CNAME ifname INAME [config JSON]
 #CNAME 指代连接的名称,INAME 是接口名称,JSON (JavaScript Object Notation) 指定所使用的处理器(runner)。
 #JSON语法格式:'{"runner":{"name":"METHOD"}}' METHOD 是以下的其中一个:broadcast、activebackup、roundrobin、loadbalance 或者lacp。

二,添加网卡接口
1 nmcli con add type team-slave con-name team0-port1 ifname ens160 master team0 
2 nmcli con add type team-slave con-name team0-port2 ifname ens224 master team0 

三,配置网络参数 
nmcli connection modify team0 ipv4.address "192.168.1.5/24" ipv4.gateway 192.168.1.254 ipv4.method manual connection.autoconnect yes
设置team0的IP、GATEWAY、DNS,以及team的属性
connection.autoconnect yes = ONBOOT 设为yes
ipv4.method manual
= BOOTPROTO 设置为dhcp

四,激活、启动team0
nmcli connection up team0

五,检查状态
teamdctl team0 state





删除team及接口
1 nmcli connection delete team0
2 nmcli connection delete team0-port1
3 nmcli connection delete team0-port2


更改team的模式
nmcli connection modify team0 config '{"runner":{"name":"roundrobin"}}'
 

 


posted @ 2023-05-18 10:50  foolqiu  阅读(327)  评论(0编辑  收藏  举报