radvd
radvd is an open-source router advertisement daemon designed for Linux and BSD systems functioning as IPv6 routers, implementing the transmission of Router Advertisement (RA) messages as specified in RFC 4861 to facilitate IPv6 stateless address autoconfiguration on local networks.[1][2] The daemon listens for Router Solicitation (RS) messages from hosts and responds with periodic or solicited RA messages, which provide essential information such as router addresses, prefix information for address assignment, and default gateway details, enabling hosts to self-configure without a DHCP server.[2][3] It requires IPv6 forwarding to be enabled on the host system but does not handle routing or forwarding itself; users must configure those aspects separately using tools like ip route.[2][4] Configuration of radvd occurs primarily through the/etc/radvd.conf file, which defines interfaces, prefixes to advertise, advertisement intervals, and options like managed address configuration flags or route preferences, ensuring secure and tailored deployment by restricting write access to root.[2][3] Key command-line options include specifying debug levels for troubleshooting, logging methods (such as syslog or file-based), and privilege dropping for enhanced security, with the daemon typically running as a background process under /usr/sbin/radvd.[2]
Originally released in version 0.6.2pl1 on April 4, 2001, radvd has evolved through community contributions and is actively maintained via GitHub, with the latest stable release, version 2.20, issued on December 31, 2024, incorporating updates for modern IPv6 deployments including special handling for 6to4 tunnels.[1][4] Development discussions occur on dedicated mailing lists and IRC channels, fostering ongoing improvements while supporting BSD platforms with varying degrees of compatibility.[1]
Overview
Definition and Purpose
radvd is an open-source router advertisement daemon that implements the transmission of ICMPv6 Router Advertisement messages in accordance with RFC 4861, which defines the Neighbor Discovery protocol for IPv6.[5][4] This daemon serves as a key component on IPv6 routers, providing essential network discovery and configuration services to connected hosts. The primary purpose of radvd is to facilitate stateless address autoconfiguration (SLAAC) for IPv6 hosts, allowing them to automatically generate their own IPv6 addresses and select default routes without requiring stateful DHCPv6 servers.[3] By broadcasting router advertisements, radvd informs hosts about the router's presence, available network prefixes for address formation, the link's maximum transmission unit (MTU), and other parameters necessary for proper IPv6 operation.[2] This process ensures seamless integration of devices into IPv6 networks, promoting plug-and-play connectivity. In operation, radvd listens for incoming Router Solicitation (RS) messages from hosts seeking immediate configuration information and responds promptly with a Router Advertisement (RA) message.[2] It also periodically transmits unsolicited RA messages at configurable intervals to maintain up-to-date awareness among all hosts on the local link.[2] As a router-side utility, radvd is widely deployed in Linux and BSD-based systems to manage IPv6 router advertisements, enabling efficient autoconfiguration in diverse networking environments.[6][7]Historical Background
The development of radvd began in 1996, initiated by Lars Fenneberg as one of the earliest software implementations for sending IPv6 router advertisements, coinciding with the burgeoning research and interest in next-generation Internet Protocol technologies to address the limitations of IPv4. This effort aligned with early IETF activities on IPv6, including drafts that would later formalize router advertisement mechanisms in RFC 2461, published in 1998. Fenneberg's work laid the groundwork for a daemon that could enable stateless address autoconfiguration on Unix-like systems, filling a critical gap in IPv6 deployment tools during the protocol's experimental phase. The first public release of radvd occurred on April 4, 2001, with version 0.6.2pl1, which introduced features like integrated 6to4 support for dynamic prefix generation from IPv4 addresses.[1] Pekka Savola contributed significantly to subsequent updates, including version 0.6.2pl2 shortly thereafter, and later co-maintained the project alongside Nathan Lutchansky starting in 2001.[8] These releases marked radvd's transition from an internal tool to a publicly available resource, supporting the evolving IPv6 standards and facilitating testing in research and enterprise environments. Over the early 2000s, radvd evolved from an experimental utility into a standard component of Unix-like operating systems, propelled by the IETF's IPv6 standardization efforts, including the update to Neighbor Discovery in RFC 4861 (2007). Key milestones included its integration into major Linux distributions such as Red Hat Linux by 2002, where spec files were adapted for packaging and deployment.[1] Similarly, it became available in Debian-based systems like Ubuntu shortly after the distribution's inception in 2004, aiding widespread IPv6 adoption on servers and routers. Maintained as open-source software under a BSD-style license with advertising clauses, radvd's permissive terms encouraged contributions and distribution, ensuring its longevity as a core IPv6 tool.[9]Technical Implementation
Protocol Foundation
radvd operates on the foundation of the Neighbor Discovery Protocol (NDP) for IPv6, as defined in RFC 4861, which establishes mechanisms for routers to discover hosts and hosts to discover routers on a link. Central to this are Router Advertisement (RA) messages sent periodically by routers to announce their presence and provide configuration parameters, and Router Solicitation (RS) messages sent by hosts to prompt immediate RA responses from routers. These messages enable autoconfiguration and address resolution without relying on centralized servers, forming the core of IPv6's decentralized network discovery. RA messages are transported using Internet Control Message Protocol version 6 (ICMPv6), which serves as the signaling protocol for NDP. Routers transmit RAs as multicast packets to the all-nodes multicast address (ff02::1) within link-local scope, ensuring they reach all IPv6-enabled devices on the local network segment without propagating beyond. This multicast approach minimizes network overhead while guaranteeing reliable delivery for discovery purposes, with RAs typically sent at configurable intervals to balance responsiveness and efficiency. radvd integrates with IPv6 Stateless Address Autoconfiguration (SLAAC), outlined in RFC 4862, by embedding IPv6 prefixes in RA messages that hosts use to generate their own interface addresses. Upon receiving an RA, a host combines the advertised prefix with its interface identifier—derived from mechanisms like MAC address modification via EUI-64—to form a full IPv6 address, enabling plug-and-play connectivity without dynamic host configuration protocol involvement. This stateless process relies on the accuracy of RA prefixes to ensure valid, routable addresses. The structure of an RA message, as specified in RFC 4861, begins with an ICMPv6 header where the message type is set to 134 to identify it as a Router Advertisement. Key fields include flags such as the Managed Address Configuration (M) flag, indicating whether hosts should use DHCPv6 for address assignment, and the Other Configuration (O) flag, signaling additional DHCPv6 options beyond addresses. The message also contains a router lifetime field specifying the validity period of the router as a default gateway in seconds, alongside reachable time and retransmit timer fields that guide neighbor unreachability detection by setting defaults for how long a neighbor is considered reachable and the interval for retransmitting packets. These elements collectively provide hosts with essential timing and configuration data for maintaining network state.Core Features and Mechanisms
radvd operates by generating and transmitting Router Advertisement (RA) messages as defined in the Neighbor Discovery Protocol (NDP) for IPv6. It sends periodic unsolicited multicast RAs to announce router availability and network parameters to hosts on the local link, with the transmission interval randomized between the minimum and maximum router advertisement intervals. By default, the maximum interval (MaxRtrAdvInterval) is set to 600 seconds, while the minimum (MinRtrAdvInterval) is 0.33 times that value, approximately 198 seconds, ensuring varied timing to avoid synchronization among multiple routers.[10] Additionally, radvd responds promptly to unicast or multicast Router Solicitation (RS) messages from hosts, typically within the minimum delay between RAs (default 3 seconds) to provide on-demand configuration information.[11] A key mechanism of radvd is its support for the Prefix Information Option (PIO) in RA messages, which advertises IPv6 prefixes to enable Stateless Address Autoconfiguration (SLAAC) on client hosts. The PIO includes valid and preferred lifetimes for each prefix, allowing hosts to generate unique interface identifiers and form global addresses while managing address deprecation based on these timers. This facilitates automatic network attachment without manual configuration or DHCPv6. radvd also handles the Route Information Option (RIO), which provides supplementary routing information, such as alternative routes with preference metrics, enabling hosts to select optimal paths beyond the default router. Furthermore, it incorporates the MTU Option to advertise the Maximum Transmission Unit for the link, aiding hosts in path MTU discovery and preventing fragmentation issues in IPv6 traffic. radvd extends its functionality with support for Recursive DNS Server (RDNSS) and DNS Search List (DNSSL) options, as specified in RFC 8106, to advertise DNS resolver addresses and domain search lists directly in RA messages. These options include lifetimes for the DNS information, synchronized with RA intervals, allowing hosts to configure DNS settings via SLAAC without additional protocols. This integration simplifies IPv6 deployment by centralizing network discovery in NDP.[10]Configuration
File Structure and Syntax
The radvd configuration file is conventionally located at/etc/radvd.conf. This file employs a hierarchical structure centered on interface-specific sections, where global daemon-wide parameters such as logging levels and facilities are not defined within the file itself but are instead managed through command-line options when invoking the daemon.[2][11]
Basic syntax rules dictate that the file is parsed line-by-line, with each configuration option terminated by a semicolon (;). The syntax is case-sensitive, and configurations are organized into interface blocks delimited by curly braces ({ }), which encapsulate per-interface settings; sub-blocks for elements like prefixes or routes may nest within these interface blocks. Decimal values are permitted for timer-related options, ensuring compatibility with standard numerical representations.[11][12]
Comments in the configuration file are indicated by the hash symbol (#) at the start of a line, allowing administrators to annotate settings without affecting parsing. While some implementations or extensions may support inclusion of external files via an Include directive, the standard radvd configuration does not natively provide this feature, requiring all settings to reside within the primary file.[11]
During configuration parsing, radvd performs validation to ensure syntactic correctness and semantic validity, logging non-fatal errors (such as AdvPreferredLifetime greater than AdvValidLifetime) to the system log or specified output without halting operation. Fatal errors, including malformed IPv6 addresses (e.g., invalid formats in client lists or source addresses) or timers outside RFC-mandated ranges (such as MaxRtrAdvInterval below 4 seconds or above 1800 seconds), cause the daemon to exit with an error message, preventing deployment of invalid configurations. IPv6 addresses are rigorously checked for proper colon-hexadecimal notation and scope compliance, while timers are bounded to prevent network instability as per protocol specifications.[11][12]
Key Directives and Options
The configuration of radvd is primarily managed through the/etc/radvd.conf file, where interface-specific directives control the behavior of router advertisements (RAs) on designated network interfaces.[11] The IgnoreIfMissing directive, when set to on, instructs radvd to ignore an interface if it is not present at startup, preventing errors in dynamic environments; its default is off.[11] AdvSendAdvert, defaulting to off, enables or disables the sending of periodic unsolicited RAs and responses to router solicitations on the interface, as defined in the Neighbor Discovery Protocol (NDP).[11][13] Timing of these advertisements is governed by MaxRtrAdvInterval, which sets the maximum interval between unsolicited RAs (range: 4 to 1800 seconds, default: 600 seconds), and MinRtrAdvInterval, the minimum interval (range: 3 seconds to 0.75 times MaxRtrAdvInterval, default: approximately 0.33 times MaxRtrAdvInterval), ensuring compliance with NDP jitter requirements to avoid synchronization.[11][13]
Within an interface block, prefix directives configure the advertisement of IPv6 prefixes for Stateless Address Autoconfiguration (SLAAC), as outlined in RFC 4862.[14] The prefix block specifies a prefix and length, such as 2001:db8::/64, and includes options like AdvOnLink (default: on), which indicates whether the prefix can be used for on-link determination by hosts; AdvAutonomous (default: on), enabling autonomous address formation via SLAAC; AdvValidLifetime (default: 86400 seconds), defining the total validity period of addresses formed from the prefix; and AdvPreferredLifetime (default: 14400 seconds), setting the preferred period before addresses depreciate.[11][14] These lifetimes can be set to infinity for permanent prefixes but must satisfy AdvPreferredLifetime ≤ AdvValidLifetime to prevent invalid preferred states.[11]
Route directives within the interface block advertise default routes to hosts. The route block, specifying a prefix (e.g., ::/0 for default), includes AdvRoutePreference (default: medium), which sets the route's preference level as low, medium, or high to guide host selection among multiple routers per NDP specifications.[11][13]
For DNS integration, RDNSS directives advertise Recursive DNS Server options. In the RDNSS block, AdvRDNSSPreference (default: 8, range: 0–15) indicates the DNS server's preference relative to others, while AdvRDNSSLifetime (default: twice MaxRtrAdvInterval) specifies the validity duration of the RDNSS entry, aligning with extensions in RFC 8106.[11]
A representative configuration example for an interface might appear as follows:
This block enables RA transmission oninterface eth0 { AdvSendAdvert on; MaxRtrAdvInterval 600; MinRtrAdvInterval 200; prefix 2001:db8::/64 { AdvOnLink on; AdvAutonomous on; AdvValidLifetime 86400; AdvPreferredLifetime 14400; }; route ::/0 { AdvRoutePreference medium; }; RDNSS 2001:db8::53 { AdvRDNSSPreference 8; AdvRDNSSLifetime 1200; }; };interface eth0 { AdvSendAdvert on; MaxRtrAdvInterval 600; MinRtrAdvInterval 200; prefix 2001:db8::/64 { AdvOnLink on; AdvAutonomous on; AdvValidLifetime 86400; AdvPreferredLifetime 14400; }; route ::/0 { AdvRoutePreference medium; }; RDNSS 2001:db8::53 { AdvRDNSSPreference 8; AdvRDNSSLifetime 1200; }; };
eth0, advertises a /64 prefix for SLAAC with standard lifetimes, a medium-preference default route, and a DNS server with default preference.[11]
Deployment and Usage
Installation and Setup
radvd can be installed on most Unix-like systems using package managers or by compiling from source. On Debian-based distributions such as Ubuntu, the package is available in the default repositories and can be installed with the commandsudo apt install radvd.[15] On Red Hat Enterprise Linux (RHEL) and derivatives like CentOS, use sudo yum install radvd (or sudo dnf install radvd on RHEL 8 and later).[3] For systems without pre-built packages, download the source from the official GitHub repository at https://github.com/radvd-project/radvd, then run ./configure --prefix=/usr/local --sysconfdir=/etc, followed by make and sudo make install.[4]
The software provides full support on Linux kernels version 2.6 and later, where IPv6 is natively integrated.[1] On BSD variants like FreeBSD, radvd is available through the ports collection as net/radvd and can be installed with cd /usr/ports/net/radvd && make install clean, though FreeBSD includes a native alternative (rtadvd) for similar functionality; radvd supports features such as Mobile IPv6 and 6to4 tunnels.[16] Dependencies typically include build tools like gcc and make for compilation, with libdaemon optional but recommended for proper daemon forking.[4]
Initial setup requires enabling IPv6 forwarding on the host system, as radvd does not handle routing itself. On Linux, execute sudo [sysctl](/page/Sysctl) -w net.ipv6.conf.all.forwarding=1 and make it persistent by adding net.ipv6.conf.all.forwarding=1 to /etc/sysctl.conf.[2] On BSD, use sudo [sysctl](/page/Sysctl) net.inet6.ip6.forwarding=1. Create a basic configuration file at /etc/radvd.conf with minimal interface and prefix directives, as detailed further in the Configuration section. Enable and start the service using systemd on modern Linux distributions with sudo [systemctl](/page/Systemctl) enable radvd and sudo [systemctl](/page/Systemctl) start radvd; for SysV init systems, add it to the appropriate runlevel scripts.[3]
To verify the installation, check for outgoing Router Advertisement (RA) packets using the included radvdump tool with radvdump or capture network traffic with tcpdump via sudo tcpdump -i <interface> icmp6 and 'ip6[40] == 134', where RA packets (ICMPv6 type 134) should appear periodically if configured correctly.[17]
Operational Management and Troubleshooting
Operational management of radvd involves initiating the daemon with appropriate commands to ensure proper IPv6 router advertisement dissemination, while troubleshooting focuses on diagnosing issues related to advertisement delivery and integration with complementary protocols. To start radvd, administrators typically use systemd on modern Linux distributions by executingsystemctl start radvd.service, which launches the service using the default configuration file at /etc/radvd.conf.[3] For configuration validation prior to startup, the -c option can be employed with radvd -C /etc/radvd.conf -c to perform checks and startup tests without fully initializing the daemon.[18] Stopping the service is achieved via systemctl stop radvd.service, or by terminating the process using the PID file at /var/run/radvd/radvd.pid.[2] For debugging during startup or runtime, the -d option sets verbose logging levels from 1 to 5, preventing daemonization and outputting details to stderr or logs, which aids in identifying initialization errors.[2]
Monitoring radvd operations relies on log files and network tools to verify advertisement transmission. By default, radvd logs to /var/log/radvd.log when configured with the -m logfile option, capturing events such as advertisement sends and errors; alternatively, syslog integration via -m syslog directs output to the system log with the LOG_DAEMON facility.[2] To inspect live router advertisement traffic, tools like radvdump can capture and display RA packets, revealing configured prefixes, lifetimes, and flags for validation against expected behavior.[3] Network-level monitoring includes using ip -6 monitor from iproute2 to observe IPv6 neighbor discovery events or Wireshark for packet-level analysis of ICMPv6 RA messages on multicast address ff02::1.[4]
Common troubleshooting scenarios in production environments often stem from misconfigurations or network constraints affecting RA delivery. Prefix delegation failures may occur if advertisement lifetimes are improperly set, such as short AdvValidLifetime or AdvPreferredLifetime values leading to premature prefix expiration; resolution involves verifying these in /etc/radvd.conf and ensuring they align with upstream delegation stability, typically adjusting to values like 1800-3600 seconds for valid lifetimes.[19] Non-responses to router solicitations (RS) can result from multicast issues, where radvd fails to receive RS on ff02::2; checking interface multicast membership with ip -6 addr show and confirming kernel IPv6 support resolves this.[2] Firewall blocks on ICMPv6 type 134 (RA) or 133 (RS) packets commonly prevent advertisement propagation, necessitating rules to permit these on relevant interfaces, as ICMPv6 is essential for neighbor discovery per RFC 4861.[1]
For stateful IPv6 address assignment, radvd integrates with DHCPv6 servers like wide-dhcpv6-client (dhcp6c) by setting the AdvManagedFlag to 1 in interface configurations, signaling clients to use DHCPv6 for addresses while radvd handles routing prefixes and default gateways via stateless mechanisms.[20] This hybrid approach ensures comprehensive autoconfiguration, with radvd advertising the M-flag to direct clients to DHCPv6 for additional options like DNS, avoiding conflicts in dynamic environments.[19]