Need to have an IP address assigned when link is down

Bug #1997024 reported by Kirill Didkovsky
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Netplan
Triaged
Wishlist
Danilo Egea Gondolfo

Bug Description

When configuring network via /etc/network/interfaces (in Ubuntu 12.04-16.04), an IP address was assigned to the interface. When the cable was not connected, the IP address was still visible, and one could query whether it's up or down.

When the networking is configured via netplan (either via networkd or via NetworkManager), an IP address is assigned to the connection, so when there's no cable connected, there's no IP address assigned. The only working way to assign an address that doesn't disappear on link down I've found is via 'ip addr add' command, which is inconvenient because it's not persistent.

If there's a way of assigning a permanent (not link-dependent) IP address to an interface, it should be described in the documentation. If there's no such way, probably it needs to be implemented. There's some software on the market that uses IP addresses as a way of node identification, and link-dependand address assignment greatly interferes with such approach.

Revision history for this message
Lukas Märdian (slyon) wrote :

Thank you for the bug report, I wonder if systemd-networkd's ActivationPolicy [0] setting would make any difference in your setup? As controlled by Netplan's "activation-mode" setting. Maybe in addition to the "ignore-carrier"[1] / "ConfigureWithoutCarrier" setting.

[0] https://www.freedesktop.org/software/systemd/man/systemd.network.html#ActivationPolicy=
[1] https://netplan.io/reference
[2] https://www.freedesktop.org/software/systemd/man/systemd.network.html#ConfigureWithoutCarrier=

Changed in netplan:
status: New → Incomplete
Changed in netplan:
assignee: nobody → Danilo Egea Gondolfo (danilogondolfo)
tags: added: foundations-todo
Revision history for this message
Danilo Egea Gondolfo (danilogondolfo) wrote :

Thanks for your bug report.

You can use the Netplan option 'ignore-carrier: true' to achieve this. This option is available since Netplan 0.104 and works with networkd.

Setting ignore-carrier to true will include the networkd option ConfigureWithoutCarrier to its configuration file.

As stated in [0], when ConfigureWithoutCarrier is set to true, and IgnoreCarrierLoss is not explicitly set, IgnoreCarrierLoss is also set to true. This will prevent networkd to remove the IP from the interface when it disconnects.

[0] - https://systemd.network/systemd.network.html#ConfigureWithoutCarrier=

Revision history for this message
Kirill Didkovsky (kdidkovsky) wrote :

Thanks a lot!

Netplan's 'ignore-carrier' option is exactly what I was looking for! I think the best solution to the request would be to add some info on this option to the netplan docs - it exists, but it's quite difficult to find. Some link on more often accessed pages would be quite handy.

By the way, is there a similar solution for NetworkManager backend?

Revision history for this message
Danilo Egea Gondolfo (danilogondolfo) wrote :

I agree that the documentation could be more explicit about this behavior, I will look into that.

Now, it's also possible to disable carrier detection in Network Manager [0]. Although, Netplan doesn't support it yet. In NM you need to add a config to the conf.d directory defining a list of interfaces for which NM should ignore carrier. I believe it would be a nice addition to Netplan so I will add it to our feature request backlog :)

[0] - https://networkmanager.dev/docs/admins/#server-like-behavior

Changed in netplan:
importance: Undecided → Wishlist
Lukas Märdian (slyon)
Changed in netplan:
status: Incomplete → Triaged
Lukas Märdian (slyon)
tags: removed: foundations-todo
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.