You are not logged in.

#1 2018-04-03 23:11:01

Archange
Package Maintainer (PM)
Registered: 2014-08-17
Posts: 40

How to avoid NetworkManager sending my hostname in DHCP request?

Everything is in the title.

Offline

#2 2018-04-04 00:09:03

jsoy9pQbYVNu5nfU
Member
Registered: 2013-04-19
Posts: 108

Re: How to avoid NetworkManager sending my hostname in DHCP request?

plasma-nm implements a field <DHCP client ID> in the IPv4 tab of ethernet/wireless connections. Try entering a dummy token there.

If that's not effective or not desirable: If the hostname in an intial DHCP request depends entirely on the client implementation. You may try to start nm with a file in /etc/NetworkManager/conf.d with the contents

[main]
hostname-mode=none # or dhcp

If the internal DHCP client does then not behave as desired, I suggest you can investigate if switching the DHCP client to dhclient or dhcpd allows you to pass in additional options, for example via the environment.

Otherwise, submit a patch to nm upstream to expose an appropriate option…

Note that some DHCP servers misbehave if the requesting client does not send a hostname.

Last edited by jsoy9pQbYVNu5nfU (2018-04-04 00:09:43)

Offline

#3 2018-04-04 08:11:44

Archange
Package Maintainer (PM)
Registered: 2014-08-17
Posts: 40

Re: How to avoid NetworkManager sending my hostname in DHCP request?

Actually my problem is the other way around: this DHCP server misbehave if you send a clientid or duid, and I believe hostname too. I had already `hostname-mode` set, but it had no effect. Using dhcpcd doesn’t work either (though it works manually), but dhclient did apparently. I might still ping upstream about this for the internal dhcp client though.

Offline

#4 2018-04-04 10:44:20

nl6720
The Evil Wiki Admin
Registered: 2016-07-02
Posts: 596

Re: How to avoid NetworkManager sending my hostname in DHCP request?

There is no global way to not send hostname to dhcp server ( https://bugzilla.gnome.org/show_bug.cgi?id=768076 ).  sad
You can only specify to not send hostname per connection.

Edit your connection file in /etc/NetworkManager/system-connections/ and specify this option:

[ipv4]
dhcp-send-hostname=false

Offline

#5 2018-04-04 11:11:24

Archange
Package Maintainer (PM)
Registered: 2014-08-17
Posts: 40

Re: How to avoid NetworkManager sending my hostname in DHCP request?

@nl6720: Thanks for this valuable input. Do you know whether there is a way to avoid sending duid/clientid too? I cannot find similar settings for this.

Offline

#6 2018-04-04 11:13:35

nl6720
The Evil Wiki Admin
Registered: 2016-07-02
Posts: 596

Re: How to avoid NetworkManager sending my hostname in DHCP request?

Don't know if you can prevent sending duid/clientid. Try looking in the nm-settings(5) man page.

Offline

#7 2018-04-04 11:16:27

Archange
Package Maintainer (PM)
Registered: 2014-08-17
Posts: 40

Re: How to avoid NetworkManager sending my hostname in DHCP request?

That’s were I was looking, but the only related option (dhcp-client-id) is for setting the client-id and does not allow a specific value to disable sending it. Guess I’m going to open a bug report.

Offline

Board footer

Powered by FluxBB