How to disable NetworkManager in RHEL5-6-7

117 篇文章 0 订阅
68 篇文章 0 订阅

How to disable NetworkManager in RHEL?.

环境

  • Red Hat Enterprise Linux (RHEL) 5.
  • Red Hat Enterprise Linux (RHEL) 6.
  • Red Hat Enterprise Linux (RHEL) 7.
  • NetworkManager service.

问题

  • Disabling NetworkManager

    • 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)

    • Trouble configuring networking with NetworkManager and need to disable.
    • Disabled NetworkManager but still seeing errors about it and "Connection activation failed"

决议

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:

    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 service

    Raw

    # chkconfig network on
    # service network restart
    

FOR RHEL7

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.

    Raw

    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-enXXX

    Raw

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

    Raw

    # systemctl restart network.service
    

根源

  • 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.

诊断步骤

  • 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" .

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值