Bug 1468358 - unable to obtain ipv4 address via dhcp [perhaps due to duid]
unable to obtain ipv4 address via dhcp [perhaps due to duid]
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: NetworkManager (Show other bugs)
26
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Beniamino Galvani
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-06 15:51 EDT by Satish Balay
Modified: 2017-09-04 11:27 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-07-25 11:53:22 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
[PATCH] libnm-core: improve documentation for ipv4.dhcp-client-id property (1.70 KB, patch)
2017-07-19 09:18 EDT, Beniamino Galvani
no flags Details | Diff

  None (edit)
Description Satish Balay 2017-07-06 15:51:58 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):

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 09:27:28 EDT
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 12:38:15 EDT
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 09:18 EDT
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 13:16:57 EDT
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 10:09:29 EDT
(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 11:41:53 EDT
(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 10:52:20 EDT
(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)

Note You need to log in before you can comment on or make changes to this bug.