Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a fresh install of RHEL6 and I am unable to find any config file to do advanced configuration for dhclient. I am trying to find something like dhclient.conf on Ubuntu so I can modify options like supersede domains, fqdn, Maybe they should be on "/etc/sysconfig/networking/devices/ifcfg-eth0" in that case what are the settings that matches those dhclient.conf configurations?

share|improve this question

4 Answers 4

up vote 4 down vote accepted

The configuration file is one of /etc/dhcp/dhclient-${DEVICE}.conf, /etc/dhclient-${DEVICE}.conf, or /etc/dhcp/dhclient.conf in that order. The first one that exists is used.

From /etc/sysconfig/network-scripts/ifup-eth (Fedora 14; RHEL6 may be similar):

# allow users to use generic '/etc/dhcp/dhclient.conf' (as documented in manpage!)
# if per-device file doesn't exist or is empty
if [ -s /etc/dhcp/dhclient-${DEVICE}.conf ]; then
   DHCLIENTCONF="-cf /etc/dhcp/dhclient-${DEVICE}.conf";
elif [ -s /etc/dhclient-${DEVICE}.conf ]; then
   DHCLIENTCONF="-cf /etc/dhclient-${DEVICE}.conf";
else
   DHCLIENTCONF='';
fi;

From the dhclient man page:

   -cf <config-file>
          Path to the client configuration file.  If unspecified, the default /etc/dhcp/dhclient.conf is used.
share|improve this answer
    
Probably the correct answer but I am unable to test it now, but for sure those files aren't created by default. I will check when able and accept it. –  frisco Feb 8 '11 at 10:35
    
Thanks, this answer helped me answer "How can I add additional search domains to the resolv.conf created by dhclient in CentOS": superuser.com/questions/110808/… –  Philip Durbin Jan 4 '12 at 15:12

/etc/sysconfig/networking/devices/ifcfg-eth0 is just for basic setup, for the options you want go ahead and install the dhclient with running # yum install dhclient in your shell.

share|improve this answer
    
It was already installed by default and there is no sign of dhclient.conf –  frisco Feb 4 '11 at 10:53
    
isn't it in the /etc/dhcp/ folder? –  addam Feb 4 '11 at 15:40
    
@frisco You might have just an older version (I'd guess <4) which doesn't create the config file by default, but it will most likely look for it at /etc/dhclient.conf –  Radek Simko Jan 14 at 22:19

Actually you can do a bunch of those things in /etc/sysconfig/network-scripts/ifcfg-eth? -- for Red Hat 5 family, you can find documentation here: http://www.linuxtopia.org/online_books/centos_linux_guides/centos_linux_reference_guide/s1-networkscripts-interfaces.html

I would presume that much, if not all, of that functionality would still work in RH 6.

share|improve this answer

A few things...

1) NetworkManager dynamically creates the dhclient.conf file for IPv4. It runs dhclient for IPv6 using the dhclient defaults since no configuration file is specified and just specifies the interface device (e.g., eth0). You can check this by doing a "ps aux | grep dhclient". I tried providing the options I wanted in the "correct location" only to find that NetworkManager overwrites the file each time it runs.

2) You can use one of the default locations for the config file to provide whatever options you want to dhclient for IPv6. At least it seems to be working for me.

3) Don't be afraid to edit ifcfg-ethX instead of relying on the GUI network configurator. There are some combinations of options that the configurator doesn't allow that should be legal and may be useful.

Cheers, Dave

share|improve this answer

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.