centos7 team网卡绑定不生效

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos7 team网卡绑定不生效相关的知识,希望对你有一定的参考价值。

1.Teamd 查看状态不能发发现绑定端口

Ens37 ens38 网卡下有配置情况下,team0绑定后可以生效但是
使用teamdctl team0 st 查看不到端口具体信息
[[email protected] ~]# teamdctl team0 st
setup:
runner: activebackup
runner:
active port:
[[email protected] ~]#

[[email protected] ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eno16777736: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:29:24:30:26 brd ff:ff:ff:ff:ff:ff
inet 192.168.171.128/24 brd 192.168.171.255 scope global eno16777736
valid_lft forever preferred_lft forever
inet6 fe80::20c:29ff:fe24:3026/64 scope link
valid_lft forever preferred_lft forever
3: ens37: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:29:24:30:30 brd ff:ff:ff:ff:ff:ff
inet 192.168.171.132/24 brd 192.168.171.255 scope global dynamic ens37
valid_lft 1451sec preferred_lft 1451sec
inet6 fe80::20c:29ff:fe24:3030/64 scope link
valid_lft forever preferred_lft forever
4: ens38: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:29:24:30:3a brd ff:ff:ff:ff:ff:ff
inet 192.168.171.135/24 brd 192.168.171.255 scope global ens38
valid_lft forever preferred_lft forever
inet6 fe80::20c:29ff:fe24:303a/64 scope link
valid_lft forever preferred_lft forever
5: team0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN
link/ether c6:52:68:78:b8:fb brd ff:ff:ff:ff:ff:ff
inet 192.168.171.136/24 brd 192.168.171.255 scope global team0
valid_lft forever preferred_lft forever

2、esn37 ens38 接口下有配置
删除端口配置
nmcli conn del team0-port1
nmcli conn del team0-port2
nmcli conn del ens37
nmcli conn del ens38
Nmcli con show
Ip addr

3、重新添加team-slave端口
添加team-slave 端口
Nmcli con add type team con-name team0-port1 ifname ens37 master team0
Nmcli con add type team con-name team0-port2 ifname ens38master team0

4、检查team0状态,状态正常

[[email protected] network-scripts]# teamdctl team0 st
setup:
runner: activebackup
ports:
ens37
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
ens38
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
runner:
active port: ens37

5、ifdown ens37端口

初始状态活动端口为ens37, 网络正常 ,关闭ens37端口,活动端口切换为ens38,ping丢包2个
[[email protected] network-scripts]# ifdown ifcfg-team0-port1
Device ‘ens37‘ successfully disconnected.
[[email protected] network-scripts]# teamdctl team0 st
setup:
runner: activebackup
ports:
ens38
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
runner:
active port: ens38
[[email protected] network-scripts]#

6、ifup ens37端口
Ping短暂中断,后面恢复正常active prots依然为ens38 ,没有发生抢占,非常OK

[[email protected] network-scripts]# teamdctl team0 st
setup:
runner: activebackup
ports:
ens38
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
ens37
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
runner:
active port: ens38
[[email protected] network-scripts]#

以上是关于centos7 team网卡绑定不生效的主要内容,如果未能解决你的问题,请参考以下文章

CentOS7多网卡绑定之team

centos7.2的双网卡怎么绑定

Centos7 / RHEL 7 双网卡绑定

nmcli网卡绑定与teaming配置

linux 7 网卡绑定

Linux配置网卡绑定team