Search code examples
windowstcpipipv6netstat

Windows - "netstat -an -p tcp" NOT Displaying IPv6 Foreign Addresses ("netstat -an" does)


On Windows Does anyone know why "netstat -an -p tcp" doesn't display IPv6 addresses, but why "netstat -an" does display them?

I highly doubt it's resolving IPv6 addresses to IPv4s, but this is puzzlibg the hell out of me.


Solution

  • From netstat /? in console (or [MS.Docs]: Netstat):

    -p proto Shows connections for the protocol specified by proto; proto may be any of: TCP, UDP, TCPv6, or UDPv6. If used with the -s option to display per-protocol statistics, proto may be any of: IP, IPv6, ICMP, ICMPv6, TCP, TCPv6, UDP, or UDPv6.

    So, when specifying -p tcp, it only displays the TCPv4 connections (by filtering out all the rest), while not specifying any protocol, it displays them all (doesn't filter anything).