Support preferred_lft for IPv6 addresses
Bug #1803203 reported by
Andy Smith
This bug affects 3 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Netplan |
Fix Released
|
Undecided
|
Unassigned | ||
netplan.io (Ubuntu) |
Fix Released
|
Medium
|
Heitor Alves de Siqueira | ||
systemd (Ubuntu) |
Fix Released
|
Medium
|
Dimitri John Ledkov |
Bug Description
There doesn't currently seem to be any way to set the preferred_lft of an IPv6 address.
With the "ip" command it might be, for example:
# ip address add 2001:db8::2/32 dev eth0 preferred_lft 0
In a systemd unit file it might be:
[Match]
Name=eth0
[Network]
Address=
Gateway=
PreferredLifetime=0
but I can't find any way to express this with netplan.
This is commonly used for per-service IP addresses that should never be used as source addresses for outgoing traffic.
Changed in netplan: | |
status: | New → Confirmed |
Changed in netplan: | |
status: | Confirmed → In Progress |
status: | In Progress → Invalid |
Changed in systemd (Ubuntu): | |
assignee: | nobody → Dimitri John Ledkov (xnox) |
status: | New → In Progress |
Changed in systemd (Ubuntu): | |
importance: | Undecided → Medium |
tags: | added: sts |
tags: | removed: sts |
tags: | added: sts |
Changed in systemd (Ubuntu): | |
status: | In Progress → Fix Released |
Changed in netplan.io (Ubuntu): | |
assignee: | nobody → Heitor Alves de Siqueira (halves) |
importance: | Undecided → Medium |
Changed in netplan: | |
status: | New → Fix Released |
To post a comment you must log in.
Hi Andy,
I have another user reporting exactly the same issue and with exactly the same requirement to set the source address for outgoing traffic, so I have set the issue as Confirmed.
I want to discuss the best way to achieve what you want. Do you actually want to be able to set a non-zero lifetime, or do you just want to be able to set the lifetime to zero to disable using that address as a source address?
If you just want to be able to disable an address for use as a source address, that's at least conceptually simple, but I don't have a good way to describe it in the YAML at the moment that doesn't require rewriting large parts of the parser.
If you want to be able to set a non-zero preferred lifetime, I have some follow-up questions:
- What should the behaviour be when you run netplan apply after the system has booted? Currently it will restart systemd-networkd, which will delete and re-add the address, which will have the effect of resetting the timer.
- Do you expect something to happen when the preferred lifetime expires? There's no way to describe an action to happen afterwards, so it would be very easy to accidentally specify a configuration that cuts the interface off from IPv6 after some time.
Regards,
Daniel