HP-UX Reference (11i v1 05/09) - 1 User Commands N-Z (vol 2)

n
netstat(1) netstat(1)
NAME
netstat - show network status
SYNOPSIS
netstat [-an][-f address-family ][system [core ]]
netstat [-Mnrsv][-f address-family ][
-p protocol ][system [core ]]
netstat [-f address-family ][
-gin][-I interface ][interval ][system [core ]]
DESCRIPTION
netstat displays statistics for network interfaces and protocols, as well as the contents of various
network-related data structures. The output format varies according to the options selected. Some options
are ignored or invalid when used in combination with other options.
Generally, the netstat command takes one of the three forms shown above:
The first form of the command displays a list of active sockets for each protocol.
The second form displays the contents of one of the other network data structures according to the
option selected.
The third form displays configuration information for each network interface. It also displays net-
work traffic data on configured network interfaces, optionally updated at each interval,measured
in seconds.
Options are interpreted as follows:
-a Show the state of all sockets, including passive sockets used by server processes.
When netstat is used without any options only active sockets are shown. This
option does not show the state of X.25 programmatic access sockets. The option is
ignored if the -g, -i, -I, -M, -p, -r,
-s or interval option is specified.
-f address-family
Show statistics or address control block for only the specified address-family. The
following address families are recognized:
inet for AF_INET, inet6 for
AF_INET6, and unix for AF_UNIX. This option with AF_UNIX applies to the
-a and -s options. This option with AF_INET or AF_INET6 applies to the -a,
-i, -n, and -s options.
-g Show multicast information for network interfaces. Only the address family
AF_INET is recognized by this option. This option may be combined with the -i
option to display both kinds of information. The option is ignored if the -p option
is specified.
-i Show the state of network interfaces. Only the interfaces that have been
configured with an IP address or the plumb option using the ifconfig com-
mand are shown. The output includes both the primary and logical interfaces.
(See ifconfig(1M)). The counts for Ipkts and Opkts fields are for IP packets only.
This option is ignored if the -p option is specified.
-I interface Show information about the specified interface only. This option applies to the -g
and -i 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
and -v options.
-p protocol Show statistics for the specified protocol. The following protocols are recognized:
tcp, 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.
Section 1592 Hewlett-Packard Company 1 HP-UX 11i Version 1: September 2005