This is an old revision of the document!
IPv6 prefix delegation and subnetting
Subnetting is one of the tools you can use as part of segmenting a LAN in e.g a DMZ, a subnet for IoT devices etc. In this note I'll explain how I did it in IPv6 using Prefix Delegation.
I took this opportunity to learn more about it. I set up the following test network using VirtualBox: (main router is a real host; the virtual hosts (Netn) run on my workstation)
My ISP has given me a /48 delegation as per RIPE recommendation. I want to subdivide this so that the first subnet level attached to my LAN ('LAN' on the picture) gets a /56 delegation and subnets created under one of these /56 subnets will get /60 delegated.
My initial intention was do do all of it using systemd-networkd only but I very quickly found out that this was not possible with the present (July 2022) version of systemd (251.2). Networkd (as I'll call systemd-networkd in the following) has both a DHCP server and a DHCP client for IPv4 but only a DHCP client for IPv6. So I used ISC's dhcp package as DHCP server for IPv6.
In the following I'll treat the router one by and and highlight what is essential to get this router to work the way I want it.
Main router (Rm)
The main router is a physical host that runs Gentoo. Its network interfaces are all configured using networkd.
It receives a /48 prefix from the ISP and is configured to delegate /56 prefixes if so asked. This router does not use networkd's DHCPv4 server as that server cannot serve static IPv4 addresses. Instead the DHCP server from ISC is also used in IPv4 mode.
The configuration files are here: Main Router