27

I Can't start CentOS 7 "network" service after disabling and removing "NetworkManager" service. When I check the network service status, it comes up with the following error:

#systemctl status network.service
network.service - LSB: Bring up/down networking
   Loaded: loaded (/etc/rc.d/init.d/network)
   Active: failed (Result: exit-code) since Fri 2015-01-16 22:30:46 GMT; 38s ago
  Process: 4857 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE)

Jan 16 22:30:46 localhost.localdomain network[4857]: RTNETLINK answers: File exists
Jan 16 22:30:46 localhost.localdomain network[4857]: RTNETLINK answers: File exists
Jan 16 22:30:46 localhost.localdomain network[4857]: RTNETLINK answers: File exists
Jan 16 22:30:46 localhost.localdomain network[4857]: RTNETLINK answers: File exists
Jan 16 22:30:46 localhost.localdomain network[4857]: RTNETLINK answers: File exists
Jan 16 22:30:46 localhost.localdomain network[4857]: RTNETLINK answers: File exists
Jan 16 22:30:46 localhost.localdomain network[4857]: RTNETLINK answers: File exists
Jan 16 22:30:46 localhost.localdomain systemd[1]: network.service: control process exited, code=exited status=1
Jan 16 22:30:46 localhost.localdomain systemd[1]: Failed to start LSB: Bring up/down networking.
Jan 16 22:30:46 localhost.localdomain systemd[1]: Unit network.service entered failed state.

In earlier CenOS it didn't seem to give any problems when switching from the "NetworkManager" service to the network service. Any ideas as to what causes the problem and how to fix it?

Note: I used yum erase to remove network manage service.

Here is additional info as asked:

/etc/sysconfig/network-script/ifcfg-enp8s0
TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME=enp8s0
UUID=453a07fe-1b07-4f29-bc32-f2168e50706a
ONBOOT=yes
HWADDR=XXXXXXXXXXX
MACADDR=XXXXXXXXXX
PEERDNS=yes
PEERROUTES=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes

/etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

/etc/resolv.conf
; generated by /usr/sbin/dhclient-script
search customer.marples.midcity.lan
nameserver 10.241.128.1
12
  • Since I cannot post a comment because of my low reputation, I'm posting this as an answer, which it is NOT intended to be. <br/> <br/> Can you post the following: <br/> <br/> /etc/sysconfig/network-script/ifcfg-eth0<br/> /etc/hosts<br/> /etc/resolv.conf<br/> <br/> You might want to check your configured routes for that specific NIC (found in /etc/sysconfig/network-scripts/route-<interface>), since this might cause similar errors. <br/> <br/> Did you try ifdown eth0 and ifup eth0 instead of systemctl (re)start network? Did you disable/uninstall Network Manager using yum remove Jan 16, 2015 at 23:49
  • Hi, thanks for resupplying. I've updated my question info above, have a look. Yes I did used yum erase to remove the NetworkManager service. I have not tried the ifdown eth0 and ifup eth0, hoever My network connection is still up and running despite removing the networkmanager service and inability to start the network service.
    – Gazel
    Jan 17, 2015 at 0:49
  • You have HWADDR=XXXXXXXXXXX AND MACADDR=XXXXXXXXXX in your interface config. This seems to be wrong, since it looks like it's intended to be the same. Try one of the things I recommended (commenting this part in your config), restart and try again. Is this CentOS 7 box SELinux enforcing? Are you running this system on a hardware or in a virtual environment? hosts and resolv.conf look good so far. Jan 17, 2015 at 0:51
  • Originally I spoofed the MAC in the NetworkManager's GUI, so it added the fake MACADDR in addition to the real HWADDR, so that's why it's there. Should i remove the MACADDR line? The SELinux status reads enabled. Im running it on a hardware.
    – Gazel
    Jan 17, 2015 at 0:54
  • Try commenting HWADDR and/or MACADDR, tho I think taking out MACADDR should be sufficient. Restart the whole box and look if network is coming up properly. Also, if you don't use IPv6, take that crap out there. You could also check your HWADDR by using cat /sys/class/net/ens192/address to make sure it's setup properly. Jan 17, 2015 at 1:08

11 Answers 11

36

In Centos7.0 disabling NetworkManager will leave a dhcp client running configured for NetworkManager. This causes the error message RTNETLINK answers: File exists when the network service is started.

The stale dhclient process has the additional "benefit" that when the lease expires your dhclient will choke, since it cannot reach NetWorkManager, thus removing your IP address.

If you grep for it, you will see that it points to a NetWorkManager configuration file.

[root@host ~]# ps -ef | grep dhc
root      1865   792  0 Apr28 ?        00:00:00 /sbin/dhclient -d -sf \
 /usr/libexec/nm-dhcp-helper -pf /var/run/dhclient-eno1.pid -lf\
 /var/lib/NetworkManager/dhclient-c96e56d3-a4c9-4a87-85ca-93dc0ca268f2-eno1.lease\
 -cf /var/lib/NetworkManager/dhclient-eno1.conf eno1

So what you can do is kill the dhclient and only then start your network service.

2
  • Yup, killing dhclient fixed the issue for me. Thanks
    – MichaelZ
    Nov 4, 2015 at 14:41
  • 7
    I also don't have enough reputation to comment, but I wanted to support Hans's answer and add that I had to change the bootproto to "none" in my ifcfg files. The dhclient was only getting called when trying to restart networking, and killing the dhclient process didn't help, because another would spawn in it's place. Modifying the ifcfg files solved my problem.
    – onlyanegg
    Nov 25, 2015 at 0:37
9

An IP conflict will also cause this error. Try: systemctl stop network, then ifup eth0.

3

I too faced this today on a CentOS 7.2 cloned virtual machine. This is how I fixed it.

systemctl disable NetworkManager
systemctl enable network

Find MAC address of the interface through command /sbin/ifconfig -a and append that in /etc/sysconfig/network-scripts/ifcfg-<interface_name>. You can use the below commands for the first interface.

nic_file=`ls /etc/sysconfig/network-scripts/ifcfg-e*`
ifconfig -a | grep ether | awk '{ print $2 }' | sed 's/.*/HWADDR=&/' >> ${nic_file}

Then fire reboot to restart the server

2

as it has been already identified - this error pops up with any issue while setting up network: IP conflict, routing issues, etc.

Look at your gateway settings to confirm your gateways are set properly and things are what they need to be with /etc/syscofig/network and each of the /etc/sysconfig/network-scripts/ifcfg-* look for duplicate IP, routes set via /etc/sysconfig/network-scripts/route-* if memory serves me right gateways now can be set in both ifcfg-* and route-* files. So confirm there's no duplication or overlap.

2

It seems this happens also if you manually configure an interface that isn't connected to the network.

1

A failure to get an IP from DNS will also give this error as I have just found. In fact it looks like any error with networking will cause this error. This appears to be a problem with CentOS 7 in that it gives a very poor error here.

0

Look into network-scripts whether there is no other interface that could crash network.service

do an ifconfig and write down the interface. Compare with the files in network-scripts. If there are more files in network-scripts than interfaces in ifconfig, you can delete the additional useless files and then do a systemctl restart network.

0

Had this error after cloning a virtual server, the clone was given a new hardware address ( MAC ) and the network adapter config still had the old one.

The line looks like: HWADDR=00:00:00:00:00:00

0

I ran into this issue, where the server keep giving me RTNETLINK answers: File exists even after removing network manager and triple check all my network configuration.

It appears that an IP was up on another server and that the server filter ICMP (so no ping), first things I tried. So don't rely on ping for testing if an IP is up or not !

When starting, the network script issue this command (change your dev and ip)

/sbin/arping -c 2 -w 3 -D -I eth0 10.196.132.206

Which tell us that a mac address is associated with this IP and fail the network script (ifup or systemctl start network)

0

I also encountered similar problems. To modify the configuration files.(ifcfg-ensxxxx), as follows enter image description here

  • List Commented out "UUID=xxxx-xxxx"
  • Add new option: NM_CONTROLLED=no, it indicates that this interface will be set up using this configuration file, instead of being managed by Network Manager service.

Reference: How to configure a static IP address on CentOS 7

0

I also encountered similar problems. To modify the configuration files.(ifcfg-ensxxxx), as follows:

Add new option: NM_CONTROLLED=no, it indicates that this interface will be set up using this configuration file, instead of being managed by Network Manager service.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .