3

I remember that in Windows XP, when DHCP client did not receive an IPv4 address from DHCP server, the host assigned itself an IPv4 link-local address from 169.254.0.0/16. However, I have never seen the Linux host behave the same way. Does this depend on DHCP client implementation? I use ISC dhclient version 4.1. Or when does Linux use IPv4 link-local addresses?

1
1

(I am sorry, but I can't comment yet - so here it goes):

I think you need the "leases" option configured in your dhclient for such occasions.

See: dhclient(8)

Old leases are kept around in case the DHCP server is unavailable when dhclient is first invoked (generally during the initial system boot process). In that event, old leases from the dhclient.leases file which have not yet expired are tested, and if they are determined to be valid, they are used until either they expire or the DHCP server becomes available.

A mobile host which may sometimes need to access a network on which no DHCP server exists may be preloaded with a lease for a fixed address on that network. When all attempts to contact a DHCP server have failed, dhclient will try to validate the static lease, and if it succeeds, will use that lease until it is restarted.

0

You could fake this feature using a static lease in dhcp.conf but it will not behave properly if another system already uses that ip address. Normally when selecting a link local address the host will run tests to validate that no one is already using the address and if a conflict is detected it will attempt to select another address until it finds one that is available.

You will need to look into the avahi-autoipd package if you want to implement this feature under linux. It is not part of the dhcp client.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.