Bug 1468358

Summary: unable to obtain ipv4 address via dhcp [perhaps due to duid]
Product: [Fedora] Fedora Reporter: Satish Balay <balay>
Component: NetworkManagerAssignee: Beniamino Galvani <bgalvani>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 26CC: balay, bgalvani, dcbw, fgiudici, lkundrak, thaller, uche
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-07-25 15:53:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
[PATCH] libnm-core: improve documentation for ipv4.dhcp-client-id property none

Description Satish Balay 2017-07-06 19:51:58 UTC
Description of problem:

I'm unable to obtain ipv4 address via dhcp [perhaps due to duid]

Version-Release number of selected component (if applicable):

NetworkManager-1.8.0-6.fc26.x86_64

[issue existed since Fedora 21]

How reproducible:

Always

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

Actual results:

no ip assignment via dhcp

Expected results:

dhcp connection

Additional info:

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]

Comment 1 Beniamino Galvani 2017-07-07 13:27:28 UTC
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?

Comment 2 Satish Balay 2017-07-07 16:38:15 UTC
Yes - this works!

- boot f26 beta x86_64 live cd

>>>>>>>>
[liveuser@localhost-live network-scripts]$ nmcli
<snip>
enp0s25: connecting (getting IP configuration) to Wired connection 1
        "Intel 82579LM Gigabit"
        ethernet (e1000e), 3C:97:0E:0D:CB:F0, hw, mtu 1500
<snip>
[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 (172.217.1.46) 56(84) bytes of data.
64 bytes from ord37s07-in-f46.1e100.net (172.217.1.46): icmp_seq=1 ttl=55 time=2.63 ms
^C
<<<<<<<

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?

Thanks!

Comment 3 Beniamino Galvani 2017-07-19 13:18:34 UTC
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.

Comment 4 Satish Balay 2017-07-19 17:16:57 UTC
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..

Comment 5 Beniamino Galvani 2017-07-20 14:09:29 UTC
(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.

Comment 6 Satish Balay 2017-07-20 15:41:53 UTC
(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

https://bugzilla.redhat.com/show_bug.cgi?id=1154200

[I might not have searched properly earlier before filing this issue]

https://bugzilla.redhat.com/show_bug.cgi?id=1154200#c15
>>
creating /etc/dhcp/dhclient.conf and adding the following line solved the issue:
send dhcp-client-identifier = hardware;
<<

https://bugzilla.redhat.com/show_bug.cgi?id=1154200#c67
>>
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

Comment 7 Thomas Haller 2017-07-25 14:52:20 UTC
(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)

Comment 9 uche 2018-11-13 05:37:50 UTC
I also ran into this issue setting up Fedora 29. 

I was able to use the 01:[MAC] and 02:[MAC] syntax to "fix" the issue with my on-board ethernet port as well as on through PCI. 

I haven't had this issue with other distro installations. The way my issue was manifesting was I run DHCP on a windows server, and was assigning an IP to the machine MAC (rather than statically configuring on the machine itself). Works for my other use cases, but in this case, the machine kept holding on to it's DHCP assigned IP as though the reservation didn't exist. 

Multiple ifdown & ifup calls for the connections didn't fix the issue. The notes above however, did.