Linux双网卡绑定启动网卡报错Error: Connection activation failed: Master connection not found or invalid
Linux双网卡绑定启动网卡报错Error: Connection activation failed: Master connection not found or invalid
前言
OS版本:Oracle Linux 6.8
做双网卡绑定的时候,bond0配置如下:
DEVICE=bond0 TYPE=bond ONBOOT=yes NM_CONTROLLED=no BOOTPROTO=none IPADDR=192.168.180.100 NETMASK=255.255.255.0 GATEWAY=192.168.180.254 USERCTL=no BONDING_OPTS="mode=1 miimon=100"
eth0配置如下(eth1配置类似):
DEVICE=eth0 HWADDR=XX:XX:XX:XX:XX:22 TYPE=Ethernet UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx ONBOOT=yes NM_CONTROLLED=yes BOOTPROTO=none MASTER=bond0 SLAVE=yes
结果启动报错:
[root@xxxxxxstb01 network-scripts]# ifup eth0 Error: Connection activation failed: Master connection not found or invalid [root@xxxxxxstb01 network-scripts]# ifup eth1 Error: Connection activation failed: Master connection not found or invalid [root@xxxxxxstb01 network-scripts]# ifup bond0 Error: Connection activation failed: Master connection not found or invalid Unable to start slave device ifcfg-eth0 for master bond0. Error: Connection activation failed: Master connection not found or invalid Unable to start slave device ifcfg-eth1 for master bond0. Determining if ip address 192.168.180.100 is already in use for device bond0...
网络直接断开连接不了了......
我去,得跑机房了......
原因
度娘问到的:
NetworkManager导致的(由于需要去机房才能验证,八九不离十就是这个问题了)。
NetworkManager和network是两个不同的服务,它们是互相冲突的。最根本的解决办法就是把NetworkManager服务停掉。
NetworkManager其实是图形界面管理工具,如果在没有安装图形界面时NetworkManager是不会安装的。
结合mos文档(Linux OS Service 'NetworkManager' (文档 ID 560043.1)):
Service Name
NetworkManagerDescription
The Service manages the NetworkManager daemon, which is part of GNOME desktop. (For Laptops and Desktops)
Therefore it thinks that it is running on a laptop/desktop.With the Linux desktop, different networking factors come in like:
- Change of networks (home, office, public etc.)
- Wi-Fi (Wireless)
- Dialup Networking (DUN)
- Mobile Broadband
- Bluetooth Dialup
The NetworkManager can manage such dynamic networking requirements which also has a Graphical User Interface (GUI). This daemon backs the GUI.
This software is not recommended for any Linux Servers. Linux servers don't run GNOME.
Network Manager initially does nothing until the network state changes, (including yum update) then unless "ifcfg-*" file has "NM_CONTROLLED=NO"
the NM will take control of the link and drop it because nobody is logged in to gnome, and take the next available network port.Service Management
The service is disabled by default for Linux prior to OL 6.x.
# chkconfig --list NetworkManager
NetworkManager 0:off 1:off 2:off 3:off 4:off 5:off 6:off
You can enable the service for Linux 4 and 5 by:
# chkconfig NetworkManager on
# chkconfig --list NetworkManager
NetworkManager 0:off 1:off 2:on 3:on 4:on 5:on 6:off
#
To start the service:
# service NetworkManager start
Setting network parameters... [ OK ]
Starting NetworkManager daemon: [ OK ]
#
To stop the service:
# service NetworkManager stop
Stopping NetworkManager daemon: [ OK ]
#Nature
DaemonOracle Linux Version(s)
- Oracle Linux 4
- Oracle Linux 5
- Oracle Linux 6
Essentiality
Not crucial for Oracle Linux 5 latest (and disabled by default). Nevertheless, this may become the standard network management service in future.
Detrimental it Oracle Linux 6 (any release) as the software is enabled by default.
If NetworkManager is not disabled, a cgange in status will cause the NetworkManager to take the next available network port, disabling the network for the server.
To correct:ensure that the NM_CONTROLLED and UUID lines are removed from /etc/sysconfig/network-scripts/ unused network port ifcfg-ethx file
暂不清楚具体原理,也没时间研究。
由于本身服务器不安装图形化界面是没有该服务的,而且某些情况会出现问题(比如我遇到的)。
MOS文档也指出不建议任何Linux服务器使用此软件。
建议在Linux服务器上禁用该服务。
参考
https://blog.csdn.net/jinwufeiyang/article/details/80211294
Missing Bonding Virtual Interface After Rebooting Orcle Linux Server (文档 ID 1625976.1)
How To Disable NetworkManager on Oracle Linux 7 (文档 ID 2501839.1)
Linux OS Service 'NetworkManager' (文档 ID 560043.1)
关于NetworkManager和network