If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Where is dhclient.conf these days?

Hello all,

I'm trying to get F12 to play nice as a guest VM inside a virtual LAN I have setup (Virtualbox 3.1.0, Windows Vista host). Specifically where I'm having problems is I am using dnsmasq on the gateway machine, and its config file is set to give a fixed lease to machines who identify themselves as one of the entries in the /etc/hosts file on the gateway.

So... the F12 box with hostname 'demandred.local' should be sending its host name as part of its dhcp request to the gateway box, where dnsmasq should look in /etc/hosts see 'demandred.local' mapped to '10.0.0.4' and give it that ip address accordingly.

Except... it isn't happening with the F12 box. Ubuntu 9.10 guest VM box, worked right of the bat. Debian Lenny guest VM box, had to edit '/etc/dhcp3/dhclient.conf' to include the command 'send hostname "hostname.domain"', and then it worked fine. F12... there is a man page for dhclient.conf, but there is no such file. The directory structure is different too... /etc/dhcp/dhclient.d/, and all there is in there is a file 'ntp.sh'

So... where the heck has dhclient.conf gone to in F12? Sure, there are other ways to 'fix' this little wrinkle - like having dnsmasq assign dhcp leases via MAC address, etc. But at this juncture... I'm really curious as to *why* I can't seem to get F12 to send a host name identifier as part of its dhcp request, or where the dang config file that is *supposed* to be present on a machine that is a dhcp client?

dhclient still looks for the file but by using a dhclient -cf option the file can be replaced.

If you setup the interface (see system-config-network) to NOT use NetworkManager then the file will appear as /etc/dhclient-eth0.conf (whatever the interface name) after you execute "ifup eth0".

If you use NetworkManager then the file is in /var/run/nm-dhclient-eth0.conf
---
More important, to solve your problem of sending the hostname just set the hostname per interface in the system-config-network tool.

I kind of wondered if it was a Network Manager issue. I've seen some threads in various forums on issues raised by the changes due to that particular program. The part that doesn't make sense is that I *have* set the hostname, both in /etc/sysconfig/network *and* in Network Manager... but the server running dnsmasq doesn't seem to be seeing it. Oddly enough, a desktop running Ubuntu 9.10 (also using Network Manager, I believe) was actually the least problematic client so far - it picked up its ip address from the server no issues whatsoever. For some reason the same thing isn't working in F12.

Another dhcp client question with Network Manager... how do you force it to release a dhcp lease and ask for a new one? (besides dropping the connection and restarting it)

I believe I will have to try the wireshark bit... both F12 & U9.10 look like they have the same thing in /var/run/nm-dhclient-eth0.conf... well, Ubuntu has a lot more stuff, but its pretty much all commented out with the exception of one line:

Code:

...
send host-name "<hostname>";
...

Otherwise it looks like its all copied straight over from /etc/dhcp3/dhclient.conf, with the last line being the same as whats in the /var/run/nm-dhclient-eth0.conf file on F12 (the dhcp-client-identifier bit).

Hmmm... wonder if it'd just be easier to edit dnsmasq.conf on the server to look for the client id instead of hostname... but at this point I am mainly curious as to what the heck is the difference in what is being sent as part of that dhcp request...

Installed wireshark on the CentOS 5.4 server running dnsmasq, and captured some traffic. After a bit, I decided what I wanted was just the dhcp traffic, specifically anything with the particular option flags 12 (hostname) or 61 (client ID) in them. So, I put together a very basic filter in wireshark, and sat back and watched a bit.

First I watched the Ubuntu 9.10 box request a lease. Yes, it sent the hostname as part of the request, and it got the ip it was supposed to. Then I watched the F12 box request a lease, and it included the client id, but not the hostname -> it got the regular dynamic ip from the pool. I already knew that was what would happen, but now to figure out *why*.

Did some editing on U9.10... tried editing /var/run/nm-dhclient-eth0.conf to comment out the 'send host-name...' line, but the lines appear to be auto-generated when the link comes up - so the edit didn't stick (didn't really figure it would, being in /var and all). Since that part of the file comes from /etc/dhcp3/dhclient.conf, I went and edited *that* file, commenting out the same line. Brought the eth0 link down and up again, and... got an ip from the dhcp pool, not the one expected from the /etc/hosts file. I checked /var/run/nm-dhclient-eth0.conf and yep, that 'send host-name...' line was now commented out. I looked at the packets in wireshark and the Ubuntu client had sent the client id, but no hostname. Went back and un-commented the line in dhclient.conf and did a quick down/up on the eth0 link, and everything went back to normal.

Onwards to the F12 machine. I edited the /etc/sysconfig/networking-scripts/ifcfg-eth0 script as suggested, adding 'DHCP_HOSTNAME=demandred' to the end of the script, and cycled the link. Sure enough, it came up with the correct ip address from the hosts file, and everything worked just fine.

So... now I know how to 'force' F12 to send the host name as part of its dhcp request by editing /etc/sysconfig/networking-scripts/ifcfg-eth0, and have confirmed that it works. Now... I just have to decide how I want to do this... edit the Fedora machine that wants to be 'different', or set the server to look for something everything can agree on.

Re: Where is dhclient.conf these days?

Hi.

I have a problem with this setup. I also want my fedora 12 host (which runs as a KVM virtual machine on a Gentoo host) to send its host name through DHCP but it's not. I've checked /etc/sysconfig/network-scripts/ifcfg-eth0 and it *does* include the DHCP_HOSTNAME directive. So do /etc/sysconfig/networking/devices/ifcfg-eth0 and /etc/sysconfig/networking/profiles/default/ifcfg-eth0; /var/run/nm-dhclient-eth0.conf is still empty (just contains #created by network manager comment).

Any other place to look at?

Note I'm using a net-install of Fedora 12 without any GUI, only the command-line tools.

EDIT: I think I've found. It's only when the FQDN host name is specified in Network Manager configuration wizard that the host name is sent to the DHCP server. Weird but true.