1

I want to create an IPv6 equivalent of a simple DHCP IPv4 network in systemd-networkd with a server host handing out IPv6 addresses, and a number of clients automatically picking up addresses.

In IPv4 this is simple, and just requires a DHCP server/client and a pool of IPv4 addresses. So far I haven't been able to reproduce the same thing in the IPv6 world. I'm following the systemd-network documentation, which suggests using 'IPv6AcceptRA'

server .network config

[Match]
Name=enp0s4

[Network]
Address=fd00:1::/64
IPv6PrefixDelegation=yes

[IPv6Prefix]
Prefix=fd00:1::/32

[IPv6PrefixDelegation]
RouterLifetimeSec=20

client .network config

[Match]
Name=enp0s4

[Network]
IPv6AcceptRA=yes

With this setup the server seems to come up OK:

# ip a
...
3: enp0s4: <BROADCAST,MULTICAST,UP,LOWER_UP8000> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether ca:fe:b9:4d:9d:6f brd ff:ff:ff:ff:ff:ff
    inet6 fd00:1::/64 scope global tentative flags 08 
       valid_lft forever preferred_lft forever
    inet6 fe80::c8fe:b9ff:fe4d:9d6f/64 scope link tentative flags 08 
       valid_lft forever preferred_lft forever
...

but the client doesn't get an address:

# ip a
...
3: enp0s4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether ca:fe:10:2a:af:27 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::c8fe:10ff:fe2a:af27/64 scope link tentative flags 08 
       valid_lft forever preferred_lft forever
...

Should this work, or is there a better way to solve this problem?

  • Set DHCP=yes instead of IPv6AcceptRA=yes in your configuration file. then restart the systemd-networkd.service – GAD3R Mar 27 '18 at 9:27
  • DHCP=yes doesn't work for me. With that on the client and the same server config, I get the same outcome – Phil Mar 27 '18 at 11:31
  • Don't use fd00:1::. That defeats the purpose. Generate your ULA properly. – Michael Hampton Mar 27 '18 at 16:59
  • Systemd-networkd does not function as a DHCPv6 server, so you will need to find some other piece of software for this. RA stands for Router Advertisement, which is used with Stateless Address Autoconfiguration (SLAAC). SLAAC is complementary to DHCPv6, which is stateful (i.e. the DHCPv6 server keeps state of which client have been assigned which address). RA messages are sent by routers, which the clients use to autoconfigure themselves. Prefix delegation is a router to router only mechanism, used for subnetting. The upstream router "delegates" a subnet to a downstream router. – Johan Myréen Mar 27 '18 at 18:44
  • My original plan was to statically assign a private IPv6 address range to the server, then use SLAAC to hand out IPv6 addresses to the clients, but perhaps that isn't the way it is intended to work? My only requirement is that a bunch of 'clients' and one 'server' can come online and communicate over IPv6 (the addresses don't matter because they already have a discovery mechanism). I don't know what the standard way to solve this on a IPv6 network is though--on IPv4 it is easy: DHCP and a private subnet. – Phil Mar 29 '18 at 14:45
1

Install radvd or some other router advertisement daemon on the server, configure it to hand out your ULA prefix, and you are ready to go. The clients get their addresses via SLAAC. Alternatively, install and configure an IPv6 capable DHCP server.

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.