How to disable NetworkManager in RHEL 8 ?

How to disable NetworkManager in RHEL 8 ?

环境

Red Hat Enterprise Linux (RHEL) 8

问题

What steps are needed to disable the NetworkManager service?

决议

At first, please note that the old networks-scripts have been deprecated and are not the defaults anymore.

  • ifup belongs to the NetworkManager package by default.

    Raw

    # readlink $(which ifup)
    /etc/alternatives/ifup
    
    # readlink $(readlink $(which ifup))
    /usr/libexec/nm-ifup
    
  • You can change this behaviour by installing the package below. After that, the ifcfg configurations will be handled by the network.service

    Raw

    # yum install network-scripts
    
    # readlink $(readlink $(which ifup))
    /etc/sysconfig/network-scripts/ifup
    
  • Be aware that you'll get a warning on deprecation:

    Raw

    # ifup ens3
    WARN      : [ifup] You are using 'ifup' script provided by 'network-scripts', which are now deprecated.
    WARN      : [ifup] 'network-scripts' will be removed in one of the next major releases of RHEL.
    WARN      : [ifup] It is advised to switch to 'NetworkManager' instead - it provides 'ifup/ifdown' scripts as well.
    
  • If you are annoyed by this warning, you can disable them at your own risk:

    Raw

    # touch /etc/sysconfig/disable-deprecation-warnings
    
  • After that, you should be able to do the same configuration as on your RHEL 7:

    • Stop and disable the NetworkManager

    Raw

    # systemctl stop NetworkManager
    # systemctl disable NetworkManager
    
    • Add the NM_CONTROLLED="no" parameter to your /etc/sysconfig/network-scripts/ifcfg-<DEV> files to ensure that NetworkManager won't handle your device, where <DEV> is your network interface card (e.g. eth0, ens3, enp2s0f0, ...).

    • Use the network.service instead of NetworkManager.service. For example:

    Raw

    # systemctl status network
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值