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.
sudo /etc/init.d/networking restart
 * Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces
 * Reconfiguring network interfaces...                                                                                                                                  ssh stop/waiting
ssh start/running, process 20418
RTNETLINK answers: File exists
Failed to bring up eth0:0.
RTNETLINK answers: File exists
Failed to bring up eth0:1.
RTNETLINK answers: File exists
Failed to bring up eth0:2.

I am not able to access my network from outside. But locally there is no problem accessing it. I am able to ping the ip address that I am using to access remotely.

Here is my etc/network/interfaces

auto eth0
iface eth0 inet static
      address 192.168.1.200
      netmask 255.255.255.0
      network 192.168.1.0
      broadcast 192.168.1.255
      gateway 192.168.1.1

auto eth0:0
iface eth0:0 inet static
      address 192.168.2.200
      netmask 255.255.255.0
      network 192.168.2.0
      broadcast 192.168.2.255
      gateway 192.168.2.1

auto eth0:1
iface eth0:1 inet static
      address 192.168.3.200
      netmask 255.255.255.0
      network 192.168.3.0
      broadcast 192.168.3.255
      gateway 192.168.3.1


auto eth0:2
iface eth0:2 inet static
      address 192.168.4.200
      netmask 255.255.255.0
      network 192.168.4.0
      broadcast 192.168.4.255
      gateway 192.168.4.1
share|improve this question
    
Show us your /etc/network/interfaces? Obviously something is broken in it. But we can make suggestions without seeing the file. My guess is have done something silly like try to define multiple default gateways. IE you are doing something wrong. –  Zoredache Sep 18 '13 at 6:59
    
Updated the question –  Venky Sep 18 '13 at 7:16
    
You can't just add multiple default gateways like that. You should only have one default gateway. –  Zoredache Sep 18 '13 at 7:18

1 Answer 1

up vote 2 down vote accepted

net-tools is evil and cryptic (I have been saying that a lot lately). It is also ancient, and its obsolete naming conventions have confused you.

The "subinterface" 0 (they're not really subinterfaces) is an alias for the root interface, so when you set the interface for eth0:0, it conflicts with the settings for eth0. This is not the cause of your error but it will bring you pain later as it silently replaces 192.168.1.200/24 with 192.168.2.200/24.

I suspect the error you are seeing is happening when the autoconfig script attempts to add multiple default routes that differ only in gateway. You do not need all these default routes. However, if you were wanting them, you would need to somehow specify (at least) a metric, which you can't using this file. A route on dev eth0 will be added for each of your subnets automatically; you only need one default route to send other traffic through. One reason the routes are identical is that they are all associated with eth0 because the subinterfaces are not really subinterfaces.

share|improve this answer
    
So what am I supposed to do now?? –  Venky Sep 18 '13 at 8:04
    
Specify the gateway directive in only one block (it's optional), and increment each of the subinterface numbers (count from 1). –  Falcon Momot Sep 18 '13 at 8:37

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.