/etc/NetworkManager/NetworkManager.conf
file to contain the following default settings for new connections:
[connection] ipv4.dhcp-send-hostname=false ipv6.dhcp-send-hostname=falseDisable sending hostname to DHCP server for already existing connections:
nmcli -t -f uuid connection | while read uuid; do nmcli connection modify $uuid \ ipv4.dhcp-send-hostname false \ ipv6.dhcp-send-hostname false doneRestart NetworkManager to apply the settings:
systemctl restart NetworkManager
Editing default settings in NetworkManager.conf only works for certain properties (those mentioned in `man NetworkManager.conf`). It doesn't work for dhcp-send-hostname for example.
ReplyDeleteRestarting NetworkManager is almost always wrong too. To reload NetworkManager.conf do `killall -SIGHUP NetworkManager`. To re-apply configuration changes re-activate the connection in question (`nmcli connection up`, `nmcli device connect`, or `nmcli device reapply`).
Thanks Thomas! What would be the best way to disable dhcp-send-hostname for new connections by default?
ReplyDelete