Centos 7.2中双网卡绑定及相关问题踩坑记录

2019-01-16 23:08:39于丽

前言

最近工作中在做线上服务器,安装centos7.2 x64最小化安装,需要做链路聚合,双网卡绑定。在centos 6.x 和 centos 7上测试都OK,于是直接开搞。

说明下,以下环境是在虚拟机中实现的:

系统: centos7.2 x64 最小化安装。

为了方便演示,这里共有三张网卡:

    eno16777736 : 桥接网卡:10.0.0.11/24

    剩下的两张网卡准备做绑定:

        eno33554984

        eno50332208

[root@bogon ~]# nmcli con sh NAME UUID TYPE DEVICE Wired connection 2 bf0cf9b6-c7fb-4c0a-ada4-abfb650dd5f0 802-3-ethernet -- Wired connection 1 5b4e0b3e-c469-404c-8839-76d18442fc20 802-3-ethernet -- eno16777736 100e462e-c0d0-4271-9b5a-1c8e47ff0d03 802-3-ethernet eno16777736 [root@bogon ~]# nmcli con del 5b4e0b3e-c469-404c-8839-76d18442fc20 bf0cf9b6-c7fb-4c0a-ada4-abfb650dd5f0 Connection 'Wired connection 1' (5b4e0b3e-c469-404c-8839-76d18442fc20) successfully deleted. Connection 'Wired connection 2' (bf0cf9b6-c7fb-4c0a-ada4-abfb650dd5f0) successfully deleted. [root@bogon ~]# nmcli con add type team ifname team0 con-name team0 config '{"runner":{"name":"roundrobin"}}' Connection 'team0' (913f05c2-15d8-49a9-a35f-8bc5ee843c0c) successfully added. [root@bogon ~]# nmcli con add type team-slave ifname eno50332208 con-name team0-port2 master team0 Connection 'team0-port2' (1583854c-1f85-4c76-8cc7-c643071d4b82) successfully added. [root@bogon ~]# nmcli con mod team0 ipv4.address "192.168.121.100/24" [root@bogon ~]# nmcli con mod team0 ipv4.method manual [root@bogon ~]# nmcli con sh NAME UUID TYPE DEVICE eno16777736 100e462e-c0d0-4271-9b5a-1c8e47ff0d03 802-3-ethernet eno16777736 team0-port2 1583854c-1f85-4c76-8cc7-c643071d4b82 802-3-ethernet -- team0-port1 bfd408b4-76d9-4f5c-ad5b-4d92430eb6ba 802-3-ethernet -- team0 913f05c2-15d8-49a9-a35f-8bc5ee843c0c team --

到这里都没毛病。

[root@bogon ~]# nmcli con up team0 Error: Connection activation failed: NetworkManager plugin for 'team' unavailable

什么鬼?NetworkManager "team"插件不可用。于是开始排查。

是否存在team模块

[root@bogon ~]# lsmod | egrep *team*

木有。那直接restart network好了。

[root@bogon ~]# systemctl restart network Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details. [root@bogon ~]# systemctl status network ... Mar 25 04:47:56 bogon network[2742]: Bringing up interface team0: Error: Connection activation failed: NetworkManager plugin for 'team' unavailable Mar 25 04:47:56 bogon network[2742]: [FAILED] ...