4

I'm running a Debian GNU/Linux 8 server for school assignments.

While trying to do service networking restart, it gave me this error:

root@server:~# service networking restart
[warn] Running /etc/init.d/networking restart is deprecated because it may not re-enable some interfaces ... (warning).
[....] Reconfiguring network interfaces...RTNETLINK answers: File exists
Failed to bring up eth0.
done.

Here is the /etc/network/interfaces file:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
        address 193.191.187.47
        netmask 255.255.255.128
        gateway 193.191.187.62
        post-up arp -f /etc/ethers

iface eth0 inet6 static
        address 2001:6a8:2880:a077::47
        netmask 64
        gateway 2001:6a8:2880:a077::1

I haven't changed anything about this config lately. I've been working on my postfix SMTP assignment and opening some ipv6 ports with ip6tables. Can any of this cause the problem?

Cheers

migrated from serverfault.com Dec 23 '15 at 16:33

This question came from our site for system and network administrators.

5

RTNETLINK answers: File exists is a confusing error that occurs when you try to add an IP address to an interface that already has that same IP address. It's not exactly a "file" that exists, but the IP.

As the script mentioned, it is deprecated. What is happening is that it is not bringing the interfaces down properly and not removing the existing IPs from them. You should be restarting interfaces by another method.

The current method in Debian is to use ifdown and ifup to stop and start individual interfaces. For example:

ifdown eth0; ifup eth0

Note that (unlike the other answer) we always try to bring the interface back up with ifup, even if ifdown reports a failure. You don't want to get locked out of remote access to the system simply because something went wrong, if you can avoid it (though it's not always avoidable).

  • Thanks. Here is the output from your command. I can't wrap my head around it root@dennis:~# ifdown eth0; ifup eth0 ifdown: interface eth0 not configured RTNETLINK answers: File exists Failed to bring up eth0. – user3581369 Dec 14 '15 at 11:24
  • 2
    use ifdown --force eth0 as the failure while bringing the interface up means that ifdown doesn't bother bringing the interface down as it doesn't believe it's up. – wurtel Dec 14 '15 at 13:16
3

As the warning states this method of reloading network configs is deprecated. Instead you should do it at the network adapter level:

ifdown eth0 && ifup eth0

This will disable the network adapter and, if disabling succeeded, bring it back up with the new config.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy