2

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?

  • 4
    /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). – EightBitTony Jan 9 '18 at 15:53
  • Hmmmm....netstat -a does not work? – mdpc Jan 9 '18 at 23:58
3

If you want to see all devices which have established connections to your machine, you can use

ss -t

to see all IPv4 and IPV6 tcp connections.


If you want the IPv6 equivalent of cat /proc/net/arp (that is, see all the machines on the local network for which you have cached the layer 2 address), use

ip -6 neigh

or simply

ip neigh

for the combined IPv4 and IPv6 neighboring nodes.

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 as you've seen in the comment: /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)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.