3

My new ISP gives me a public IPv6 address with a /56 prefix to play around:

2001:b:c:d:5:6:7:8/56

I would like to create two subnets divided by a linux server like this:

internet - fritzbox - server - pc

But I need to understand how to propagate a prefix to the internal subnet. So far, I configured the external interface of my server to accept router advertisments and request an IPv6 prefix from the Fritz!Box:

/etc/systemd/network/eth1.network

[Match]
Name=eth1

[Network]
DHCP=ipv6
IPv6AcceptRA=yes
IPv6PrefixDelegation=dhcpv6
IPForward=yes

After a systemctl restart systemd-networkd the externel interface gets an address:

ip -6 addr
  ...
  inet6 2001:b:e:f:1:2:3:4/64 scope global noprefixroute dynamic

Is this correct so far? Also confusing: The prefix of the internet connection and of the interface differ in the second half:

internet: 2001:b:c:d::
server:   2001:b:e:f::

Now the main question: How do I configure the internal interface? Can it request another prefix from the Fritz!Box?

/etc/systemd/network/eth0.network

[Match]
Name=eth0

[Network]
???

My server is running Debian stretch with systemd 239 from stretch-backports (because 232 in stable does not yet support prefix delegation). I removed the ifupdown package because my goal is to learn how to solve this with systemd-networkd only.

3
  • How related is your question to mine here: serverfault.com/questions/914703/… ? Just wondering.
    – TCB13
    Jul 3 '19 at 13:31
  • We have the same problem, your try to solve with ifupdown and I with systemd-networkd. Conensus seems to be, that Linux support for prefix delegation is not mature and that you need dedicated hardware or something more sophisticated like OpenWRT.
    – Frank
    Jul 5 '19 at 12:13
  • Hmm interesting, I was going to read a bit about IPv6 on systemd-networkd and give it a try but since you already did we're left with nothing. What I don't get is why the PD support in linux isn't "mature", OpenWRT isn't that sophisticated , it looks like a slimmed down version of our server-grade systems with a bunch of hacks. I don't also believe that there isn't a single person on the planet that shares our use case.
    – TCB13
    Jul 5 '19 at 16:08
1

I've spent the last few days figuring out a similar configuration.

As of this writing, there's a bug in systemd-networkd where it won't put a delegated-prefix address on the interface that is handing out prefixes. However, the interface does give out prefixes to devices on the network segment.

Your external interface's IPv6 address not matching the prefix is due to your ISP's configuration of the network. My ISP gives out two different DHCPv6 address blocks, one of them is the same as the prefix given for delegation, the other is not. It randomly changes when the DHCPv6 lease expires.

The configuration I used I got from the Archlinux Wiki First you configure your "external" interface (the one connected to the Fritz!box)

/etc/systemd/network/EXTERNAL.network
[Match]
...
[Network]
DHCP=yes
IPForward=yes
IPv6AcceptRA=yes
IPv6DuplicateAddressDetection=1
IPv6PrivacyExtensions=kernel

The code you already have for eth1 looks correct (assuming eth1 is your external interface). In my configuration, I enabled both DHCPv4 and DHCPv6 clients on my interface.

Now your internal interface should be configured like so:

/etc/systemd/network/INTERNAL.network
[Match]
...
[Network]
IPv6PrefixDelegation=dhcpv6
IPv6DuplicateAddressDetection=1
IPv6PrivacyExtensions=no
LinkLocalAddressing=ipv6

[IPv6PrefixDelegation]
RouterLifetimeSec=3600

The RouterLifetimeSec is important because it's what configures the interface to give out the prefixes it receives from the DHCPv6 interface.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.