In this lesson, you will learn how to fine-tune IPv6 reachability by adjusting Neighbor Discovery Protocol (NDP) parameters and Router Advertisement (RA) behavior within the Linux kernel.
The Role of NDP
While IPv4 relies on the Address Resolution Protocol (ARP), IPv6 uses the Neighbor Discovery Protocol (NDP). NDP handles address resolution, neighbor reachability detection, and router discovery. It operates using ICMPv6 messages (Neighbor Solicitation and Neighbor Advertisement). In Linux, these behaviors are governed by kernel parameters exposed via the sysctl interface under /proc/sys/net/ipv6/conf/<interface>/.
Configuring Reachability
When your Linux node needs to verify if a neighbor is still reachable, it uses the retrans_time_ms and base_reachable_time_ms parameters. These determine how frequently the kernel probes neighbors to ensure the cache stays accurate. You can modify these values to accommodate high-latency links or performance-sensitive environments:
# Set the base reachable time to 30 seconds for interface eth0
sysctl -w net.ipv6.conf.eth0.base_reachable_time_ms=30000
# Adjust the retransmission timer to 1500ms
sysctl -w net.ipv6.conf.eth0.retrans_time_ms=1500
Managing Router Advertisements
Router Advertisements are critical for stateless address autoconfiguration (SLAAC). If your Linux machine is acting as a router, you control how it advertises its presence to the network. Conversely, if you want your node to ignore or strictly follow these advertisements, you manage the accept_ra parameter:
0: Disable RA reception.1: Accept RA if forwarding is disabled.2: Accept RA even if forwarding is enabled.
For example, to ensure a node accepts RAs even while it acts as a router, you would run:
sysctl -w net.ipv6.conf.eth0.accept_ra=2
By adjusting these parameters, you directly influence how the Linux kernel interacts with the local link-layer topology, ensuring that your network stack remains performant and compliant with your infrastructure’s specific routing policies.
Key Takeaway: NDP parameters in Linux allow you to control the timing of neighbor reachability detection and the node's participation in Router Advertisement processes via the sysctl interface.