Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a Debian 7 box that will host multiple domains. I'm trying to add a second IP, but every time I try /etc/init.d/network stop && /etc/init.d/network start, I get this error:

RTNETLINK answers: File exists
Failed to bring up eth0:0

However, the new IP still works - I can access the server in my browser just fine.

This is my interfaces file:

allow-hotplug eth0
iface eth0 inet static
        address 111.222.26.38
        netmask 255.255.255.0
        network 111.222.26.0
        broadcast 111.222.26.255
        gateway 111.222.26.1
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 1.2.3.4 1.2.3.5 1.2.3.6
        dns-search my.tld

auto eth0:0
iface eth0:0 inet static
        address 111.222.26.165
        netmask 255.255.255.0

My routing table route -n:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         111.222.26.1    0.0.0.0         UG    0      0        0 eth0
111.222.26.0    0.0.0.0         255.255.255.0   U     0      0        0 eth0

In about 100% of similar problems posted on Google, the problem fixes itself by either removing the gateway declaration from the second stanza (which I've done), or by simply calling ifdown and ifup (which doesn't behave any differently).

How do I stop that error from happening? It's not stopping anything from working, but still...

Edit

Posting my new config after making changes as suggested by @bodhi.zazen:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
allow-hotplug eth0
iface eth0 inet static
        address 111.222.26.38
        netmask 255.255.255.0
        network 111.222.26.0
        broadcast 111.222.26.255
        gateway 111.222.26.1
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 111.222.3.119 111.222.3.117 111.222.5.233
        dns-search my.tld

iface eth0 inet static
        address 111.222.26.165
        netmask 255.255.255.0

After rebooting the box, the error I get is now: ifup: interface eth0 already configured

share|improve this question
    
You really don't need the network and broadcast options for an interface anymore. 99% of the time they are simply ignored. –  Zoredache Jun 19 at 23:19
    
Also I'm not shure if auto eth0:0 is correct. Try to delete it –  c4f4t0r Jun 20 at 17:38
    
What is the problem you are having with the new configuration? –  Michael Hampton Jun 20 at 18:44
    
@MichaelHampton The same thing. The new configuration changed nothing. I'm wondering if the problem isn't the interface configuration, but some other configuration elsewhere. I'm not savvy enough to know what though. –  Pickle Jun 20 at 19:03
    
It can't be the same thing. It must be at least slightly different. Paste it again. And try rebooting if you haven't already… –  Michael Hampton Jun 20 at 19:05

1 Answer 1

You are using older (legacy) syntax.

The new syntax is much simpler:

auto eth0

allow-hotplug eth0

iface eth0 inet static
    address 111.222.26.38
    netmask 255.255.255.0
    network 111.222.26.0
    broadcast 111.222.26.255
    gateway 111.222.26.1
    # dns-* options are implemented by the resolvconf package, if installed
    dns-nameservers 1.2.3.4 1.2.3.5 1.2.3.6
    dns-search my.tld

iface eth0 inet static
    address 111.222.26.165
    netmask 255.255.255.0

See - https://wiki.debian.org/NetworkConfiguration#iproute2_method

Also, the error "RTNETLINK answers: File exists ..." error is non-specific.

Other solutions :

Edit /etc/udev/rules.d/70-persistent-net.rules and delete the entry referring to eth0

See http://superuser.com/questions/618390/rtnetlink-answers-file-exists-maybe-because-assigned-a-new-mac-adress for details.

See also http://www.linuxquestions.org/questions/linux-networking-3/rtnetlink-answers-file-exists-error-when-doing-ifup-on-alias-eth1-1-on-rhel5-710766/

share|improve this answer
    
The only difference is changing the second name from eth0:0 to eth0? I've done that and I'm still getting the same result. –  Pickle Jun 20 at 16:09
    
Post your updated config file and the exact error message. It should no longer read 0:0 ... –  bodhi.zazen Jun 20 at 17:02
    
See also superuser.com/questions/618390/… –  bodhi.zazen Jun 20 at 17:05
    
post updated with new config file. I saw that linked post, but I don't have a 70-persisten-net.rules file. –  Pickle Jun 20 at 18:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.