How to disable NetworkManager in RHEL?.
环境
- Red Hat Enterprise Linux (RHEL) 5.
- Red Hat Enterprise Linux (RHEL) 6.
- Red Hat Enterprise Linux (RHEL) 7.
NetworkManagerservice.
问题
-
Disabling
NetworkManager- What steps are needed to disable the
NetworkManagerservice? - What is needed to ensure it does not start again on a subsequent reboot?
- What steps are needed to disable the
-
Disabled
NetworkManagerbut still seeing errors (need to fully disable)- Trouble configuring networking with
NetworkManagerand need to disable. - Disabled
NetworkManagerbut still seeing errors about it and "Connection activation failed"
- Trouble configuring networking with
决议
FOR RHEL5 and RHEL6.
Disabling NetworkManager.
The steps below will disable network manager and allow the interface to be managed by the network service instead.
-
Stop the
NetworkManagerservice:# service NetworkManager stop -
Disable it permanently so that the
NetworkManagerservice will not be started on next boot:# chkconfig NetworkManager off -
Confirm if the
NetworkManagerservice has been disabled:# chkconfig --list|grep NetworkManager -
Add below parameter in
/etc/sysconfig/network-scripts/ifcfg-ethXto ensureNetworkManagerdoes not take control of the interface in case if it is accidentally activated.NM_CONTROLLED="no"Note: Be sure to change the NM_CONTROLLED="yes" to "no" or the
networkservice may complain about "Connection activation failed" when it cannot find an interface to start.
Switching to the "network" service
Once NetworkManager is disabled, the interface can be configured for use with the network service.
-
Set the correct IP address by editing the file:
/etc/sysconfig/network-scripts/ifcfg-eth0IPADDR=...... NETMASK=..... GATEWAY=..... ONBOOT=yes BOOPROTO=static NM_CONTROLLED=no -
Set the DNS servers to be used by editing the file :
/etc/resolv.confnameserver 10.x.x.1 nameserver I0.x.x.2 -
Restart the network service
# chkconfig network on # service network restart
FOR RHEL7
Disabling NetworkManager.
-
Stop the
NetworkManagerservice:# systemctl stop NetworkManager -
To disable the service permanently:
# systemctl disable NetworkManager -
Add below parameter in
/etc/sysconfig/network-scripts/ifcfg-enXXXto ensureNetworkManagerdoes not take control of the interface in case if it is accidentally activated.NM_CONTROLLED="no"
Switching to the "network" service
Once NetworkManager is disabled, the interface can be configured for use with the network service.
-
Set the correct IP address by editing the file:
/etc/sysconfig/network-scripts/ifcfg-enXXXIPADDR=...... NETMASK=..... GATEWAY=..... ONBOOT=yes BOOPROTO=static NM_CONTROLLED=no -
Restart the network service
# systemctl restart network.service
根源
-
The
NetworkManagerservice may not be needed for server environments as it may override changes made to network configuration files, which may be undesirable. -
If the
NetworkManagerservices is not needed or not working as expected, then thenetworkservice can be used instead.
诊断步骤
-
The
NetworkManagerservice seems to be taking over theifcfgscript files and changing them to incorrect information. -
Check on if the
NetworkManagerservice is enabled or running to see if it should be disabled:# chkconfig --list | grep NetworkManager # service NetworkManager status -
If
NetworkManageris disabled, but when starting thenetworkservice there are errors and messages regarding:NetworkManager- "Connection activation failed"
-
Check to be sure that at least one working ifcfg-ethX file in
/etc/sysconfig/network-scriptsdoes not contain "NM_CONTROLED=yes" .

本文详细介绍了如何在Red Hat Enterprise Linux (RHEL) 5、6和7中禁用NetworkManager服务,并确保其在重启后不再启动。此外,还提供了完全禁用NetworkManager并避免错误消息的步骤,如Connection activation failed。文章涵盖了编辑配置文件以防止NetworkManager接管接口控制的方法。
527

被折叠的 条评论
为什么被折叠?



