Unable to add eth0:0 in Ubuntu

1

I have Ubuntu 12.04.1 and am trying to configure an ethernet interface alias eth0:0.

Here is my /etc/network/interfaces:

auto lo
iface lo inet loopback
pre-up iptables-restore < /etc/iptables.up.rules

auto eth0
iface eth0 inet static
address 192.168.0.1
gateway 192.168.0.1
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255

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

If I reboot, the system starts with message: Starting with partial network configuration, and eth0 configured only.

I've tried

  • Removing pre-up iptables-restore < /etc/iptables.up.rules
  • Changing the netmask of eth0:0 to 255.255.0.0
  • Changing the gateway of eth0:0 to 192.168.0.1

"ifup" fails like this:

$ sudo ifup eth0:0
RTNETLINK answers: File exists
Failed to bring up eth0:0.

service networking restart never works (even before I added eth0:0):

$ sudo service networking restart
stop: Unknown instance: 
networking stop/waiting

Unfortunately after the commands I even don't see updates in /var/log/syslog or /var/log/dmsg.

Output of ifconfig:

eth0      Link encap:Ethernet  HWaddr 00:1e:33:71:cd:a4  
          inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:45 Base address:0x4000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:3248 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3248 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:279379 (279.3 KB)  TX bytes:279379 (279.3 KB)

wlan0     Link encap:Ethernet  HWaddr 00:11:22:33:44:55  
          inet addr:78.225.121.83  Bcast:78.225.121.255  Mask:255.255.255.0
          inet6 addr: fe80::211:22ff:fe33:4455/64 Scope:Link
          UP BROADCAST RUNNING  MTU:1500  Metric:1
          RX packets:37801 errors:0 dropped:0 overruns:0 frame:0
          TX packets:39871 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:36003811 (36.0 MB)  TX bytes:7490816 (7.4 MB)

Any ideas?

Rodnower

Posted 2012-10-05T12:20:42.770

Reputation: 1 739

can you still manually configure eth0:0? – Foon – 2012-10-07T11:59:26.747

What's the output of sudo ifconfig? – Darth Android – 2012-10-08T14:32:35.940

I added output of ifconfig :) – Rodnower – 2012-10-09T19:52:17.623

1You have a mistake in your configuration: The IP address you've assigned for eth0:0 is not within the same subnet as eth0. What exactly are you trying to do? – Michael Hampton – 2012-10-09T22:10:35.447

In reality I try to create different interfaces for different networks, because sometime I move from place to place... So what can I do? – Rodnower – 2012-10-11T14:25:10.737

Answers

1

Is the broadcast 192.168.0.255 correct for eth0:0, or should it be 192.168.1.255?

Darth Android

Posted 2012-10-05T12:20:42.770

Reputation: 35 133

Thank you for response. I tried with right broadcast, same result... – Rodnower – 2012-10-07T11:02:13.190