CentOS 7.5 (1804) And NetworkManager

Home » CentOS » CentOS 7.5 (1804) And NetworkManager
CentOS 8 Comments

Hi,

I’m running CentOS on all kinds of setups: servers, workstations, desktops and laptops.

Up until now, I’m only using NetworkManager on laptops, since it makes sense to use it there. On servers and desktop clients, I usually remove it and configure the network “traditionally” by simply editing
/etc/sysconfig/network-scripts/ifcfg-whatever, /etc/resolv.conf,
/etc/hosts, /etc/hostname and /etc/sysconfig/network. Running NetworkManager on anything else than a laptop has never made any sense to me, since it’s basically an extra layer of abstraction.

With the latest update, the removal of NetworkManager on a desktop client isn’t possible anymore, since ‘yum remove NetworkManager’ also tries to remove ‘gdm’, and disabling it on startup spews back all sorts of errors.

If you folks at Red Hat are reading this, I have one question: WHY ?

Niki Kovacs

Microlinux – Solutions informatiques durables
7, place de l’église – 30730 Montpezat Site : https://www.microlinux.fr Blog : https://blog.microlinux.fr Mail : info@microlinux.fr Tél. : 04 66 63 10 32

8 thoughts on - CentOS 7.5 (1804) And NetworkManager

  • Disclosure:
    I’m not a folk at Red Hat ;-)

    In CentOS / Fedora I simply disable NetworkManager service and put into ifcfg-xxx (eg ifcfg-eth0) the line

    NM_CONTROLLED=no

    The network service is enabled by default, so this should be sufficient to keep NetworkManager installed but not inerfering with your classic network configuration.

    On a just updated c7test vm

    [root@c7test ~]# uptime
    13:19:51 up 2 min, 1 user, load average: 0.10, 0.15, 0.07
    [root@c7test ~]#

    [root@c7test ~]# cat /etc/CentOS-release CentOS Linux release 7.5.1804 (Core)
    [root@c7test ~]#

    [root@c7test ~]# systemctl status NetworkManager
    ● NetworkManager.service – Network Manager
    Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service;
    disabled; vendor preset: enabled)
    Active: inactive (dead)
    Docs: man:NetworkManager(8)

    [root@c7test ~]# systemctl status network -l
    ● network.service – LSB: Bring up/down networking
    Loaded: loaded (/etc/rc.d/init.d/network; bad; vendor preset: disabled)
    Active: active (exited) since Tue 2018-05-15 13:17:27 CEST; 15s ago
    Docs: man:systemd-sysv-generator(8)
    Process: 700 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=0/SUCCESS)

    May 15 13:17:21 c7test.mydomain systemd[1]: Starting LSB: Bring up/down networking… May 15 13:17:23 c7test.mydomain network[700]: Bringing up loopback interface: [ OK ]
    May 15 13:17:27 c7test.mydomain NET[1001]:
    /etc/sysconfig/network-scripts/ifup-post : updated /etc/resolv.conf May 15 13:17:27 c7test.mydomain network[700]: Bringing up interface eth0:
    [ OK ]
    May 15 13:17:27 c7test.mydomain systemd[1]: Started LSB: Bring up/down networking.

    [root@c7test ~]# ip a
    1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
    valid_lft forever preferred_lft forever
    2: eth0: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:1a:4a:16:01:00 brd ff:ff:ff:ff:ff:ff
    inet 10.4.4.33/24 brd 10.4.4.255 scope global eth0
    valid_lft forever preferred_lft forever
    inet6 fe80::21a:4aff:fe16:100/64 scope link
    valid_lft forever preferred_lft forever
    [root@c7test ~]#

    HOIH, Gianluca

  • The latest RHEL releases are getting rebased with newer Gnome and other components. Those are more interlinked with NetworkManager and other helper tools to work towards a less bag of potatoes and other junk approach.

    This isn’t to say this is the right thing. It is just a statement of why things are and where they seem to be going.


    Stephen J Smoogen.

  • On a server, who cares if you remove GDM, you aren’t running X
    anyway. If you are, it’s a workstation really, and the following applies.

    On a Workstation, it’s part of the GNOME environment. I’m not surprised it is required if you want GNOME. If you don’t want NM, I
    suggest using something other than GNOME (which requires gdm on workstations, otherwise you don’t get a screen lock). Workstations need the ability to manage things like VPNs and ephemeral network devices like bluetooth, so you’ll need a GUI interface, which talks with NetworkManager.

    However, I’ve always used NM on servers in C7. The old ‘network’
    service tries once to set up the network when the system boots, and doesn’t handle network outages well at all. With NM, it can detect media coming up and restore networking. It can be set up with dispatchers to run commands when the network goes up and down (fix the clock and restart remote syslog, for example).

    A lot of these are also the case for Workstations (maybe even more so). You need something to be able to handle a changing network environment during the daily utilization of a system.

    NM in CentOS 7 is a different beast than it was in C6. If you were burned by NM in C6, give it a try in C7, you might find it acceptable.

  • Le 15/05/2018 à 17:01, Jonathan Billings a écrit :

    On servers, I always install all NetworkManager-related packages.

    My question was about my workstation with KDE/GDM. Here’s how I did things until now, and apparently I can’t do that anymore:

    https://blog.microlinux.fr/poste-de-travail-CentOS-7/#reseau-pc

    Niki


    Microlinux – Solutions informatiques durables
    7, place de l’église – 30730 Montpezat Site : https://www.microlinux.fr Blog : https://blog.microlinux.fr Mail : info@microlinux.fr Tél. : 04 66 63 10 32

  • Gnome’s control-center now requires NetworkManager-wifi. But it’s only a soft requirement, no shared libs involved.

    To keep your workstation NM-free, you want to install a dummy package that provides NetworkManager-wifi but actually contains nothing, ideally before updating to 7.5. Here’s a script to create such a dummy:
    https://github.com/larsks/fakeprovide

    If you do this, control-center shows a sad face and some text (Oops, blah, blah, …) in the WiFi tab. Just the same you always got in the network tab without NM. That’s all.

    -M.

  • Note that the ‘network’ service is considered legacy and gets just basic fixes.

    It’s not been recommended to disable NetworkManager for years at this point.

    Unless you have a really tricky setup with openvswitch or something like that it’s a bad idea to disable NetworkManager at this point in time.

    As yourself why you are doing it, and what you are really hoping to gain.

    Have a read of this to get a better grasp on NM:
    https://www.hogarthuk.com/?q=node/18

  • Le 16/05/2018 à 13:55, James Hogarth a écrit :

    I’ve been a Slackware user for years before definitely moving to CentOS
    in April 2017. Those Slackware years have conveyed a deep sense of the KISS (Keep It Simple Stupid) principle. I just remove stuff I have no use for, for a variety of reasons.

    For example, I usually remove firewalld on a fresh installation, since I
    prefer a good old iptables script.

    But then, I’ll just go with the flow and adapt, and if Red Hat decides I
    have to use NetworkManager to configure a DHCP desktop client, so be it.

    Niki


    Microlinux – Solutions informatiques durables
    7, place de l’église – 30730 Montpezat Site : https://www.microlinux.fr Blog : https://blog.microlinux.fr Mail : info@microlinux.fr Tél. : 04 66 63 10 32

  • Le 15/05/2018 à 13:19, Gianluca Cecchi a écrit :

    OK, I played around with this quite a bit. Here’s my findings.

    1. On my KDE workstation, NetworkManager cannot be removed, because this would also remove GDM.

    2. NetworkManager can be disabled though. On the other hand, I get a big fat warning on startup for “NetworkManager dependency not met”.

    3. For now, the KISS approach seems to be to just leave NetworkManager installed and running, and to configure network-scripts/ifcfg-enp0s3
    like this:

    DEVICE=enp0s3
    TYPE=Ethernet
    ONBOOT=yes
    BOOTPROTO=dhcp
    NM_CONTROLLED=no

    Cheers & thanks for your numerous suggestions.

    Niki


    Microlinux – Solutions informatiques durables
    7, place de l’église – 30730 Montpezat Site : https://www.microlinux.fr Blog : https://blog.microlinux.fr Mail : info@microlinux.fr Tél. : 04 66 63 10 32