Solved: RTNETLINK answers: File exists during service network restart Linux: RHEL6 or CentOS 6

In RHEL 6 or CentOS 6, sometimes we do encounter a strange issue and we are not able to restart network service with below error.

RTNETLINK answers: File exists
Error adding address 192.168.52.138 for eth2.

[root@nglinux network-scripts]# service network restart
Shutting down interface eth2:                              [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth2:  Determining if ip address 192.168.52.138 is already in use for device eth2...
RTNETLINK answers: File exists
Error adding address 192.168.52.138 for eth2.                   [  OK  ]
[root@nglinux network-scripts]# 

The issue appeared because we have Network Manager service in ON state.

To resolve this issue, we need to take the interface down and then stop NetworkManager service.

1. First take eth2 interface down.
Warning: Make sure you have console or connected via another interface, otherwise you will have an outage on production server.

[root@nglinux network-scripts]# ifdown eth2

2. Now stop the network manager service.

[root@nglinux ~]# /etc/init.d/NetworkManager stop
Stopping NetworkManager daemon:                            [  OK  ]

[root@nglinux ~]# chkconfig NetworkManager off

3. Now try to restart the service.

[root@nglinux ~]# service network restart
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth2:  Determining if ip address 192.168.52.138 is already in use for device eth2...
                                                           [  OK  ]
[root@nglinux ~]# 

Thats it, now we are able to restart the service and issue is resolved.

It happens because the NetworkManager service holds the lock on routing files and this can’t be updated on network service restart until and unless this service is turned off.

I hope it would be useful in your case.

Do post your suggestions/comments below.

Leave a Reply

avatar
  Subscribe  
Notify of