签到成功

知道了

CNDBA社区CNDBA社区

How to disable NetworkManager in RHEL?

2021-12-22 11:45 885 0 原创 Linux
作者: hbhe0316

Environment
Red Hat Enterprise Linux 5
Red Hat Enterprise Linux 6
Red Hat Enterprise Linux 7
Red Hat Enterprise Linux 8
NetworkManager service.
Issue
Disabling NetworkManagerhttp://www.cndba.cn/hbhe0316/article/78612

What steps are needed to disable the NetworkManager service?
What is needed to ensure it does not start again on a subsequent reboot?
Disabled NetworkManager but still seeing errors (need to fully disable)http://www.cndba.cn/hbhe0316/article/78612

Trouble configuring networking with NetworkManager and need to disable.
Disabled NetworkManager but still seeing errors about it and “Connection activation failed”
Resolution
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 NetworkManager service:

Raw
service NetworkManager stop
Disable it permanently so that the NetworkManager service will not be started on next boot:

Raw
chkconfig NetworkManager off
Confirm if the NetworkManager service has been disabled:

http://www.cndba.cn/hbhe0316/article/78612

Raw
chkconfig —list|grep NetworkManager
Add below parameter in /etc/sysconfig/network-scripts/ifcfg-ethX to ensure NetworkManagerdoes not take control of the interface in case if it is accidentally activated.

Raw
NM_CONTROLLED=”no”
Note: Be sure to change the NM_CONTROLLED=”yes” to “no” or the network service 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-eth0

Raw
IPADDR=……
NETMASK=…..
GATEWAY=…..
ONBOOT=yes
BOOPROTO=static
NM_CONTROLLED=no
Set the DNS servers to be used by editing the file : /etc/resolv.conf

Raw
nameserver 10.x.x.1
nameserver I0.x.x.2
Restart the network servicehttp://www.cndba.cn/hbhe0316/article/78612

http://www.cndba.cn/hbhe0316/article/78612

Raw
chkconfig network on
service network restart
FOR RHEL7 and RHEL8

http://www.cndba.cn/hbhe0316/article/78612

For only RHEL8, network-scripts needs installing and enabling since it is deprecated.
Raw
yum install network-scripts
systemctl enable network.service
Disabling NetworkManager.
Stop the NetworkManager service:

Raw
systemctl stop NetworkManager
To disable the service permanently:

Raw
systemctl disable NetworkManager
Add below parameter in /etc/sysconfig/network-scripts/ifcfg-enXXX to ensure NetworkManagerdoes not take control of the interface in case if it is accidentally activated.http://www.cndba.cn/hbhe0316/article/78612

Raw
NM_CONTROLLED=”no”
Switching to the “network” service
Once NetworkManager is disabled, the interface can be configured for use with the network service.

http://www.cndba.cn/hbhe0316/article/78612

Set the correct IP address by editing the file: /etc/sysconfig/network-scripts/ifcfg-enXXX

http://www.cndba.cn/hbhe0316/article/78612
http://www.cndba.cn/hbhe0316/article/78612

Raw
IPADDR=……
NETMASK=…..
GATEWAY=…..
ONBOOT=yes
BOOPROTO=static
NM_CONTROLLED=no
Restart the network service

Raw
systemctl restart network.service
Root Cause
The NetworkManager service may not be needed for server environments as it may override changes made to network configuration files, which may be undesirable.

If the NetworkManager services is not needed or not working as expected, then the network service can be used instead.

Diagnostic Steps
The NetworkManager service seems to be taking over the ifcfg script files and changing them to incorrect information.

Check on if the NetworkManager service is enabled or running to see if it should be disabled:

Raw
chkconfig —list | grep NetworkManager
service NetworkManager status
If NetworkManager is disabled, but when starting the network service 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-scripts does not contain “NM_CONTROLED=yes” .

版权声明:本文为博主原创文章,未经博主允许不得转载。

Linux

用户评论
* 以下用户言论只代表其个人观点,不代表CNDBA社区的观点或立场
hbhe0316

hbhe0316

关注

1.只有承认无知,才能装下新的东西; 2.进步来自一点点滴滴的积累; 3.广博让你更优秀,而专业让你无法替代; 4.挫折和失败能够转换为一种财富。

  • 889
    原创
  • 1
    翻译
  • 13
    转载
  • 24
    评论
  • 访问:1039490次
  • 积分:1523
  • 等级:核心会员
  • 排名:第6名
精华文章
    最新问题
    查看更多+
    热门文章
      热门用户
      推荐用户
        Copyright © 2016 All Rights Reserved. Powered by CNDBA · 皖ICP备2022006297号-1·

        QQ交流群

        注册联系QQ