3

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
  • 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). Commented Jan 9, 2018 at 15:53
  • Hmmmm....netstat -a does not work? Commented Jan 9, 2018 at 23:58

2 Answers 2

4

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)

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.