Difference between revisions of "Bering-uClibc 4.x - User Guide - IPv6 Networking - Configure Router Advertisements"

From bering-uClibc
Jump to: navigation, search
(Created skeleton)
 
(Added note on "enable-ra" for dnsmasq)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{| summary="Navigation header" width="100%"
 
{| summary="Navigation header" width="100%"
! colspan="3" align="center" | [[Bering-uClibc 4.x - User Guide - IPv6 Networking - Configure Radvd|IPv6 Networking - Configure Radvd]]
+
! colspan="3" align="center" | [[Bering-uClibc 4.x - User Guide - IPv6 Networking - Configure Router Advertisements|IPv6 Networking - Configure Router Advertisements]]
 
|-
 
|-
 
| width="20%" align="left"  | [[Bering-uClibc 4.x - User Guide - IPv6 Networking - Configure Shorewall6|Prev]]
 
| width="20%" align="left"  | [[Bering-uClibc 4.x - User Guide - IPv6 Networking - Configure Shorewall6|Prev]]
 
! width="60%" align="center" | [[Bering-uClibc 4.x - User Guide]]
 
! width="60%" align="center" | [[Bering-uClibc 4.x - User Guide]]
| width="20%" align="right"  |  
+
| width="20%" align="right"  | [[Bering-uClibc 4.x - User Guide - IPv6 Networking - Configure DHCPv6|Next]]
 
|}
 
|}
 
----
 
----
  
  
TODO
+
==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 [http://tools.ietf.org/html/rfc2461 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 [[Bering-uClibc 4.x - User Guide - IPv6 Networking - Configure DHCPv6|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 4.x]]:
 +
* [http://www.litech.org/radvd/ Radvd]
 +
** Until recently the only practical option for implementing Router Advertisement functionality on Linux.
 +
** Available from [[Bering-uClibc 4.0]] onwards.
 +
* [http://www.thekelleys.org.uk/dnsmasq/doc.html Dnsmasq]
 +
** This started to support IPv6 and Router Advertisements at version 2.60, released 2012-03-05.
 +
** Available from [[Bering-uClibc 4.3]] onwards (actually dnsmasq version 2.62, which includes some IPv6 bug fixes).
 +
 
 +
Of the two, dnsmasq is generally preferred because most [[Bering-uClibc 4.x]] systems already include a dnsmasq installation and because most [[Bering-uClibc 4.x]] users are familiar with the dnsmasq configuration syntax.
 +
A further benefit is that dnsmasq also contains in-built [[Bering-uClibc 4.x - User Guide - IPv6 Networking - Configure DHCPv6|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, <code class="filename">/etc/dnsmasq.conf</code>.
 +
====Basic Router Advertisements====
 +
To enable basic Router Advertisement behaviour add a line like the following (replace <tt>2001:db8:1:1::</tt> 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 "<tt>enable-ra</tt>" 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 <tt>dnsmasq</tt> daemon must be (re)started:
 +
svi dnsmasq restart
 +
 
 +
==Radvd==
 +
===Configuration===
 +
Configuration of <tt>radvd</tt> is relatively straightforward. There is a single configuration file, <code class="filename">/etc/radvd.conf</code>, which defines the Router Advertisement behaviour for each network interface. It is easiest to consider an example:
 +
<pre>
 +
interface eth1
 +
{
 +
        AdvSendAdvert on;
 +
        AdvManagedFlag off;
 +
        prefix 2001:db8:1:1::/64
 +
        {
 +
                AdvOnLink on;
 +
                AdvAutonomous on;
 +
        };
 +
};
 +
</pre>
 +
The meaning of the various entries is:
 +
;<tt>interface eth1</tt> : Indicates that this configuration block refers to the <tt>eth1</tt> network interface.
 +
;<tt>AdvSendAdvert on;</tt> : Indicates that <tt>radvd</tt> should send Router Advertisements and respond to Router Solicitations on this interface.
 +
;<tt>AdvManagedFlag off;</tt> : Indicates that hosts should '''not''' also use DHCPv6 to acquire additional details about the network configuration.
 +
: See the [[Bering-uClibc 4.x - User Guide - IPv6 Networking - Configure DHCPv6|next page]] for more information about DHCPv6.
 +
;<tt>prefix 2001:db8:1:1::/64</tt> : Defines the IPv6 address prefix to be used for this network interface.
 +
: Note that the <tt>2001:db8::/32</tt> address range is specifically reserved for IPv6 documentation examples and should be replaced by part of your own allocated IPv6 address range.
 +
;<tt>AdvOnLink on;</tt> : 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.
 +
;<tt>AdvAutonomous on;</tt> : Indicates that hosts may use this prefix for "autonomous" or "stateless" IPv6 address configuration as described in [http://tools.ietf.org/html/rfc2462 RFC 2462] which has been obsoleted by [http://tools.ietf.org/html/rfc4862 RFC 4862].
 +
 
 +
Additional <tt>interface</tt> configuration blocks can be added if there are additional IPv6 networks for <tt>radvd</tt> to manage.
 +
 
 +
Once configuration is complete the <tt>radvd</tt> daemon must be started:
 +
svi radvd start
 +
 
 +
===Troubleshooting===
 +
 
 +
* <code class="filename">radvd</code> checks your configuration syntax if called with option '''-c'''.
 +
* To add comments to the radvd configuration file <code class="filename">/etc/radvd.conf</code> use the hash sign ('''#'''). Make sure have a space after the hash, otherwise <code class="filename">radvd</code> may detect an error while reading the configuration file.
 +
* To see what <code class="filename">radvd</code> (or any other Router Advertisement solution) advertises to your LAN, install a radvd package from your Linux distribution's package repository and run <code class="filename">radvdump</code>.
  
  
Line 16: Line 88:
 
| width="40%" align="left"  | [[Bering-uClibc 4.x - User Guide - IPv6 Networking - Configure Shorewall6|Prev]]
 
| width="40%" align="left"  | [[Bering-uClibc 4.x - User Guide - IPv6 Networking - Configure Shorewall6|Prev]]
 
| width="20%" align="center" | [[Bering-uClibc 4.x - User Guide - IPv6 Networking|Up]]
 
| width="20%" align="center" | [[Bering-uClibc 4.x - User Guide - IPv6 Networking|Up]]
| width="40%" align="right"  |  
+
| width="40%" align="right"  | [[Bering-uClibc 4.x - User Guide - IPv6 Networking - Configure DHCPv6|Next]]
 
|}
 
|}
  
 
[[Category:Bering-uClibc 4.x]]
 
[[Category:Bering-uClibc 4.x]]
 
[[Category:User Guide]]
 
[[Category:User Guide]]

Latest revision as of 14:44, 16 June 2012

IPv6 Networking - Configure Router Advertisements
Prev Bering-uClibc 4.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 4.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, released 2012-03-05.
    • Available from Bering-uClibc 4.3 onwards (actually dnsmasq version 2.62, which includes some IPv6 bug fixes).

Of the two, dnsmasq is generally preferred because most Bering-uClibc 4.x systems already include a dnsmasq installation and because most Bering-uClibc 4.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