Skip to content

nettwork: introduce delegated prefix assign#14956

Merged
cdown merged 5 commits intosystemd:masterfrom
ssahani:delegated-prefix-14474
Mar 6, 2020
Merged

nettwork: introduce delegated prefix assign#14956
cdown merged 5 commits intosystemd:masterfrom
ssahani:delegated-prefix-14474

Conversation

@ssahani
Copy link
Contributor

@ssahani ssahani commented Feb 27, 2020

Expose a boolean flag to automatically add an address from the delegated prefix to the interface.

➜  network cat veth0.network 
[Match]
Name=veth0

[Network]
IPv6PrefixDelegation=yes
IPv6PrefixAssign=yes
IPv6Token=::1

[IPv6PrefixDelegation]
DNS=_link_local 2002:da8:1:0::1
DNSLifetimeSec=1min

[IPv6Prefix]
Prefix=2002:da8:1:0::/64
PreferredLifetimeSec=1000s
ValidLifetimeSec=2100s
: veth0@veth99: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 42:65:85:d6:4e:32 brd ff:ff:ff:ff:ff:ff
    inet 192.168.5.1/24 brd 192.168.5.255 scope global veth0
       valid_lft forever preferred_lft forever
    inet6 2002:da8:1:0:4065:85ff:fed6:4e32/64 scope global 
       valid_lft forever preferred_lft forever
    inet6 fe80::4065:85ff:fed6:4e32/64 scope link 
       valid_lft forever preferred_lft forever

closes #14474

Copy link
Member

@yuwata yuwata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Only nitpicky comments.

@yuwata yuwata added the reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks label Feb 27, 2020
@ssahani ssahani force-pushed the delegated-prefix-14474 branch from 8a2ae8a to 30a3456 Compare February 28, 2020 02:45
@ssahani
Copy link
Contributor Author

ssahani commented Feb 28, 2020

updated thanks for the review @yuwata

@yuwata yuwata removed the reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks label Feb 28, 2020
@yuwata yuwata force-pushed the delegated-prefix-14474 branch from 127463c to b4d56a6 Compare February 28, 2020 11:22
@yuwata
Copy link
Member

yuwata commented Feb 29, 2020

After reconsidering this PR, now I think the new setting should be in [IPv6Prefix] section, rather than [Network] section. Then, per-prefix control to assign the address becomes possible. If you agree with that, I will update the commits (and add a test case). WDYT?

@ssahani
Copy link
Contributor Author

ssahani commented Feb 29, 2020

Yes makes sense thanks.

@yuwata
Copy link
Member

yuwata commented Feb 29, 2020

OK. I will slightly update them.

@yuwata yuwata force-pushed the delegated-prefix-14474 branch from b4d56a6 to 8acf50b Compare February 29, 2020 15:47
@yuwata
Copy link
Member

yuwata commented Feb 29, 2020

@ssahani Updated. PTAL.

ssahani and others added 3 commits March 1, 2020 00:49
@yuwata yuwata force-pushed the delegated-prefix-14474 branch from 8acf50b to 3c874fd Compare February 29, 2020 15:49
@ssahani
Copy link
Contributor Author

ssahani commented Feb 29, 2020

Perfect

@cdown cdown merged commit 5bb67b1 into systemd:master Mar 6, 2020
@artizirk
Copy link

artizirk commented Mar 6, 2020

Im not very familiar with the code but can the IPv6Token option still be used to specify static suffix for the generated address?

@yuwata
Copy link
Member

yuwata commented Mar 6, 2020

No. The suffix is eui64, that is, generated from MAC address.

@ssahani ssahani deleted the delegated-prefix-14474 branch March 7, 2020 02:06
@sermolenko
Copy link

sermolenko commented Mar 16, 2020

After reconsidering this PR, now I think the new setting should be in [IPv6Prefix] section, rather than [Network] section. Then, per-prefix control to assign the address becomes possible. If you agree with that, I will update the commits (and add a test case). WDYT?

How does this work with dhcpv6-delegated prefixes from other interface then? I thought [IPv6Prefix] section is only for static prefixes.
With the new option to assign the address living in IPv6Prefix section, it seems it just does not work for the delegated ones.

@donbowman
Copy link

so with this:

[IPv6Prefix]
Prefix=2607:fea8:1de1:1100::/64
Assign=yes

it works, my /56 is delegated etc.
But, if I don't put Prefix= here, then the upper bits are 0, and I end up with ::MAC, which doesn't work.
What am I missing?

On the wan interface,

[DHCPv6]
PrefixDelegationHint=::/56
ForceDHCPv6PDOtherInformation=yes

is used, which gets the /56 from the ISP, but, each of the LAN interfaces don't end up w/ an IP assigned in their respective ranges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

Auto configure delegated IPv6 address on interface

7 participants