Router Advertisement Daemon

From LinuxReviews
Jump to navigationJump to search

radvd (Router Advertisement Daemon) is a simple Linux/UNIX daemon capable of providing stateless IPv6 address auto-configuration, a default route and, optionally, DNS, to a local network. A /64 subnet is required to use radvd.

Installation[edit]

radvd is available in the repositories of all the big GNU/Linux distributions and the package is named radvd on all of them (apt-get install radvd or yum install radvd or <code< dnf install radvd or emerge radvd or pacman -S radvd depending on distribution).

radvd is configured using /etc/radvd.conf

The basics[edit]

radvd should be configured to advertise a /64 prefix to a local network. You will need a /64 subnet for each network interface on a router with several local networks or VLANs. You simply can't use anything smaller like a /96 for IPv6 stateless auto-configuration.

A very basic bare-bones example that will let devices connected to a network interface called br0 can look like:

File: /etc/radvd.conf
interface br0
{
    AdvSendAdvert on;
    prefix 2001:2002:51ed:0cee0::/64
    {
        AdvOnLink on;
        AdvAutonomous on;
        AdvRouterAddr on;
    };
};

The above example does not advertise DNS servers. radvd will advertise DNS servers to the local network if DNS servers are set by RDNSS.

The example below includes a RDNSS and several other options that assume your IPv6 prefix is fixed and will not be changing any time soon.

MinRtrAdvInterval and MaxRtrAdvInterval configure, in seconds, how frequently radvd sends route advertisements. AdvDefaultLifetime tells clients how long they can expect an advertised route to be valid. 9000 (18.2 hours) is the maximum you can configure.

AdvDefaultPreference can be low, medium or high. It does not make any difference when you are the only router on the network.

File: /etc/radvd.conf
interface br0
{
    AdvSendAdvert on;
    MinRtrAdvInterval 10;
    MaxRtrAdvInterval 30;
    AdvDefaultPreference high;
    AdvDefaultLifetime 9000;
    prefix 2001:2002:51ed:cee0::/64
    {
        AdvOnLink on;
        AdvAutonomous on;
        AdvValidLifetime infinity;
        AdvRouterAddr on;
    };
    RDNSS 2001:2002:51ed:cee0::1 2606:4700:4700::1111 2606:4700:4700::1001 {};
};

The Linux kernel supports state-less auto-configuration. Linux machines and Android devices will simply configure a IP address and the default route with no user intervention (as long as net.ipv6.conf.all.autoconf is 1, which is the default).

There is a chance Linux clients will NOT auto-configure DNS servers provided by radvd. NetworkManager can do it. The very small tool called rdnssd client computers can use to auto-configure DNS servers provided by radvd.

The RDNSS option needs to have a details section even if it is empty ({};).

The prefix must be /64[edit]

It must be noted that the prefix must be /64. This is because 64 bits are used to generate the last part of the address using the network cards ID (you can't announce a /48 or /80 prefix with radvd).

More information[edit]


Topic: IPv6

How to get it

How to configure it

IPv6 services