Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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've setup a DHCP server on one of my centos boxes, and I have several computers that are going to connect (also centos) and hopefully make use of the DHCP. On start-up I'd like to check whether a DHCP server is available, or if the computer will have to fall back onto a static IP.

My first idea is to modify the file under /etc/sysconfig/network via a script that would run on there an easier way to do this though? I would have hoped somewhere in the DHCP config there would be a way to specify a fallback point in the event no DHCP server is found. Thanks!

share|improve this question
up vote 3 down vote accepted

You can add a fixed "lease" definition to the DHCP client configuration, as discussed here:

The basic form is:

lease {
  interface "eth0";
  option subnet-mask;
  option routers;
  option domain-name-servers;
  renew 2 2015/1/12 00:00:01;
  rebind 2 2015/1/12 00:00:01;
  expire 2 2015/1/12 00:00:01;

Add that to your dhclient.conf file and you should get the behaviour you want.

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.