I have an Ubuntu 10.04 LTS server with 2 network cards, an internal IP on one card (eth1) and external IPs (aliased) on the other card (eth0). I suddenly lost connection the public interface and I rebooted the server but I still could not connect to the public IPs although I could ssh using the internal IP. I could not ping my default gateway and I tried to restart networking with /etc/init.d/networking restart and got the error "SIOCSIFFLAGS: cannot assign requested IP" and "Failed to bring up eth0". A workaround was to add
ifconfig eth 0 x.x.x.x
route -add default gw x.x.x.z
I could then connect to the public network.
My /etc/network/interfaces file is shown below:
iface eth0 inet static
address x.x.x.r
netmask z.z.z.z.0
broadcast x.x.x.z
network x.x.x.0
gateway x.x.x.a
iface eth0:1 inet static
address x.x.x.b
netmask z.z.z.192
auto eth0:1
iface eth0:2 inet static
address x.x.x.f
netmask z.z.z.z.192
auto eth0:2
The obvious thing that stands out is the auto eth0:1 that I see configured when the interface has been defined as static in the first place. Could this contradictory configuration be the issue? Any ideas will help because my network configurations will be lost on reboot.