How can I view IPv6 router advertisements that are being received by my computer for diagnostic purposes?
Using tcpdump
which is installed by default on many distributions:
tcpdump -n -i eth0 icmp6
will show you all ICMPv6 packets of which - under usual conditions - almost all are neighbor discovery packets. In order to see only router advertisements, use the following command:
tcpdump -n -i eth0 icmp6 and ip6[40] == 134
For more verbosity, add -v
; to display packet contents, use the option -X
.
tshark is usually bundled with wireshark, which most distributions do not install by default but provide as additional package.
While not built in, I find the command-line tool radvdump
(part of the radvd
package on my distro) very informative as it fully decodes the router advertisements and displays them in detail, including advertised DNS information.
$ radvdump
interface eth0
{
AdvSendAdvert on;
# Note: {Min,Max}RtrAdvInterval cannot be obtained with radvdump
AdvManagedFlag on;
AdvOtherConfigFlag on;
AdvReachableTime 0;
AdvRetransTimer 0;
AdvCurHopLimit 64;
AdvDefaultLifetime 65535;
AdvHomeAgentFlag off;
AdvDefaultPreference medium;
AdvSourceLLAddress on;
AdvLinkMTU 1280;
AdvIntervalOpt on;
prefix 1111:2222:3333:4444::/64
{
AdvValidLifetime infinity; # (0xffffffff)
AdvPreferredLifetime infinity; # (0xffffffff)
AdvOnLink on;
...
The most common ones are tcpdump, wireshark and tshark (the command-line version of Wireshark). Those tools can capture and decode network traffic, including Router Advertisements.