HP-UX Reference (11i v2 03/08) - 1 User Commands N-Z (vol 2)

n
netstat(1) netstat(1)
NAME
netstat - show network status
SYNOPSIS
netstat [-an][-f address-family ][system ]
netstat [-an][-f address-family ][system [ core ]]
# PA-RISC only
netstat
[-Mnrsv][-f address-family ][
-p protocol ][system ]
netstat [-Mnrsv][-f address-family ][
-p protocol ][system [ core ]]
# PA-RISC only
netstat [-ginw][-I interface ][interval ][system ]
netstat [-ginw][-I interface ][interval ][system [ core ]]
# PA-RISC only
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
network traffic data on configured network interfaces, optionally updated at each interval , meas-
ured 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. 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 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,
HP-UX 11i Version 2: August 2003 1 Hewlett-Packard Company Section 1573