To communicate outside of the local network, global IPv6 addresses must be configured. There are two possibilities how to obtain thess addresses: stateful auto-configuration (using DHCPv6) and stateless auto-configuration. Both methods rely on a router that sends information about the used method. This user guide describes how to use stateless auto-configuration.
Figure 1 illustrates how an IPv6 global address is constructed using stateless auto-configuration.
Figure 1. Prefix dissemination using stateless auto-configuration.
Router Advertisement Daemon
IPv6 stateless auto-configuration requires the use of Router Advertisement (RA) messages. A Linux application that makes the system act as a router and supports sending RA messages is RADVD (Router Advertisement Daemon). RADVD also listens to Router Solicitation (RS) messages and automatically responds to them with RA.
To install and run RADVD:
# Install radvd daemon.
apt-get install radvd
# Set IPv6 forwarding (must be present).
echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
# Run radvd daemon.
service radvd restart
# Observe if new IPv6 prefix is disseminating over bt0 interface.
Configuration file
RADVD must be configured to work correctly. The configuration file is located in /etc/radvd.conf
.
See the following configuration for an example on how to disseminate the prefix 2001:db8::/64 over the bt0 interface.
interface bt0
{
AdvSendAdvert on;
prefix 2001:db8::/64
{
AdvOnLink off;
AdvAutonomous on;
AdvRouterAddr on;
};
};
Description of flags:
- AdvOnLink - This value is a part of the Router Advertisement Message and determines if devices with the advertised prefix are on or off link. If the value is not set (off), all devices should send packets to the router that advertised the prefix, which is required according to the specification.
- AdvAutonomous - This value is a part of the Router Advertisement Message as well and determines if the device that receives the RA should construct the global address using this prefix.
- AdvSendAdvert - Setting this value on forces the router to periodically send RA messages.
- Note
- In some Linux kernel versions, the prefix cannot be assigned automatically to the btX interface as described above. Instead, the following command can be used:
ifconfig btX add 2001:db8::1/64
-
Alternatively, the interface parameter accept_ra can be set to 2. For example:
echo 2 > /proc/sys/net/ipv6/conf/bt0/accept_ra
. However linux does not add route to this prefix automatically.