Page MenuHomeVyOS Platform

Unified CLI for displaying neithbors (ARP, IP, and NDP)
Closed, ResolvedPublic

Description

Right now we have multiple commands for displaying link layer to network layer address mappings (i.e. link layer neighbors).

  • show arp [interface $intf] — calls arp directly.
  • show ip neighbors (no interface filter support) — wrapper for ip neigh
  • show ipv6 neighbors (no interface filter support) — also a wrapper for ip neigh.

Additionally, there's a show lldp neighbors command, but show lldp by itself is not a valid command, and there are no sub-commands other than neighbors in that sub-tree.

What if we combine both wrappers into a single script and move the commands to:

  • show neighbors ip
  • show neighbors ipv6

We can also move LLDP under that sub-tree, since there's nothing but neighbors in the now-toplevel LLDP tree:

  • show neighbors lldp

Why not show neighbors arp and show neighbors ndp? A fun thing is that the Linux kernel allows link-layer address to be of the same protocol as the neighbor address: this is used in DMVPN to tell the kernel how to connect to specific spokes. The arp utility doesn't know about it and displays IPv4 addresses in an "undersized MAC" format:

sudo ip tunnel add tun0 mode gre local 10.20.30.1 key 1234
sudo ip link set tun0 up

sudo ip neigh add 10.20.50.1 lladdr 10.20.40.1 dev tun0

$ sudo arp -n
Address                  HWtype  HWaddress           Flags Mask            Iface
10.20.50.1               ether   0a:14:28:01         CM                    tun8

There seems to be no way to tell the kernel to show only ethernet neighbors, but if we ever find a way, the command can be extended to show neighbors ip arp.

Details

Difficulty level
Unknown (require assessment)
Version
-
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Behavior change
Issue type
Improvement (missing useful functionality)