netstat.1 (2010 09)
n
netstat(1) netstat(1)
The counts for the Ipkts and Opkts fields are for IP packets only.
This option is ignored if the
-p option is specified. By default, when the
-f
option is not specified, netstat
shows the state of interfaces configured with
either IPv4 or IPv6 addresses. An exception is when the user has not configured
any IPv6 address on any interface, netstat does not display the state of the
IPv6 loopback interface.
-I interface Show information about the specified interface only. This option applies to the
-g, -i, -z, and -Z
options.
-M Show the multicast routing tables. When
-s is used with the -M option,
netstat displays multicast routing statistics instead. This option is ignored if
the -p option is specified.
-n Show network addresses as numbers. Normally, netstat
interprets addresses
and attempts to display them symbolically. This option applies to the -a,
-i, -
r, -v, -z, and -Z
options.
-p protocol Show statistics for the specified protocol. The following protocols are recognized:
tcp, sctp, udp, ip,
icmp, igmp, ipv6, and icmpv6.
-r Show the routing tables. When -v is used with the
-r option, netstat also
displays the network masks in the route entries. This option is ignored if the
-
g, -i, -I, -p or interval option is specified and is invalid if the
-s option is
specified.
-s Show statistics for all protocols. When this option is used with the -M option,
netstat displays multicast routing statistics instead. This option is ignored if
the -g, -i, -I, -p or interval option is specified and is invalid if the
-r option
is specified.
-v Show additional routing information. When -v is used with the -r option,
netstat also displays the network masks in the route entries.
With SCTP, because there may be multiple addresses involved in a SCTP socket
endpoint, the
netstat -v command displays all local and remote addresses of
a SCTP socket.
Note: SCTP is available only if the optional SCTP bundle is installed.
-w Show the output in wide format. This option displays all the fields in the output
with their maximum resolution in a single line. Thus, the output can be worked
upon with text-processing tools. This option works only with the
-i option and
will be ignored when used with any other option.
-Z Display the current network interface statistics or protocol statistics, then set
them to zero. This option must be specified with either the
-I interface option,
or -i option, or the -p protocol option. This option supports the following proto-
cols only: tcp, udp, ip, icmp, igmp, ipv6, and icmpv6.
In addition, you must be superuser to use this option.
Note: If the statistics of an interface is zeroed using the
-Z option and the same
interface is reconfigured, then the statistics reported with -z option for that
interface will be inconsistent. So, after an interface is reconfigured, -z option
should be used only after zeroing the statistics again using -Z option.
-z Display statistics since they were last zeroed. By default, netstat displays
statistics since the system was last booted. Use this option with the -i, -I, and
-p, options only.
Note: For the -i option, the display of Ipkts and Opkts on a host system depends on the following
scenarios.
1. If the user configures virtual LANs on an interface (say lanX), with the IP addresses of the virtual
LANs (say lanX:1, lanX:2, and so on) belonging to the same subnet as that of the primary interface
(lanX:0), then the Opkts field of the primary interface (lanX:0) will always be incremented unless the
destination address is one of the local addresses on the host.
2 Hewlett-Packard Company − 2 − HP-UX 11i Version 3: September 2010