I know how to request that a machine to acquire a new IP address, however I've got a slightly different scenario.
I have configured a box locally on my network which has DHCP. Therefore, it acquired an IP address. I want to ship it to somebody on a different network which also has DHCP. Ideally, they would plug in their Ethernet cable before starting up their machine; in reality, they will just plug in cables as fast as they can.
The problem I've seen: they plug in the power first, and then the Ethernet. The machine doesn't automatically acquire an IP address using the new DHCP server unless we have them restart the box (or, if we had them log in, by restarting networking or forcing DHCP to release/renew).
Is there a way to configure an Ubuntu server (10.04 LTS) to automatically try to release/renew any time that an Ethernet cable is connected?
It looks like one common way to handle this is to add a udev rules file. I believe this gets installed by some package on a desktop system, but I cannot find it on any of my Ubuntu or Debian servers.
Here is a blog that seems to have some details.
The blog suggests adding a udev rules like this.
/etc/udev/rules.d/85-ifupdown.rules
If you look at the ifup command being used you will notice that it only applies to hotplug interfaces. So be sure to use
allow-hotplug
instead ofauto
in your network interfaces file.