proper behaviour on being refused a dhcp lease

Denys Vlasenko vda.linux at googlemail.com
Sat Dec 4 18:44:43 UTC 2010


On Friday 03 December 2010 16:56, David Collier wrote:
> If I run a dhcp client, and the server is absent, or refuses, or refuses
> to renew, a lease, what should I do with the interface?
> 
> I assume that it is very bad form to allow any Ethernet traffic onto the
> network with no dhcp assigned address.... but I'm not sure what to do to
> avoid it.

It depends on the network. Sometimes you'd want to acquire
and use zeroconf address.


> I'd like to use the -try-again parameter on the udhcpc app to get dhcp to
> keep trying periodically
> 
> Are any of these approaches right?
>   remove all reference to the adapter from the routing tables?  

Yes, and remove all addresses from it.


>   run ifdown?
>   set a conventionally ignorable IP address?
> 
> I assume that if I do ifdown, then I won't be able to try dhcp again in a
> few minutes, as the "if" will be "down", and I won't get any warning from
> udhcpc when it wants it "up" to make the request?
> 
> I saw some code which did something like ifconfig 0.0.0.0
> 
> Any suggestions welcome - is this covered in an RFC that I might
> understand?

This is what I think about network configuration:

http://www.busybox.net/~vda/no_ifup.txt

And here are the examples how it can be done with runsv:

busybox/examples/var_service/dhcp_if/run

busybox/examples/var_service/fw/run

-- 
vda


More information about the busybox mailing list