NDISC6(8)

hiii bestie πŸ’– welcome to the page for ndisc6, from the System Manager's Manual β€” she's the ICMPv6 Neighbor Discovery tool and she's lowkey iconic. let's get into it 🫢


🌸 NAME 🌸

ndisc6 β€” ICMPv6 Neighbor Discovery tool ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

ndisc6 [-1mnqv] [-r attempts] [-s source_ip] [-w wait_ms] <IPv6 address> <iface>

πŸ’… DESCRIPTION πŸ’…

okay so. NDisc6 is a Unix program that implements the ICMPv6 Neighbor Discovery in userland β€” which is wild, because normally the kernel is the one doing all that. not here. she does it herself. main character energy fr fr πŸ‘‘

what is she for, you ask? she looks up the link-layer address of any on-link IPv6 node. and when we say link-layer address, we mean the layer 2 address β€” which is the MAC in the case of Ethernet πŸŽ€

you must tell her:

  • the IPv6 address of the node you're curious about, and
  • the networking interface she should perform the lookup on

no address, no interface, no lookup. that's the deal πŸ’œ


✨ OPTIONS ✨

  • -1, --single β€” dip out the second the first advertisement lands. this is the default, so she's already doing it πŸ’…
  • -h, --help β€” show some help and bounce. classic.
  • -m, --multiple β€” she waits around for possible duplicate advertisements and prints every single one of them. greedy? no. thorough. πŸ“
  • -n, --numeric β€” if that first parameter isn't a valid IPv6 address, she will not try to resolve it as a DNS hostname. no DNS detours, we stay numeric πŸ’€
  • -q, --quiet β€” only print the link-layer address, and print nothing if it fails. mostly useful when you're calling the program from a shell script, iykyk 🧚
  • -r attempts, --retry attempts β€” send ICMPv6 Neighbor Discovery that many times until a reply comes back, or just abort. by default ndisc6 tries 3 times before aborting (MAX_MULTICAST_SOLICIT and MAX_UNICAST_SOLICIT from RFC2461) πŸ”₯
  • -s source_ip, --source source_ip β€” specify the IPv6 address to be used as the source for the neighbor solicitation packets. pick your fighter ⭐
  • -V, --version β€” display program version and license, then exit. bye πŸ‘‹
  • -v, --verbose β€” display verbose information. also the default. she's a talker, we love that 🌈
  • -w wait_ms, --wait wait_ms β€” wait wait_ms milliseconds for a response before retrying. by default ndisc6 waits 1 second between each attempt (RETRANS_TIMER from RFC2461) ⏳

if ndisc6 doesn't get any response after the specified number of attempts, waiting wait_ms milliseconds each time, she exits with code 2. on error, she exits with code 1. otherwise she exits with code 0 πŸ™ˆ

this is the good part: the exit code lets you check whether a host is on-link or not. scripts eat this up fr fr πŸ’–

😭 DIAGNOSTICS 😭

if you're getting no response while you know the remote host is up, it's most likely that it is not on-link β€” meaning you have to cross one or more routers to reach it. that's the whole plot twist 🫠

by design, IPv6 nodes ignore ICMPv6 Neighbor Discovery packets that come from nodes not on the same link (i.e. the same Ethernet segment), and they do it for the sake of security. technically, that's done by ensuring the Hop limit (TTL) is 255 πŸ”’

also note: you cannot use ndisc6 to look up the local host's link-layer address. not a thing. sorry bestie πŸ’”

πŸ‘‘ SECURITY πŸ‘‘

ndisc6 should be setuid root so non-privileged users can use it. she will drop her root privileges before any attempt is made to send or receive data from the network β€” that way the possible impact of a security vulnerability stays as small as possible. she's responsible, unlike some programs πŸ’…


🌟 SEE ALSO 🌟

ping6(8), rdisc6(8), ipv6(7)


πŸ’Œ AUTHOR πŸ’Œ

RΓ©mi Denis-Courmont <remi at remlab dot net>

http://www.remlab.net/ndisc6/


and that's the whole page, bestie πŸŽ€ this was ndisc6, version $Date$, page NDISC6(8) from the System Manager's Manual β€” go forth and discover some neighbors πŸ’–βœ¨πŸ¦‹