Bering-uClibc 7.x - User Guide - IPv6 Networking - Configure Router Advertisements

From bering-uClibc
Jump to: navigation, search
IPv6 Networking - Configure Router Advertisements
Prev Bering-uClibc 7.x - User Guide Next


Introduction

Every IPv6 router should be configured to run a Router Advertisement daemon in order to comply with the Router Discovery (RD) aspects of Neighbor Discovery (ND) as defined in RFC 2461. In broad terms the IPv6 Neighbor Discovery Protocol (NDP) is equivalent to the IP(v4) Address Resolution Protocol (ARP).

Without Router Advertisements, IPv6-capable clients typically allocate a single link-local IPv6 address to each network interface, since they do not know what global IPv6 address range to use or what their Default Gateway is. Router Advertisements provide that information and also include other configuration flags which can enable additional IPv6 configuration behaviour such as DHCPv6.

If everything is working properly hosts will automatically derive their own IPv6 addresses based on the defined prefix in addition to allocating link-local addresses to each network interface.

Router Advertisement Software Candidates

There are two main candidates for Router Advertisement software for Linux and hence for Bering-uClibc 7.x:

  • Radvd
    • Until recently the only practical option for implementing Router Advertisement functionality on Linux.
    • Available from Bering-uClibc 4.0 onwards.
  • Dnsmasq
    • This started to support IPv6 and Router Advertisements at version 2.60.
    • Available from Bering-uClibc 4.3 onwards.

Of the two, dnsmasq is generally preferred because most Bering-uClibc 7.x systems already include a dnsmasq installation and because most Bering-uClibc 7.x users are familiar with the dnsmasq configuration syntax. A further benefit is that dnsmasq also contains in-built DHCPv6 capabilities whereas radvd needs to be partnered with additional software if DHCPv6 functionality is required.

Radvd is still supported as an alternative for advanced userse who are familiar with the Radvd configuration syntax from elsewhere, or who need more control over the Router Advertisement configuration.

Dnsmasq

Configuration

The IPv6 entries are simply added to the standard dnsmasq configuration file, /etc/dnsmasq.conf.

Basic Router Advertisements

To enable basic Router Advertisement behaviour add a line like the following (replace 2001:db8:1:1:: with your own IPv6 network address.):

dhcp-range=2001:db8:1:1::, ra-only

Multiple lines can be added (with different addresses) if you wish to enable Router Advertisements on multiple network interfaces.

Note that it is not necessary to uncomment the "enable-ra" configuration file entry for this to work. According to the dnsmasq manpage:

enable-ra enables router advertisement for prefixes where dnsmasq is doing DHCPv6. It is not needed for "ra-only" prefixes. Creating an "ra-only" prefix and not setting enable-ra sends advertisements only to "ra-only" prefixes.

Once configuration is complete the dnsmasq daemon must be (re)started:

svi dnsmasq restart

Radvd

Configuration

Configuration of radvd is relatively straightforward. There is a single configuration file, /etc/radvd.conf, which defines the Router Advertisement behaviour for each network interface. It is easiest to consider an example:

interface eth1
{
        AdvSendAdvert on;
        AdvManagedFlag off;
        prefix 2001:db8:1:1::/64
        {
                AdvOnLink on;
                AdvAutonomous on;
        };
};

The meaning of the various entries is:

interface eth1 
Indicates that this configuration block refers to the eth1 network interface.
AdvSendAdvert on; 
Indicates that radvd should send Router Advertisements and respond to Router Solicitations on this interface.
AdvManagedFlag off; 
Indicates that hosts should not also use DHCPv6 to acquire additional details about the network configuration.
See the next page for more information about DHCPv6.
prefix 2001:db8:1:1::/64 
Defines the IPv6 address prefix to be used for this network interface.
Note that the 2001:db8::/32 address range is specifically reserved for IPv6 documentation examples and should be replaced by part of your own allocated IPv6 address range.
AdvOnLink on; 
Indicates that this address prefix is specific to this network link so all hosts sharing this address prefix can be reached directly (i.e. in one hop) using this network interface.
AdvAutonomous on; 
Indicates that hosts may use this prefix for "autonomous" or "stateless" IPv6 address configuration as described in RFC 2462 which has been obsoleted by RFC 4862.

Additional interface configuration blocks can be added if there are additional IPv6 networks for radvd to manage.

Once configuration is complete the radvd daemon must be started:

svi radvd start

Troubleshooting

  • radvd checks your configuration syntax if called with option -c.
  • To add comments to the radvd configuration file /etc/radvd.conf use the hash sign (#). Make sure have a space after the hash, otherwise radvd may detect an error while reading the configuration file.
  • To see what radvd (or any other Router Advertisement solution) advertises to your LAN, install a radvd package from your Linux distribution's package repository and run radvdump.



Prev Up Next