Linux IPv6 Router: RADVD + DHCPv6

3.25 avg. rating (70% score) - 4 votes

Unlike IPv4, which uses DHCP for configuration, IPv6 uses the Neighbor Discovery Protocol to configure addresses and gateways. Unfortunately, originally the protocol had no means of providing addresses of DNS servers to clients, making it necessary to use  DHCPv6 for that purpose. Modern Linux and Mac OS X machines are able to use the IPv6 Router Advertisement Options for DNS Configuration (RFC 6106), but to my knowledge, Windows clients are not able at the moment. Here’s how to configure a Linux router using radvd and the ISC DHCP daemon.

Network Configuration and Packet Forwarding

The following configuration has been tested with Ubuntu Server 12.04.2 LTS. For the purposes of this article, the /etc/network/interfaces file looks like this:

Outbound interface is eth0, and inbound interface eth1.

First, to enable IPv6 packet forwarding, put this in your /etc/sysctl.conf:

And run this to make the change in the running kernel:

IPv6 Router Advertisement Daemon

Install the router advertisement daemon or radvd with:

Create file /etc/radvd.conf and put your internal interface and prefix there:

You can now start the daemon with

That will enable router advertisements on the internal interface. See example configuration files under /usr/share/doc/radvd/examples. See also manual pages for radvd(8) and radvd.conf(5) for more information. The radvdump(8) is a useful tool for watching live router advertisement traffic.

The RDNSS and DNSSL Options

Below is an example radvd.conf which also advertises DNS servers with RDNSS and DNS search path with DNSSL, both of which are specified in RFC 6106. This will work with Linux and Mac OS X clients, but unfortunately Windows does not seem to support it.

Restart radvd.

DHCPv6

To support Windows, we must install a DHCPv6 compliant DHCP server, such as a recent version of the ISC DHCP daemon:

Create file /etc/dhcp/dhcpd6.conf and put something like this in there:

We configured a pool of 4096 addresses here (::1000-1fff), plus DNS servers and search path.

Start the dhcpv6 server:

If it fails, see /var/log/syslog for error messages. Finally, if everything went ok, add to default runlevels:

Now you should be able to get an IPv6 address and DNS servers with a DHCP client. Additional benefit with DHCP is that you can send more configuration information, such as time server addresses, using DHCP options.

3 thoughts on “Linux IPv6 Router: RADVD + DHCPv6”

  1. What if I want to use radvd to configure the subnet (via router advertisements) AND dhcpd just to configure the DNS server (option dhcp6.name-server)?

Leave a Reply