1

I can see all connected devices to my Linux PC with:

cat /proc/net/arp

But this show only the IPv4 addresses and MAC of the connected devices. There is no IPv6 addresses.

How to find the IPv6 addresses of the connected Devices?

2
  • 2
    “I can see all connected devices to my Linux PC” – but you can’t. The ARP cache only contains information about hosts your machine happens to have communicated with. The only way to find most hosts is a network scanner like nmap.
    – Daniel B
    Jan 9, 2018 at 15:45
  • 1
    Do you mean connected in sense that the other devices are on the same network - or connected in sense that there is open active connection between the two?
    – Marek Rost
    Jan 9, 2018 at 16:05

2 Answers 2

3

This is because IPv6 does not use Address Resolution Protocol (ARP) it uses Neighbor Discovery Protocol (NDP).

Using the command ip neighbor will list both ARP cache and discovered IPv6 neighbors.

1

The simplest command is to list out all connections is the ss | less, but to view only tcp or udp or unix connections use the -t that is,

ss -t

this should show you all IPv4 and IPV6 tcp connections.


  • To display only IPv4 socket connections use the -f inet or -4 option.

    ss -tl -f inet or

    ss -tl -4

  • While to display only IPv6 connections use the -f inet6 or -6 option.

    ss -tl6 or

    ss -finet6


Or simply for the combined IPv4 and IPv6 neighboring nodes use

ip neighbour 

Which will shows the current neighbour table in kernel.

But NOTE: /proc/net/arp doesn't list devices connected to your PC. It shows a list of devices on your subnet for which your PC has done/seen an ARP request for. If you want to see which devices are connected to your PC, then you need netstat or similar (which will automatically show both ipv4 and ipv6 devices). ipv6 doesn't use ARP (it uses NDP)

I hope this helps

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .