Red Hat Bugzilla – Bug 1468358
unable to obtain ipv4 address via dhcp [perhaps due to duid]
Last modified: 2017-07-25 11:53:22 EDT
Description of problem:
I'm unable to obtain ipv4 address via dhcp [perhaps due to duid]
Version-Release number of selected component (if applicable):
[issue existed since Fedora 21]
Steps to Reproduce:
1. Attempt to connect to a network setup with a dhcp server that is configured to reply only to registered mac addresses
no ip assignment via dhcp
I connect to a network that has a dhcp server - that provides ip address only to machines with registered Mac addresses.
With Fedora (perhaps starting with version 21) I do not get a dhcp ip address assignment.
A gentoo linux user on this network discovered that using 'dhcpcd -D (duid)' option triggered this issue. [i.e the dhcp server does not respond]. However using MAC address with clientid [instead of duid] - the dhcp server responds.
How can I do this switch (from duid to clientid=MAC) with Fedora/NetworkManager?
Note: ubuntu boxes that connect to this network do not experience this issue. With fedora - I've been using static-ip as a work-arround [but using FedoraLiveUSB has become a big hassle]
Does it work if you change the client-identifier of the connection to a type+mac one? i.e.:
nmcli connection mod <connection-name> ipv4.dhcp-client-id 01:xx:xx:xx:xx:xx:xx
nmcli connection up <connection-name>
where xx:xx:xx:xx:xx:xx is a MAC address?
Yes - this works!
- boot f26 beta x86_64 live cd
[liveuser@localhost-live network-scripts]$ nmcli
enp0s25: connecting (getting IP configuration) to Wired connection 1
"Intel 82579LM Gigabit"
ethernet (e1000e), 3C:97:0E:0D:CB:F0, hw, mtu 1500
[liveuser@localhost-live network-scripts]$ nmcli connection mod "Wired connection 1" ipv4.dhcp-client-id 01:3C:97:0E:0D:CB:F0
[liveuser@localhost-live network-scripts]$ nmcli connection up "Wired connection 1"
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/13)
[liveuser@localhost-live network-scripts]$ ping google.com
PING google.com (220.127.116.11) 56(84) bytes of data.
64 bytes from ord37s07-in-f46.1e100.net (18.104.22.168): icmp_seq=1 ttl=55 time=2.63 ms
I see this is adding to /etc/sysconfig/network-scripts/ifcfg-Wired_connection_1 'DHCP_CLIENT_ID=01:MAC'
I had previously checked 'man nm-settings-ifcfg-rh' and tried 'DHCP_CLIENT_ID=MAC - but that did not work
1. Perhaps the manpage can be updated to indicate this extra requirement for DHCP_CLIENT_ID - when Mac address is used?
2. Is it possible for network-manager to set this up automatically?
Created attachment 1301091 [details]
[PATCH] libnm-core: improve documentation for ipv4.dhcp-client-id property
(In reply to Satish Balay from comment #2)
> 1. Perhaps the manpage can be updated to indicate this extra requirement for
> DHCP_CLIENT_ID - when Mac address is used?
How about the attached patch?
> 2. Is it possible for network-manager to set this up automatically?
According to RFC 2131:
"The 'client identifier' is an opaque key, not to be interpreted by the server".
If the DHCP server you are using is not RFC-compliant and does not respond to certain client-id formats, clients must be manually configured to pass a client-id the server understands. There is now way NM can guess that the server is broken and requires a specific client-id format.
1. Thanks! This looks good. One minor clarification. Could you also add relevant text for wifi aswell?
I see https://tools.ietf.org/html/rfc1700 says:
1 Ethernet (10Mb)
6 IEEE 802 Networks
So presumably one should use 06:MAC for wifi? [I don't have this issue on wifi - but I think it would be good if the document can clarify]
2. I guess I'll just have to manually set this each time..
(In reply to Satish Balay from comment #4)
> 1. Thanks! This looks good. One minor clarification. Could you also add
> relevant text for wifi aswell?
> I see https://tools.ietf.org/html/rfc1700 says:
> 1 Ethernet (10Mb)
> 6 IEEE 802 Networks
I've never heard of anything other than 01 being used, so I prefer not to add other information that may be wrong.
(In reply to Beniamino Galvani from comment #5)
> I've never heard of anything other than 01 being used
Thanks for the clarification.
BTW: I see this issue was previously discussed at
[I might not have searched properly earlier before filing this issue]
creating /etc/dhcp/dhclient.conf and adding the following line solved the issue:
send dhcp-client-identifier = hardware;
I've submitted patch to dracut once it's released in Fedora installer should use HW address as client-identifier.
So future Live images will likely get dhcp without requiring this extra change
(In reply to Beniamino Galvani from comment #3)
> Created attachment 1301091 [details]
> [PATCH] libnm-core: improve documentation for ipv4.dhcp-client-id property
lgtm. However, it causes `make check` to fail (settings-docs.c)
Fixed and applied to master:
Thanks for the report, closing this.