generic /etc/dhclient.conf not working

Latest response

Hello
Im trying to use the generic /etc/dhclient.conf file as mention in
/etc/sysconfig/network-scripts/ifup-eth file
But the code seems incorrect because it never uses the generic file.
I do not want to generate dhcleint.conf for each device.
Am I missing something or this is a bug?

# allow users to use generic '/etc/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;

Responses

Hello Asaf,
Can you provide more details as to what is not working, or how it is broken? Also - which release/version of OS and of the dhclient package.

I have a few suspicions:
* a previous DHCP offer has cached some information
* NetworkManager is preventing you from doing what you would like to do
* SELinux might be playing a role (or simple file permissions on the file you created in /etc)

I don't use/manage DHCP (the few boxes I have fortunately just work). I am now amazed at how much is involved with the process when I looked through the scripts to try and help.

Hopefully someone can help figure this out!

im using redhat 6.4 and dhclient-4.1.1-34.P1.el6_4.1.x86_64
2.6.32-358.23.2.el6.x86_64 #1 SMP Sat Sep 14 05:32:37 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux
SELinux is disabled.

I’m configuring user-class in the dhclient.conf file
I need to configure user-class for any network device that will exist in my machine.
I want to make this configuration for all network device and NOT per device.

allow users to use generic '/etc/dhclient.conf' (as documented in manpage!)

if per-device file doesn't exist or is empty

As The code mention iI should have one file /etc/dhclient.conf for all devices to get the same configuration. But the code does not reflect that.

Its only working if I the config file is named with the device suffix ( /etc/dhcllient-eth0.conf or /etc/dhcp/dhclient-eth0.conf )

Hello Asaf - sorry for the slow response, I had to put RHEL back on a workstation instead of Fedora to test this. I do not see ANY reference to "dhclient.conf" in the ifup files.

[root@morpheus network-scripts]# pwd
/etc/sysconfig/network-scripts
[root@morpheus network-scripts]# grep dhclient.conf *
[root@morpheus network-scripts]#

Unfortunately I don't know how to help with the specific issue you are having. (perhaps because I use NetworkManager?)

The only file that I can find that had value was:

cat /etc/NetworkManager/dispatcher.d/10-dhclient
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.