NetworkManager does not merge dhclient config correctly

Asked by ts

Adding a lease section to a dhclient config file does not work, the closing bracket is not merged into the generated config file, leading to a broken config file. Is this a bug?

More specific: Trying to add a static fallback IP in case DHCP does not work. I added into /etc/dhcp/dhclient.conf:
lease {
  interface "eno2";
  fixed-address 10.0.0.100;
  option subnet-mask 255.0.0.0;
  option routers 10.0.1.1;
  option domain-name-servers 10.0.1.1;
  renew 2 2025/1/12 00:00:01;
  rebind 2 2025/1/12 00:00:01;
  expire 2 2025/1/12 00:00:01;
}

In the resulting merged config file for the eno2-interface /var/lib/NetworkManager/dhclient-eno2.conf, the closing "}" is missing, so the file is broken. Running dhclient manually does work.

------------------------------
Ubuntu release: 18.04
Package version: network-manager 1.10.6-2ubuntu1

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

I suggest you report a bug

Can you help with this problem?

Provide an answer of your own, or ask ts for more information if necessary.

To post a message you must log in.