Ubuntu 12.04 LTS server – Failed to bring up

ubuntu-12.04

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

Best Answer

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.