Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to configure a network interface to make use of DHCP if a DHCP server is present on the network during boot, but otherwise default to some default static IP address.

share|improve this question

You need to look into more complex dhclient.conf files. From the man page:

The DHCP client may decide after some period of time (see PROTOCOL TIMING) that it is not going to succeed in contacting a server. At that time, it consults its own database of old leases and tests each one that has not yet timed out by pinging the listed router for that lease to see if that lease could work. It is possible to define one or more fixed leases in the client configuration file for networks where there is no DHCP or BOOTP service, so that the client can still automatically configure its address. This is done with the lease statement.

share|improve this answer

Normal configuration should set an address in the zero-conf IP address range if a DHCP server is not found. It may not be exactly static but will be in the address range. This is a local network, but attached devices may be able to proxy access to other networks. With the avahi-discover module you may be able to find usable services. This can include web proxies, printers, and other services.

For more information see http://en.wikipedia.org/wiki/Zero_configuration_networking

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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