Are you using Network-Manager in no-GUI CentOS 7 Server?

General support questions
Post Reply

Will you disable Network-Manager in your headless CentOS 7 servers?

Yes, I like old school and I am confident it is safe to do.
14
67%
No, I prefer to go with the defaults.
3
14%
I always install the graphical tools, no problem for me.
2
10%
I don't know.
2
10%
 
Total votes: 21

User avatar
InitOrNot
Posts: 109
Joined: 2015/06/10 18:26:51

Are you using Network-Manager in no-GUI CentOS 7 Server?

Post by InitOrNot » 2015/08/30 01:51:40

In servers to which when deployed I only connect through SSH (and frequently through week and meager Internet links), I usually don't install the graphical environment (Gnome, KDE, nor plain X-Window).

Now with CentOS 7, by default the networking subsystem is managed by Network-Manager. Network-Manager is primarily a GUI application, and although it has a command line counterpart to it, such CLI tool does not yet have feature parity with the GUI version of Network-Manager. This worries me somewhat... will suddenly some problem appear in production which can only be solved through the GUI tool of Network-Manager? Is it safe in my non-GUI servers to remove Network-Manager and set up networking the old school way?

So poll time! Lets see what people think about the proper course of action regarding Network-Manger on headless CentOS 7 servers!

scottro
Forum Moderator
Posts: 2392
Joined: 2007/09/03 21:18:09
Location: NYC
Contact:

Re: Are you using Network-Manager in no-GUI CentOS 7 Server?

Post by scottro » 2015/08/30 02:00:27

As Fedora's NetworkManager has, judging from their forums, frequently been the cause of problems, and as I can still easily remove it and have my network work properly, it's one of the things I do upon first boot (of both Fedora and CentOS.)


It seems that it still has issues with various non-standard setups, though as I do remove it, that's more hearsay on my part.
New users should check the FAQ and Read Me First pages

User avatar
InitOrNot
Posts: 109
Joined: 2015/06/10 18:26:51

Re: Are you using Network-Manager in no-GUI CentOS 7 Server?

Post by InitOrNot » 2015/08/30 12:48:42

scottro wrote:As Fedora's NetworkManager has, judging from their forums, frequently been the cause of problems, and as I can still easily remove it and have my network work properly, it's one of the things I do upon first boot (of both Fedora and CentOS.)
But do you disable Network-Manager also when the server is set up to run with a graphical interface?

MartinR
Posts: 348
Joined: 2015/05/11 07:53:27
Location: UK

Re: Are you using Network-Manager in no-GUI CentOS 7 Server?

Post by MartinR » 2015/08/30 13:30:34

Personally I turn off NetworkManager on all my machines. They are relatively fixed servers and compute nodes which need to be reliably on the network in documented places. It is trivial just to print off the ifcfg-XX files and keep them with the cable schedules and copies of the DNS files. As has been well rehearsed elsewhere; NM is designed for personal machines, particularly mobile ones.

scottro
Forum Moderator
Posts: 2392
Joined: 2007/09/03 21:18:09
Location: NYC
Contact:

Re: Are you using Network-Manager in no-GUI CentOS 7 Server?

Post by scottro » 2015/08/30 15:16:37

Sorry, I wasn't clear. Yes, I remove NetworkManager regardless of what I'm running. As for GUIs, I tend to use either dwm from a custom install or openbox. On servers, I tend to not install GUIs, but at home, I have a desktop-cum-pseudo-server with NetworkManager removed that runs CentOS-6.

At my former job, I had a Fedora workstation, and as mentioned, I would remove NetworkManager upon first login.
New users should check the FAQ and Read Me First pages

User avatar
InitOrNot
Posts: 109
Joined: 2015/06/10 18:26:51

Re: Are you using Network-Manager in no-GUI CentOS 7 Server?

Post by InitOrNot » 2015/08/31 21:27:52

scottro wrote:Sorry, I wasn't clear. Yes, I remove NetworkManager regardless of what I'm running.
Thanks for the info. You encouraged me to try removing NetworkManager from my testing CentOS 7 server. It all went well and was painless.

Just in case it may be helpful to anyone else, this is what I did:
  1. Run this command, and take note of your network card name in Linux, and also of your network card MAC address ("HWaddr"):

    Code: Select all

    $ ifconfig
    eth0      Link encap:Ethernet  HWaddr 00:0C:29:56:FF:FF
              UP BROADCAST MULTICAST  MTU:1500  Metric:1
    In the example above, the network card name is "eth0", but be advised that in CentOS 7 that name can be different from traditional Linux names for the network card; and the MAC address is "00:0C:29:56:FF:FF".
    • Note: if you get the error message "command not found" when running ifconfig, then you need to install the package "net-tools", like this:

      Code: Select all

      # yum install net-tools
  2. Run these commands to stop and disable the NetworkManager service:

    Code: Select all

    # systemctl disable NetworkManager.service
    # systemctl stop NetworkManager.service
  3. Edit the file "/etc/sysconfig/network-scripts/ifcfg-XXXXX" (where XXXXX is your network card name in Linux, which you noted in step 1) so that it looks like this:
    • If you are on a IPv4 DHCP setup:

      Code: Select all

      NM_CONTROLLED=no
      ONBOOT=yes
      PERSISTENT_DHCLIENT=1
      TYPE=Ethernet
      BOOTPROTO=dhcp
      DEFROUTE=yes
      #IPV4_FAILURE_FATAL=no
      IPV4_FAILURE_FATAL=yes
      IPV6INIT=no
      IPV6_AUTOCONF=yes
      IPV6_DEFROUTE=yes
      IPV6_PEERDNS=yes
      IPV6_PEERROUTES=yes
      IPV6_FAILURE_FATAL=no
      # Make sure here XXXXX is your NIC name in Linux, e.g. eth0  <=====================
      NAME=XXXXX
      # Comment out UUID, as only NetworkManager uses it. <=====================
      #### UUID=6fe7887d-db7a-40ac-BLABLABLABLABLABLABLABLABLA
      # Make sure this is your network card MAC address, noted instep 1 above. <===
      HWADDR=00:0C:29:56:FF:FF
      PEERDNS=yes
      PEERROUTES=yes
    • If you are on a IPv4 static IP setup (replace IPADDR= and NETMASK= with proper values for you):

      Code: Select all

      NM_CONTROLLED=no
      ONBOOT=yes
      TYPE=Ethernet
      #PERSISTENT_DHCLIENT=1
      #BOOTPROTO=dhcp
      BOOTPROTO=static
      DEFROUTE=yes
      #IPV4_FAILURE_FATAL=no
      IPV4_FAILURE_FATAL=yes
      IPV6INIT=no
      IPV6_AUTOCONF=yes
      IPV6_DEFROUTE=yes
      IPV6_PEERDNS=yes
      IPV6_PEERROUTES=yes
      IPV6_FAILURE_FATAL=no
      # Make sure here XXXXX is your NIC name in Linux, e.g. eth0  <=====================
      NAME=XXXXX
      # Comment out UUID, as only NetworkManager uses it. <=====================
      #### UUID=6fe7887d-db7a-40ac-BLABLABLABLABLABLABLABLABLA
      # Make sure this is your network card MAC address, which you noted instep 1 above. <===
      HWADDR=00:0C:29:56:FF:FF
      #PEERDNS=yes
      #PEERROUTES=yes
      IPADDR=172.16.225.150
      NETMASK=255.255.255.0
  4. Edit the file "/etc/sysconfig/network" so that it look like this:
    • If you are on a IPv4 DHCP setup --> leave the file empty.
    • If you are on a IPv4 static IP setup (replace these four settings with proper values for you --if you only have one DNS server, you can omit DNS2=):

      Code: Select all

      GATEWAY=172.16.225.2
      DNS1=172.16.225.2
      DNS2=172.16.225.3
      SEARCH="acme-industries.com"
  5. Run this command to restart the "legacy" networking subsystem, so that the changes you just made take effect:

    Code: Select all

    # service network restart
  6. Check that the "network" service is configured to autostart on boot:

    Code: Select all

    # chkconfig --list network
    	network			0:off	1:off	2:on	3:on	4:on	5:on	6:off
    If it is not like above, run this command to enable the "network" service on boot:

    Code: Select all

    # chkconfig network on
  7. End of procedure. Check that your network access is working fine, it should be.
  8. Not strictly needed, but just to make sure it all survives a reboot, now reboot the system and then check that networking is still up and operating fine.

    Code: Select all

    # reboot

klas9
Posts: 1
Joined: 2016/06/26 03:39:32

Re: Are you using Network-Manager in no-GUI CentOS 7 Server?

Post by klas9 » 2016/06/26 03:42:54

Thanks @InitOrNot. It was a great time saver.

hunter86_bg
Posts: 1447
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: Are you using Network-Manager in no-GUI CentOS 7 Server?

Post by hunter86_bg » 2016/07/11 20:36:27

You should consider replacing

Code: Select all

systemctl disable NetworkManager.service
with

Code: Select all

systemctl mask NetworkManager.service

forumitu
Posts: 115
Joined: 2014/02/20 14:30:51

Re: Are you using Network-Manager in no-GUI CentOS 7 Server?

Post by forumitu » 2016/07/12 06:24:33

I went so far that I put

Code: Select all

-NetworkManager
-NetworkManager-team
-NetworkManager-tui
-NetworkManager-libnm
into the %packages section of my installation kickstart file.

Post Reply