https://bugs.kde.org/show_bug.cgi?id=378259

            Bug ID: 378259
           Summary: NetworkManager does not send new hostname to DHCP
                    server
           Product: plasma-nm
           Version: 5.7.5
          Platform: Other
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: editor
          Assignee: jgrul...@redhat.com
          Reporter: ddppezas...@tutanota.com
  Target Milestone: ---

Created attachment 104806
  --> https://bugs.kde.org/attachment.cgi?id=104806&action=edit
KDE nm-editor dialog IPv4 tab screenshot

Trying to send a different (or blank) hostname to the DHCP request on a
wireless interface (wlp3s0). NetworkManager (and the KDE nm-editor) doesn't
seem to allow this or make this happen, no matter what I tried.

Using vanilla Kubuntu 16.10 Live CD (with security updates current) IPv4 only. 
I have observed this issue for a long time on previous versions, though.
Hostname is the default: kubuntu

1. Tried to enter in DHCP Client ID hostname (asdfl87Gad) in nm-editor (see
attached screenshot).  This added
 dhcp-client-id=asdfl87Gad
to the [ipv4] section of /etc/NetworkManager/system-connections/Guest and added
 send dhcp-client-identifier "asdfl87Gad"; # added by NetworkManager
to the end of /var/lib/NetworkManager/dhclient-wlp3s0.conf but there still was
a line
 send host-name "kubuntu"; # added by NetworkManager
in that file, and
 tcpdump -nvvi wlp3s0 port 68
showed
 Hostname Option 12, length 7: "kubuntu"
was still being sent "on the wire"(less)

2. Looked at man NetworkManager (not so useful) and (more useful)
 man nm-settings
and found dhcp-hostname (string) and dhcp-send-hostname (boolean, default TRUE)
in the Table 13. ipv4 setting section. Added
 dhcp-hostname=asdfl87Gad
 dhcp-send-hostname=true
to the [ipv4] section of /etc/NetworkManager/system-connections/Guest but
tcpdump still showed
 Hostname Option 12, length 7: "kubuntu"
and the end of /var/lib/NetworkManager/dhclient-wlp3s0.conf had
 send dhcp-client-identifier "asdfl87Gad"; # added by NetworkManager
 send host-name "kubuntu"; # added by NetworkManager

3. On a whim, in /etc/NetworkManager/system-connections/Guest I changed
 dhcp-send-hostname=false
and modified /etc/dhcp/dhclient.conf
 #send host-name = gethostname();
 supersede host-name "asdfl87Gad";
 send host-name "asdfl87Gad";
 request subnet-mask, broadcast-address, time-offset, routers,
 #       domain-name, domain-name-servers, domain-search, host-name,
         domain-name, domain-name-servers, domain-search,
 #       dhcp6.name-servers, dhcp6.domain-search, dhcp6.fqdn,
dhcp6.sntp-servers,
and restarted NetworkManager
 service NetworkManager restart
which removed from the end of /var/lib/NetworkManager/dhclient-wlp3s0.conf 
 send host-name "kubuntu"; # added by NetworkManager
and tcpdump -nvvi wlp3s0 port 68 finally showed
 Hostname Option 12, length 10: "asdfl87Gad"

So, while I was able to accomplish this, I had to edit a lot of text files, and
I'm not sure exactly what made it work.

Relevant excerpts from my files follow:

/etc/dhcp/dhclient.conf

option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;
#send host-name = gethostname();
supersede host-name "asdfl87Gad";
send host-name  "asdfl87Gad";
request subnet-mask, broadcast-address, time-offset, routers,
#       domain-name, domain-name-servers, domain-search, host-name,
        domain-name, domain-name-servers, domain-search,
#       dhcp6.name-servers, dhcp6.domain-search, dhcp6.fqdn,
dhcp6.sntp-servers,
... (SNIP) ...

/etc/NetworkManager/system-connections/Guest

[connection]
id=Guest
uuid=[__MASKED__]
type=wifi
autoconnect=false
permissions=user:kubuntu:;
secondaries=

[wifi]
mac-address-blacklist=
mac-address-randomization=0
mode=infrastructure
seen-bssids=
ssid=Guest

[ipv4]
dhcp-client-id=asdfl87Gad
dhcp-hostname=asdfl87Gad
dhcp-send-hostname=false
dns-search=
ignore-auto-dns=true
may-fail=false
method=auto

[ipv6]
addr-gen-mode=stable-privacy
dns-search=
method=link-local


/var/lib/NetworkManager/dhclient-wlp3s0.conf

# Created by NetworkManager
# Merged from /etc/dhcp/dhclient.conf

# Configuration file for /sbin/dhclient.
#
# This is a sample configuration file for dhclient. See dhclient.conf's
#       man page for more information about the syntax of this file
#       and a more comprehensive list of the parameters understood by
#       dhclient.
#
# Normally, if the DHCP server provides reasonable information and does
#       not leave anything out (like the domain name, for example), then
#       few changes must be made to this file, if any.
#
option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;
#send host-name = gethostname();
supersede host-name "asdfl87Gad";
send host-name  "asdfl87Gad";
request subnet-mask, broadcast-address, time-offset, routers,
#       domain-name, domain-name-servers, domain-search, host-name,
domain-name, domain-name-servers, domain-search,
#       dhcp6.name-servers, dhcp6.domain-search, dhcp6.fqdn,
dhcp6.sntp-servers,
... (SNIP) ...
send dhcp-client-identifier "asdfl87Gad"; # added by NetworkManager

option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;
option ms-classless-static-routes code 249 = array of unsigned integer 8;
option wpad code 252 = string;

also request rfc3442-classless-static-routes;
also request ms-classless-static-routes;
also request static-routes;
also request wpad;
also request ntp-servers;

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to