ifup fails on boot if initramfs already configured the device
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ifupdown (Ubuntu) |
Triaged
|
Low
|
Unassigned |
Bug Description
I have a server with a static IP, so I put the following into /etc/network/
auto eth0
iface eth0 inet static
address 192.168.63.152
network 192.168.63.0
netmask 255.255.255.0
broadcast 192.168.63.255
gateway 192.168.63.1
However, if the initramfs brought up that interface, then ifup fails to bring it up (again). The error message was something like "NETLINK: address already exists" if I ran "ifup eth0" after the system had booted at least.
For the record, I have the following in /etc/initramfs-
DEVICE=eth0
IP=192.
... although I did try commenting out those two lines and rebuilding the initramfs and it made no difference; I assume because eth0 was still brought up, just with DHCP rather than a static IP.
This is a problem if I have a cryptoroot, and I've configured the initramfs to bring up the network along with dropbear, so I can ssh in and unlock the cryptoroot. In this case, after the root is unlocked, mounted, and the "real" boot starts, ifup fails, and hence the static-network-up upstart event is never emitted, and hence /etc/init/
A hacky workaround is to edit e.g. /usr/share/
ifconfig eth0 0.0.0.0 down
Then, the system boots quickly.
It's always a problem when mixing different tools doing pretty much the same job.
ifupdown always assumes it's the only tool messing with network interfaces and so will fail if any conflicting configuration is found.