The netstat –s option displays protocol statistics for the UDP, TCP, SCTP, Internet Control Message Protocol (ICMP), and IP protocols.
Display protocol status as follows:
% netstat -s
Use the –P option to filter the output of the netstat command by protocol. This option is not limited to transport protocols.
You can specify the following values with this option:
icmp
icmpv6
igmp
ipv6tcp
rawip
sctp
tcp
udp
For example, you would filter the netstat output by the UDP protocol as follows:
% netstat -s -P udp UDP udpInDatagrams = 3704 udpInErrors = 0 udpOutDatagrams = 3703 udpOutErrors = 0Example 1-4 Displaying the Status of the TCP Protocol
The following example shows how you would display the results for the TCP protocol by specifying the –P option.
% netstat -P tcp TCP: IPv4 Local Address Remote Address Swind Send-Q Rwind Recv-Q State ----------------- -------------------- ----- ------ ----- ------ ------- lhost-1.login abc.def.local.Sun.COM.980 49640 0 49640 0 ESTABLISHED lhost.login ghi.jkl.local.Sun.COM.1020 49640 1 49640 0 ESTABLISHED remhost.1014 mno.pqr.remote.Sun.COM.nfsd 49640 0 49640 0 TIME_WAIT TCP: IPv6 Local Address Remote Address Swind Send-Q Rwind Recv-Q State If ---------------- ---------------------- ------ ----- ------ ----------- ----- localhost.38983 localhost.32777 49152 0 49152 0 ESTABLISHED localhost.32777 localhost.38983 49152 0 49152 0 ESTABLISHED localhost.38986 localhost.38980 49152 0 49152 0 ESTABLISHED