Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
add comment

2 Answers 2

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
add comment

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 169.254.0.0/16 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
add comment

Your Answer

 
discard

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.