FedoraForum.org - Fedora Support Forums and Community
Results 1 to 12 of 12
  1. #1
    Join Date
    Jul 2009
    Posts
    16

    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?

    TIA,

    Monte

  2. #2
    stevea Guest
    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.
    Last edited by stevea; 15th December 2009 at 04:02 AM.

  3. #3
    Join Date
    Jul 2009
    Posts
    16
    Steve,

    Thanks for the response.

    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)

    Thanks,

    Monte
    Last edited by memilanuk; 15th December 2009 at 05:50 AM.

  4. #4
    Join Date
    Jun 2004
    Location
    Laurel, MD USA
    Posts
    7,157
    In general you can instantly find any file "filename" on a Fedora machine from a terminal window via:

    locate filename

    (with a few exceptions, mlocate, which is run by cron, scans most of the disk and creates a
    database in /var/lib/mlocate that the locate command uses)

  5. #5
    Join Date
    Jul 2009
    Posts
    16
    Mark, do a 'locate dhclient.conf' and tell me if you find anything that looks like a config file?
    Last edited by memilanuk; 16th December 2009 at 11:25 PM.

  6. #6
    Join Date
    Jul 2009
    Posts
    16
    Steve,

    Looking at that /var/run/nm-dhclient-eth0.conf file...

    Code:
    # Created by NetworkManager
    
    send dhcp-client-identifier "demandred"; # added by NetworkManager
    I'm wondering if it's a mis-match between what F12 is sending i.e. 'send dhcp-client-identifier...' vs. what the dhcp server is expecting i.e. 'send host-name...'?

    Thanks,

    Monte

  7. #7
    stevea Guest
    Sorry for the long delay.

    Yes, that should be
    send host-name "demandred";

    You can always sniff the dhcp packets with wireshark and get the real analysis.

  8. #8
    Join Date
    Jul 2009
    Posts
    16
    Steve,

    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).

    Someone suggested editing /etc/sysconfig/networking-scripts/ifcfg-eth0 and adding:

    Code:
    DHCP_HOSTNAME="demandred"
    It already has 'DHCP_CLIENT_ID="demandred"'...

    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...

    Monte

  9. #9
    Join Date
    Jul 2009
    Posts
    16
    Well... here's what I found:

    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.

    Monte

  10. #10
    Join Date
    Nov 2004
    Location
    Gone
    Age
    49
    Posts
    8

    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.
    Last edited by VinzC; 26th April 2010 at 11:32 AM.
    Vince C.

  11. #11
    Join Date
    Oct 2017
    Location
    alaska
    Posts
    32

    Re: Where is dhclient.conf these days?

    not everyone who works on free software does so in good faith -- that's a legal phrase, not a religious phrase -- no disrespect intended to richard stallman

    i have noticed that "contributors" are fooling around in bad faith with the documentation and configuration for dhclient and dovecot, to mention a couple of sad examples

    we need army boots upstream on this one

  12. #12
    Join Date
    Mar 2011
    Location
    /
    Posts
    5,093

    Re: Where is dhclient.conf these days?

    Please avoid posting in ancient threads. In this case, this is a 7 year old thread.

    Thread closed.
    Fedora 27 x86_64 XFCE - Sager | Intel Core i7 - 4810 MQ | NVIDIA GeForce GTX 860M | 16 GB RAM | 480 GB ADATA SSD |
    Fedora 27 x86_64 XFCE - Dell Precision M4800 | Intel Core i7 - 4900 MQ | NVIDIA Quadro K1100M | 16 GB RAM | 750 GB 7200 RPM HDD |


    The Linux Documentation Project | Fedora Documentation

Similar Threads

  1. Cannot find dhclient.conf
    By nspmangalore in forum Servers & Networking
    Replies: 3
    Last Post: 19th September 2008, 03:33 PM
  2. Defining a static ip in dhclient.conf
    By cheesefarmer in forum Servers & Networking
    Replies: 1
    Last Post: 3rd May 2007, 10:19 AM
  3. Dhclient and resolv.conf
    By crossmr in forum Using Fedora
    Replies: 0
    Last Post: 11th October 2006, 03:37 AM
  4. NTP problem: dhclient-script changes ntp.conf
    By SoldierSvejk in forum Using Fedora
    Replies: 0
    Last Post: 5th September 2006, 04:38 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •