LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   dhcpd has problems getting IP... dhclient works (https://www.linuxquestions.org/questions/slackware-14/dhcpd-has-problems-getting-ip-dhclient-works-4175632561/)

wilhe_jo 06-24-2018 06:00 AM

dhcpd has problems getting IP... dhclient works
 
Hi there!

I was tracking down crazy problems with getting an IP on my RPi3.

After seriously trying to find an HW error (custom HAT, JTAG debugger,... attached) I ended up searching for problems in the software.

It seems NetworkManager has problems with dhcpd (default in slackware) to get an IP.

This was already documented in:
https://www.linuxquestions.org/quest...er-4175576144/

5 reboots gave at least 1 problem in getting an IP.
Changing to dhclient resulted in a stable system.

Btw the router runs 14.2 and manages the nets with dnsmasq.

Anyone knows of any drawbacks of using dhclient???

73

laprjns 06-24-2018 08:34 AM

I've been using dhclient for two years now. Had problems with Networkmanger right out of the box when 14.2 was released, Changing to dhclient solve the problem.

wilhe_jo 06-24-2018 09:49 AM

well, then why does slackware prefer dhcpd???

73

allend 06-24-2018 10:53 AM

Quote:

well, then why does slackware prefer dhcpd???
A bit old now, but perhaps this will help.

wilhe_jo 06-24-2018 11:21 AM

Hmm...

So there are already a bunch of people having troubles...

maybe we should reconsider the default NetworkManager configuration ????

73

smallpond 06-24-2018 01:18 PM

dhcpd is a DHCP server, not a client.

brobr 06-24-2018 01:51 PM

One could try to uncomment clientid and comment out duid in /etc/dhcpcd.conf:

Code:

# Use the hardware address of the interface for the Client ID.
clientid
# or
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
# Some non-RFC compliant DHCP servers do not reply with this set.
# In this case, comment out duid and enable clientid above.
#duid

This I need to do to get an eth0-connection at work

HTH

rob

TommyC7 06-24-2018 03:31 PM

Are you sure you used dhcpcd and not dhcpd?

dhcpcd is a dhcp client (like dhclient) whereas dhcpd is a dhcp server daemon as mentioned by smallpond.

Richard Cranium 06-24-2018 08:37 PM

Quote:

Originally Posted by wilhe_jo (Post 5871378)
Hmm...

So there are already a bunch of people having troubles...

maybe we should reconsider the default NetworkManager configuration ????

73

There's also a bunch of other people who haven't had troubles.

When you do have trouble, it isn't that difficult to find the client which works is it?

drmozes 06-25-2018 01:38 AM

Quote:

Originally Posted by Richard Cranium (Post 5871569)
There's also a bunch of other people who haven't had troubles.

When you do have trouble, it isn't that difficult to find the client which works is it?

I found that it is. NetworkManager does not support dhcpcd very well. The settings to control the behaviour (timeouts, in this case) required within dhcpcd cannot be set within NetworkManager, because the NM helper tool doesn't support them.
I also tried getting dhclient to work without luck. In the end I disabled NM and reverted to dhcpcd being called directly from the rc scripts, where I have control over the command line operators.

Richard Cranium 06-25-2018 04:02 AM

Quote:

Originally Posted by drmozes (Post 5871621)
I found that it is. NetworkManager does not support dhcpcd very well. The settings to control the behaviour (timeouts, in this case) required within dhcpcd cannot be set within NetworkManager, because the NM helper tool doesn't support them.
I also tried getting dhclient to work without luck. In the end I disabled NM and reverted to dhcpcd being called directly from the rc scripts, where I have control over the command line operators.

For that matter, the way NetworkManager launches dhcpcd, you don't get the benefit of the hooks in /lib/dhcpcd/dhcpcd-run-hooks. As far as I can tell, /usr/libexec/nm-dhcp-helper only works to inform NetworkManager about dhcpcd's actions and nothing else.

You can hook into /etc/NetworkManager/dispatcher.d to view and maybe manipulate NetworkManager's environment. (I've only done the former and not the latter.)

wilhe_jo 06-25-2018 04:23 PM

Quote:

Originally Posted by Richard Cranium (Post 5871569)
There's also a bunch of other people who haven't had troubles.

When you do have trouble, it isn't that difficult to find the client which works is it?

Well so far, this is the first time I get this problem... and to be honest, tracking down the problem was quite painful since you get next to none information via the usual log files...

I would have never ever thought about dhcpcd (sorry for this typo...) being a problem... or at least being troublesome/unstable when used with NM in certain combinations...

However, more interesting is IMHO the fact that none of my other 14.2 boxes showed problems so far...
I need to get a paper done till september... after that I'll go and put -current on one of my x86 boxes to check for similar behaviour.

reverting back to plain rc-scripts for the headless rpi boxes... well might be an option

73

Richard Cranium 06-25-2018 05:00 PM

Most of my home network uses the rc.inet1 script to manage their connections. My laptops use NetworkManager for their wireless connections; I haven't seen problems talking to my gateway with them, but I'm running bind and dhcpd versus dnsmasq.

There's also wicd in /extras, IIRC. Quite a few people have used it and many still do.


All times are GMT -5. The time now is 08:30 AM.