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