Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
dhcpcd not sending hostname with dhcp request <SOLVED>
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
OrangeToque
n00b
n00b


Joined: 03 Apr 2006
Posts: 57
Location: Edmonton, Alberta, Canada

PostPosted: Fri Sep 28, 2007 10:38 pm    Post subject: dhcpcd not sending hostname with dhcp request <SOLVED> Reply with quote

I have several gentoo boxes on my network, and they are all configured to receive a specific IP address based upon the hostname of the machine (sent by default with dhcpcd requests, as stated in /etic/network/net.example). This setup has worked great for over a year, however after a recent upgrade the machines have been receiving the wrong IP address from the DHCP server.

I have traced the problem to a recent upgrade from dhcpcd 3.0.16-r1 to 3.1, and have temporarily fixed the issue by either masking the latest version of dhcpcd and downgrading to the previous version, or configuring the script to use a different dhcp client (udhcpc).

Although this problem has been effectively solved, I was wondering if there is a way to solve this issue with the newest version of dchpcd?
_________________
OS: Linux 2.6.24-gentoo-r3 x86_64 Gentoo v1.12.11.1 Sound: HDA Intel
CPU: Intel(R) Core(TM)2 Quad CPU Q6700 @ 2.66GHz GenuineIntel
Disk: 2x 300GB 7200.10 SATA II Video: GeForce 7900 GT RAM: 4GB


Last edited by OrangeToque on Wed Oct 03, 2007 5:22 am; edited 1 time in total
Back to top
View user's profile Send private message
thode
n00b
n00b


Joined: 19 Nov 2004
Posts: 13

PostPosted: Fri Sep 28, 2007 11:27 pm    Post subject: Reply with quote

Same experience here, same solution.
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Sat Sep 29, 2007 2:15 am    Post subject: Reply with quote

Works For Me!

You two care to email me wireshark traces of your dhcpcd transactions?
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
thode
n00b
n00b


Joined: 19 Nov 2004
Posts: 13

PostPosted: Sat Sep 29, 2007 11:18 pm    Post subject: Reply with quote

I've sent you a mail :)

seems other people are reporting problems with 3.1.5: https://forums.gentoo.org/viewtopic-t-590885.html
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Sun Sep 30, 2007 4:20 pm    Post subject: Reply with quote

Didn't get any emails :/
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
thode
n00b
n00b


Joined: 19 Nov 2004
Posts: 13

PostPosted: Sun Sep 30, 2007 10:00 pm    Post subject: Reply with quote

I used the email address under contacts on your homepage, and attached the output file from wireshark.

I'll send a new one to the same address.
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Mon Oct 01, 2007 11:22 am    Post subject: Reply with quote

Maybe my spam filtering got it!
Send it to uberlord@gentoo.org please.

Thanks!
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
thode
n00b
n00b


Joined: 19 Nov 2004
Posts: 13

PostPosted: Mon Oct 01, 2007 12:49 pm    Post subject: Reply with quote

done :)
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Mon Oct 01, 2007 1:57 pm    Post subject: Reply with quote

OK, got it now. However, I can't analyse it for a few days as my fbsd box is currently emerge -e world with loads of packages. I'll post back here as soon as wireshark works again!
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
Sperlock
n00b
n00b


Joined: 18 Sep 2004
Posts: 46
Location: Sparks, NV

PostPosted: Tue Oct 02, 2007 1:03 am    Post subject: Reply with quote

I think I may have also had this issue. I could connect to my router, but could not get to the Internet. The DHCP list on my router showed my laptop but not my desktop (though for whatever reason it now shows my desktop but not my laptop). I was afraid something happened to my NIC, but downgrading from dhcpcd 3.1.5 to 3.0.16-r1 fixed everything. Running x86 with an Intel DP965LT motherboard.
_________________
http://informationthreshold.blogspot.com
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Tue Oct 02, 2007 5:42 pm    Post subject: Reply with quote

thode wrote:
I've sent you a mail :)

seems other people are reporting problems with 3.1.5: https://forums.gentoo.org/viewtopic-t-590885.html


Looks like to me - what do you think is wrong with it?
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Tue Oct 02, 2007 5:55 pm    Post subject: Re: dhcpcd not sending hostname with dhcp request Reply with quote

OrangeToque wrote:
I have several gentoo boxes on my network, and they are all configured to receive a specific IP address based upon the hostname of the machine (sent by default with dhcpcd requests, as stated in /etic/network/net.example). This setup has worked great for over a year, however after a recent upgrade the machines have been receiving the wrong IP address from the DHCP server.

I have traced the problem to a recent upgrade from dhcpcd 3.0.16-r1 to 3.1, and have temporarily fixed the issue by either masking the latest version of dhcpcd and downgrading to the previous version, or configuring the script to use a different dhcp client (udhcpc).

Although this problem has been effectively solved, I was wondering if there is a way to solve this issue with the newest version of dchpcd?


First, it's /etc/conf.d/net.example
Secondly, still expecting the trace.
Thirdly, sure it's not a server configuration issue?
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
thode
n00b
n00b


Joined: 19 Nov 2004
Posts: 13

PostPosted: Tue Oct 02, 2007 9:00 pm    Post subject: Reply with quote

I'm by no means an expert, but I'll try to elaborate a bit on what I've experienced:
I'm running my home network with a server set up to use dnsmasq, providing me dhcp and dns server functionality.
Int /etc/dnsmasq.conf it states:
Code:

# Enable the address given for "judge" in /etc/hosts
# to be given to a machine presenting the name "judge" when
# it asks for a DHCP lease.
#dhcp-host=judge


What I've configured here is:
Code:

dhcp-host=twilight
dhcp-host=aurora


That's it. Relevant section from the server's /etc/hosts:
Code:

192.168.1.2     twilight.thode.lir.dk   twilight
192.168.1.3     aurora.thode.lir.dk     aurora


And naturally, hostname configurations on both machines are properly configured in their /etc/conf.d/hostname.
This is the only client specific configurations I've done on my server running dnsmasq.

It worked before 3.1.5
It doesn't now.

If this is not a problem relating to the newest dhcpcd, then what could be the cause of the problem?

Naturally, I could do the configuration to provide ip based on specific mac address, but both machines have several nic's, and I like how I'm able to connect them this way, regardless of nic, with a single configuration line pr. machine.

I'll post more of my configuration files, should it be needed.

Regards
Christian
Back to top
View user's profile Send private message
OrangeToque
n00b
n00b


Joined: 03 Apr 2006
Posts: 57
Location: Edmonton, Alberta, Canada

PostPosted: Tue Oct 02, 2007 10:08 pm    Post subject: Reply with quote

Pretty much the exact same problem with my config. (dnsmasq + /etc/hosts)

works with udhcpc and dhcpcd < 3.15 but not with dhcpcd=3.15
_________________
OS: Linux 2.6.24-gentoo-r3 x86_64 Gentoo v1.12.11.1 Sound: HDA Intel
CPU: Intel(R) Core(TM)2 Quad CPU Q6700 @ 2.66GHz GenuineIntel
Disk: 2x 300GB 7200.10 SATA II Video: GeForce 7900 GT RAM: 4GB
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Tue Oct 02, 2007 11:01 pm    Post subject: Reply with quote

thode wrote:
If this is not a problem relating to the newest dhcpcd, then what could be the cause of the problem?


A rough guess is because dhcpcd-3.1 sends an IAID+DUID for a ClientID whereas <dhcpcd-3.1 just sent a MAC address. Your server had already leased the address for "aurora" to the MAC address client ID and thus either a new one or no one to the IAID+DUID client ID.

As you can control the server, could you stop the server, punt the leases file, start it again and then restest dhcpcd? It should work fine then.
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
thode
n00b
n00b


Joined: 19 Nov 2004
Posts: 13

PostPosted: Tue Oct 02, 2007 11:26 pm    Post subject: Reply with quote

That did indeed resolve the problem :)

Thanks for the fast replies, and a very good description of the dhcp mechanics, it's always nice to get a deeper insight into what's going on!
Back to top
View user's profile Send private message
Cypr
n00b
n00b


Joined: 03 Jan 2005
Posts: 57

PostPosted: Thu Oct 04, 2007 6:18 am    Post subject: Reply with quote

I think I might have the same problem, except that the dhcp server is a Zonet router.

Before upgrading, the router said that the mac address of my computer was 00:0F:..., the same as ifconfig gives.
After upgrading to 3.1.5, the router says that the mac address of my computer is 65:74:.... (And complains about the address, when I try to set a static ip for it, and refuses.)

My computer is connected via a switch, in case that's relevant.

I don't understand what punting the leases file means (or what IAID/DUID means). I've tried unplugging the router (and plugging it in again), but that didn't help.
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Thu Oct 04, 2007 6:59 am    Post subject: Reply with quote

Cypr wrote:
Before upgrading, the router said that the mac address of my computer was 00:0F:..., the same as ifconfig gives.
After upgrading to 3.1.5, the router says that the mac address of my computer is 65:74:.... (And complains about the address, when I try to set a static ip for it, and refuses.)


See, your DHCP server *requires* the MAC address in the ClientID field.
Not only is this field *optional* as per all relevant RFCs, but you've never been required to put the MAC address in there either.
So what we have here is a buggy DHCP server

Quote:
I think I might have the same problem, except that the dhcp server is a Zonet router.
I don't understand what punting the leases file means (or what IAID/DUID means). I've tried unplugging the router (and plugging it in again), but that didn't help.


So you can only upgrade the DHCP server by a firmware upgrade, which I won't recommend.

You can, however, revert dhcpcd to the old behaviour by using the -I ''
Code:
dhcpcd_eth0="-I ''"


Like so.
Or emerge dhcpcd with the vram USE flag.
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Thu Oct 04, 2007 7:02 am    Post subject: Reply with quote

thode wrote:
That did indeed resolve the problem :)

Thanks for the fast replies, and a very good description of the dhcp mechanics, it's always nice to get a deeper insight into what's going on!


Now you've fixed dhcpcd-3.1 and are using this new feature, let me explain one of the benefits.

You can swap the network card out and use a different one, or change the MAC address of the card your using because you already have your DUID. So you get the same ip address :)
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
Cypr
n00b
n00b


Joined: 03 Jan 2005
Posts: 57

PostPosted: Thu Oct 04, 2007 5:56 pm    Post subject: Reply with quote

UberLord wrote:
Cypr wrote:
Before upgrading, the router said that the mac address of my computer was 00:0F:..., the same as ifconfig gives.
After upgrading to 3.1.5, the router says that the mac address of my computer is 65:74:.... (And complains about the address, when I try to set a static ip for it, and refuses.)


See, your DHCP server *requires* the MAC address in the ClientID field.
Not only is this field *optional* as per all relevant RFCs, but you've never been required to put the MAC address in there either.
So what we have here is a buggy DHCP server


Ok.

Quote:
Quote:
I think I might have the same problem, except that the dhcp server is a Zonet router.
I don't understand what punting the leases file means (or what IAID/DUID means). I've tried unplugging the router (and plugging it in again), but that didn't help.


So you can only upgrade the DHCP server by a firmware upgrade, which I won't recommend.

You can, however, revert dhcpcd to the old behaviour by using the -I ''
Code:
dhcpcd_eth0="-I ''"


Like so.
Or emerge dhcpcd with the vram USE flag.


Thanks, adding dhcpcd_eth0="-I ''" to /etc/conf.d/net worked. (After re-reading your post and putting the exact right string in /etc/conf.d/net.)
Back to top
View user's profile Send private message
agent_jdh
Veteran
Veteran


Joined: 08 Aug 2002
Posts: 1783
Location: Scotland

PostPosted: Fri Nov 23, 2007 1:09 am    Post subject: Reply with quote

I was having this problem as well, dual booting Gentoo/XP and connecting to my Gentoo server running dnsmasq. The modification to /etc/conf.d/net.eth0 appears to have fixed the problem here. Many thanks to all! This has had me scratching my head for a few days until I found this thread.
_________________
Jingle Jangle Jewellery
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum