Some notes for reference:

We might actually have some trouble in expressing the Lifetime of an
Address in the Netplan schema. From the Netplan Reference [0] we can see
that the 'addresses:' field accepts a list of mixed IPv4 and IPv6
addresses. We can't just add a 'lifetime:' field to the schema, because
then we wouldn't have a way to link that value to one of the addresses
in the mixed list. I can see a few different ways to change the
configuration to accommodate the lifetime change:

1) Implement a list of lifetimes, which would "follow" the list of addresses
  (i.e. lifetime[0] corresponds to addresses[0] and so on)

2) Modify the address syntax inside the list to allow an optional lifetime, 
e.g.:
  addresses: [127.0.0.1 (forever), "2001:1::1/64 (0)"]

3) Allow the definition of an address+lifetime mapping and use that in the
'addresses' field, e.g.:
  myaddr:
    value: 127.0.0.1
    lifetime: 0
  ...
  addresses: [ myaddr, 2001:1::1/64 ]

Option 1 has the obvious problem of matching one lifetime to a list of
multiple addresses. Say we want to specify a lifetime to address number
K in the list, would we need to specify a lifetime for all of them? How
would we "skip" default lifetimes with this approach?

Option 2 has the benefit of being somewhat compatible with the current
schema in the sense that if no lifetime is specified, we can keep the
current behavior. I feel like it would introduce a lot of complexity in
the schema parsing code to sort the addresses from the lifetime though,
and this might not be something that we want in a sensitive code
section.

Option 3 looks very flexible, but I'm not familiar enough with the
schema and its parsing code to estimate the impact that would have. I
think we would need quite a few significant changes, and I'm not really
sure where we would place the 'myaddr' definition in the schema either.

None of the above options feel like a good way to solve the lifetime
problem, but I'm not sure we have an easy way to integrate that into the
current netplan schema. Perhaps someone more experienced with the
Netplan schema/codebase might offer better insight on how to tackle this
issue.

[0] https://netplan.io/reference

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1803203

Title:
  Support preferred_lft for IPv6 addresses

Status in netplan:
  New
Status in netplan.io package in Ubuntu:
  In Progress
Status in systemd package in Ubuntu:
  Fix Released

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=2001:db8::2/32
  Gateway=2001:db8::1/32
  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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/netplan/+bug/1803203/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to