Router Advertisements in depth
Decode every field and common option of a Router Advertisement. Choose RA intervals and lifetimes, and calculate the defaults RFC 4861 and RFC 8106 derive from them. Use default router preferences and Route Information Options (RFC 4191) and predict host behaviour. Configure RAs with radvd and MikroTik RouterOS and verify how client operating systems react.
Take the quiz · pass mark 70% · 10 questions
Explanation
The Router Advertisement (RA, ICMPv6 type 134) is the most important message on an IPv6 LAN. It tells hosts which routers exist, which prefixes are on-link, whether to use SLAAC or DHCPv6, and often which DNS servers to use. Most "IPv6 does not work on this LAN" tickets come down to an RA that is missing, wrong, or coming from the wrong device.
The RA header
| Field | Meaning |
|---|---|
| Cur Hop Limit | Default Hop Limit hosts should use (0 = unspecified) |
| M (Managed) flag | Addresses are available from DHCPv6 (L3.03) |
| O (Other) flag | Other configuration (for example DNS) is available from DHCPv6 |
| Prf (2 bits) | Default router preference: high, medium, low (RFC 4191) |
| Router Lifetime | Seconds this router may be used as a default router. 0 means "not a default router". Maximum 9,000 s |
| Reachable Time | BaseReachableTime for NUD in ms (0 = unspecified) |
| Retrans Timer | Time between NS retransmissions in ms (0 = unspecified) |
The source address of an RA is always the router's link-local address, and that is the address hosts install as their default gateway. That is why fe80::1 as a gateway address is normal (L1.06).
Router Lifetime only controls the default route. An RA with Router Lifetime 0 still delivers prefixes, routes and DNS information. This is how a second router can offer a ULA prefix or specific routes without attracting Internet traffic.
Options
| Type | Option | Key content |
|---|---|---|
| 1 | Source Link-Layer Address | The router's MAC, which saves an NS |
| 3 | Prefix Information (PIO) | Prefix, length, flags L (on-link), A (autonomous: use for SLAAC), P (RFC 9762), valid and preferred lifetime |
| 5 | MTU | Link MTU hosts should use |
| 24 | Route Information (RIO) | A more specific route via this router, with its own preference and lifetime (RFC 4191) |
| 25 | Recursive DNS Server (RDNSS) | DNS server addresses and a lifetime (RFC 8106) |
| 31 | DNS Search List (DNSSL) | Search domains and a lifetime (RFC 8106) |
Some points about the PIO:
- L and A are independent. L=1 means "addresses in this prefix are on-link, deliver directly". A=1 means "you may form SLAAC addresses here". A prefix with L=1, A=0 is common on DHCPv6-only LANs.
- The valid lifetime is how long an address remains usable for existing connections, and the preferred lifetime how long it should be used for new ones. When preferred expires the address is deprecated (L3.04). Defaults are 30 days valid and 7 days preferred.
- The two-hour rule (RFC 4862, section 5.5.3): a host accepts a shorter valid lifetime from an RA only down to 2 hours, unless its remaining valid lifetime is already less. This stops a single forged RA from killing addresses, but it also means you cannot remove a prefix instantly with RAs alone. Level 2 (L2.08) used this rule for renumbering.
- RFC 9762 adds a P flag: the network prefers that clients ask for a delegated prefix of their own with DHCPv6-PD instead of using individual addresses from this prefix. Hosts that understand P ignore the A flag for that prefix. This is new, and support in host operating systems is still limited.
Timing
| Variable (RFC 4861) | Default | Rule |
|---|---|---|
| MaxRtrAdvInterval | 600 s | 4 to 1,800 s |
| MinRtrAdvInterval | 0.33 × Max (if Max ≥ 9 s) | 3 s to 0.75 × Max |
| AdvDefaultLifetime | 3 × Max | 0, or Max to 9,000 s |
| AdvValidLifetime | 2,592,000 s (30 days) | |
| AdvPreferredLifetime | 604,800 s (7 days) |
Routers send unsolicited RAs at random intervals between Min and Max. When an interface starts, the first few RAs (up to 3) are sent at most 16 s apart, so hosts learn about the router quickly.
Hosts do not wait. A host sends up to 3 Router Solicitations (to ff02::2), 4 seconds apart, after a random delay of up to 1 s, and routers answer within half a second, with a solicited RA. Routers rate-limit multicast RAs to one every 3 s.
RFC 8106 says the RDNSS and DNSSL lifetimes should by default be at least 3 × MaxRtrAdvInterval. An earlier value of 2 × Max made DNS servers expire on hosts that lost a single RA.
Default router preference and Route Information (RFC 4191)
The 2-bit Prf field lets you rank routers: 01 high, 00 medium (the default), 11 low. 10 is reserved and treated as medium. A host prefers reachable routers with higher preference. Typical uses:
- a backup router advertises low, so hosts only use it when the primary's lifetime expires or NUD finds it dead
- a second router on a LAN advertises Router Lifetime 0 (not a default router) and a RIO for the networks behind it, such as
2001:db8:3000:9000::/52, so hosts send that traffic straight to it
RFC 4191 defines host types: type A ignores preferences and RIOs, type B uses preferences, type C also installs RIO routes. RFC 8504 says nodes must implement RFC 4191 and should be type C. In practice:
- Linux uses router preferences by default (
accept_ra_rtr_pref=1), butaccept_ra_rt_info_max_plenis 0 by default, so it ignores RIOs for anything longer than ::/0. Set it to 64 (or 128) to accept them. - Windows and macOS process preferences. RIO support varies by version, so test with your own builds (this lesson's lab).
Which hosts listen to RAs?
Linux accepts RAs only when accept_ra is 1 and forwarding is off, or when accept_ra is 2 (also with forwarding on). A Linux router that needs an upstream RA (for example a CPE-like VM) needs accept_ra=2. autoconf controls SLAAC, accept_ra_defrtr the default route, accept_ra_pinfo the prefixes. systemd-networkd has its own RA client: with IPv6AcceptRA= it handles RAs in user space.
Configuring RAs
radvd (Linux), on the enterprise users VLAN from L2.04:
interface eth0 {
AdvSendAdvert on;
MinRtrAdvInterval 10;
MaxRtrAdvInterval 30;
AdvDefaultLifetime 90;
AdvDefaultPreference high;
AdvManagedFlag off;
AdvOtherConfigFlag off;
prefix 2001:db8:3000:10::/64 {
AdvOnLink on;
AdvAutonomous on;
AdvValidLifetime 86400;
AdvPreferredLifetime 14400;
};
route 2001:db8:3000:9000::/52 {
AdvRoutePreference medium;
AdvRouteLifetime 90;
};
RDNSS 2001:db8:3000:f00::53 {
AdvRDNSSLifetime 90;
};
DNSSL lab.example {
AdvDNSSLLifetime 90;
};
};
MikroTik RouterOS v7, for a residential CPE LAN or a business customer VLAN:
/ipv6 nd set [find interface=bridge-lan] ra-interval=10s-30s ra-lifetime=90s \
ra-preference=high managed-address-configuration=no other-configuration=no \
advertise-dns=yes
/ipv6 nd prefix default set valid-lifetime=1d preferred-lifetime=4h
RouterOS defaults to ra-interval=3m20s-10m and ra-lifetime=30m. Its DNS server list for RAs is set with a dns= property in recent v7 releases (older documentation calls it dns-servers=), and advertise-dns=yes otherwise uses the router's own DNS settings. Property names have changed between releases, so check the documentation for your version.
Rogue RAs
Any host can send an RA. A Windows PC with Internet Connection Sharing or a misconfigured container host can announce itself as a default router with a random prefix and capture traffic. The defence is RA Guard on switches and host-side filtering (Level 5). On the LAN, rdisc6 eth0 (from the ndisc6 package) or a capture filtered on ip6[40] == 134 shows every router announcing itself.
Drawing diagram…
Worked examples
Example 1: Defaults from MaxRtrAdvInterval
For MaxRtrAdvInterval = 600 s: MinRtrAdvInterval = 0.33 × 600 = 198 s, and AdvDefaultLifetime = 3 × 600 = 1,800 s. RDNSS lifetime should be at least 3 × 600 = 1,800 s.
For the radvd example with MaxRtrAdvInterval = 30 s: AdvDefaultLifetime 3 × 30 = 90 s and an RDNSS lifetime of at least 90 s, which is what the configuration uses.
Example 2: The two-hour rule
A host's address in 2001:db8:3000:10::/64 has 18,000 s (5 hours) of valid lifetime left. An RA arrives with valid lifetime 600 s. Because 600 s is less than 2 hours and the remaining lifetime is more than 2 hours, the host sets the remaining valid lifetime to 7,200 s. If the RA had said 0, the result would be the same.
Example 3: Router Lifetime 0
A lab router advertises fdf1:a861:26b6:10::/64 with Router Lifetime 0. Hosts form ULA addresses and treat the prefix as on-link, but do not add a default route via this router. Internet traffic continues to use the main router.
Example 4: Preference failover
Router A advertises Prf high, lifetime 90 s. Router B advertises Prf low, lifetime 90 s. Hosts use A. If A dies, hosts switch to B when NUD declares A unreachable (a few seconds once traffic is sent) or when A's 90 s Router Lifetime expires, whichever comes first.
Lab
Goal: Tune RAs and record how client operating systems react.
You need: The L3.01 namespace LAN, radvd, rdisc6 and tcpdump. Optional: Windows and macOS VMs bridged to the same LAN, and a MikroTik CHR instead of radvd.
Step 1: Basic RA
Run radvd in r1 with the configuration above (without the route block). In h1:
sudo ip netns exec h1 sysctl -w net.ipv6.conf.eth0.accept_ra=1
sudo ip netns exec h1 rdisc6 eth0
sudo ip -n h1 -6 addr show dev eth0
sudo ip -n h1 -6 route show
Record the addresses, the default route (via fe80::..., with its expiry) and /etc/resolv.conf or resolvectl output if a resolver daemon consumes RDNSS.
Step 2: Preferences and lifetime 0
Add a second router namespace r2 on the same bridge, advertising fdf1:a861:26b6:10::/64 with AdvDefaultPreference low. Show both default routes in h1 and which one is used (ip -6 route get 2001:db8:f000::1). Then set r1 to Router Lifetime 0 and show the change.
Step 3: Route Information
Give r2 a route 2001:db8:3000:9000::/52 block. Show that h1 ignores it, set accept_ra_rt_info_max_plen=64 in h1, wait for the next RA, and show the new route.
Step 4: Removing a prefix
Reduce the prefix valid lifetime to 600 s on r1 and show that the host's valid lifetime does not drop below 2 hours. Explain why.
Step 5: Other operating systems (optional)
Repeat steps 1 and 3 with Windows (Get-NetRoute -AddressFamily IPv6, Get-NetIPAddress -AddressFamily IPv6, Get-DnsClientServerAddress) and macOS (netstat -rn -f inet6, ifconfig, scutil --dns). Record the OS version and whether it used the RDNSS, the preference and the RIO.
What to submit
The radvd configurations, outputs for each step, and a table of client reactions per operating system and version.
Summary
- The RA carries the M and O flags, router preference, Router Lifetime (0 = not a default router), and options: PIO, MTU, RIO, RDNSS, DNSSL. Its source is the router's link-local address.
- PIO L and A flags are independent. Valid and preferred lifetimes default to 30 and 7 days, and the two-hour rule limits how fast an RA can shorten them.
- Defaults: MinRtrAdvInterval 0.33 × Max, AdvDefaultLifetime 3 × Max, RDNSS and DNSSL lifetime at least 3 × Max.
- RFC 4191 preferences rank routers. RIOs add specific routes, but Linux ignores them unless
accept_ra_rt_info_max_plenis raised. - RFC 9762's P flag asks clients to use DHCPv6-PD instead of SLAAC addresses from that prefix.
- Next lesson (L3.03): DHCPv6.
Quiz imported · 10 questions · pass mark 70%. Lab questions are not auto-marked.