In some instances, network administrators may desire more control over address allocation than SLAAC or stateless DHCP offers. In this guide, I'm going to do a quick rundown on how to configure a stateful DHCPv6 server on VyOS 1.5.
This guide assumes the reader understands not only IPv6 networking but also the differences between fully automatic, assisted and managed address configuration. The guide also assumes you have at least one client-facing interface already configured. For reference, our router will have the following interface example configurations:
Where eth0 is configured as a DHCPv6-PD client. Obviously replace the addresses with your prefix.
show interfaces ethernet eth1
Which should return something like:
eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether bc:24:12:dc:26:0c brd ff:ff:ff:ff:ff:ff
altname eth0
inet6 fd34:5678:9abc:de00::1/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::bc24:11ff:fedf:130c/64 scope link
valid_lft forever preferred_lft forever
RX: bytes packets errors dropped overrun mcast
0 0 0 0 0 0
TX: bytes packets errors dropped carrier collisions
0 0 0 0 0 0
Now let's setup our DHCPv6 server.
Enter configuration mode
config
Create the server and assign it to the LAN interface. Replace LAN1 with your specific shared network name.
set service dhcpv6-server shared-network-name LAN1 interface eth1
Set the address lease time in seconds
set service dhcpv6-server shared-network-name LAN1 subnet fd34:5678:9abc:de00::/64 lease-time default 2073600
Set the DNS servers that clients will be told to use. In this example we're using Quad9 privacy DNS
set service dhcpv6-server shared-network-name LAN1 subnet fd34:5678:9abc:de00::/64 option name-server '2620:fe::fe'
set service dhcpv6-server shared-network-name LAN1 subnet fd34:5678:9abc:de00::/64 option name-server '2620:fe::9'
Set our address pool range. Note: VyOS allows you to carve out multiple ranges/pools from the same subnet, however we will not be covering that in this guide.
set service dhcpv6-server shared-network-name LAN1 subnet fd34:5678:9abc:de00::/64 range 1 start 'fd34:5678:9abc:de00::5'
set service dhcpv6-server shared-network-name LAN1 subnet fd34:5678:9abc:de00::/64 range 1 stop 'fd34:5678:9abc:de00::100'
Assign a subnet ID. Normally a subnet ID is used for a prefix delegation server as part of the address synthesis. However, VyOS still requires one despite the fact that we are not handing out entire prefixes to our clients.
set service dhcpv6-server shared-network-name LAN1 subnet fd34:5678:9abc:de00::/64 subnet-id '1'
Save our progress
commit
In the IPv6 world, router advertisements (RAs) are required for all three forms of automatic address configuration. So even though our clients get all their configuration attributes from the DHCP server, we still need to inform them how our network is set up. Without a correctly configured RA, our client will not know if our network is using SLAAC, assisted or managed DHCPv6.

Setup RA service on the LAN interface
set service router-advert interface eth1
Set our RAs to tell clients we are using managed DHCPv6
set service router-advert interface eth1 managed-flag
set service router-advert interface eth1 other-config-flag
Set our DNS servers. Though redundant, some clients still expect to get DNS information from the RA despite the fact that we're supplying it via DHCP.
set service router-advert interface eth1 name-server '2620:fe::fe'
set service router-advert interface eth1 name-server '2620:fe::9'
Set the prefix and route advertisement.
set service router-advert interface eth1 prefix fd34:5678:9abc:de00::/64 no-autonomous-flag
Note: At the end of this command we have "no-autonomous-flag." This instructs clients not to derive privacy addresses from their IID. Without this flag clients will auto-assign addresses in addition to the /128 our server will lease them.
set service router-advert interface eth1 route fd34:5678:9abc:de00::/64
Commit our configuration and apply it.
commit
save && exit
At this point you should have DHCPv6 service up and running. The scope of this guide will not cover troubleshooting, however, I'll provide a few pointers if you find yourself unable to get the service functioning:
sudo rdisc6 -m <interface>In the next post we'll cover RA guarding. So stay tuned to see how to harden your IPv6 network.