NETSTAT (1)NETSTAT

NAME

netstat show network status

SYNOPSIS

netstat [-AainrsSv][-p protocol] [interval]

DESCRIPTION

The netstat command symbolically displays the contents of network-related data structures to show the status of active connections (default), configured interfaces, routing tables, network statistics, STREAMS buffer allocation failures, and packet traffic. The effect of pertinent options will be described in the discussion of each type of status display.

Wherever they are included in a status display, local and remote address formats are of the form host.port. or network.port. The latter format is used if a transport endpoint's address specifies a network but no specific host address. The symbolic names of host, network, and port will be displayed wherever available from the name server (named(1M)) and the network databases (hosts(4), networks(4), and ser- vices(4)). The domain names will be stripped from the host and network names. If the symbolic name for an address cannot be determined, the address will be displayed in the Internet dot notation (see inet(3)). Where applicable, the -noption to netstat will disable the symbolic translation of the address fields. Unspecified or wildcard addresses and ports are identified by an asterisk (*).

The connection display (default) shows the status of active Internet connections. This display includes the protocol, the size in bytes of the send and receive queues, the local and remote addresses of the transport endpoints, and the internal state of the connection. The -Aoption adds the associated protocol control block (PCB) to the display. The -aoption includes the inactive connections (listen- ing servers). The -noption disables the symbolic translation of the local and remote addresses, causing both to be displayed in their Internet dot notation. The -pprotocol option limits the display to the specified protocol.

The interface display (-i) shows the status of the configured network interfaces. This display includes the interface name, the maximum transmission unit (Mtu) in bytes, the network and interface addresses, the number of packets received and sent, and the number of send and receive errors. The -noption disables the symbolic translation of the network and interface addresses, causing both to be displayed in their Internet dot notation. An asterisk (*) after the interface name means the interface is down.

The routing table display (-r) shows the status of the configured routes. This display includes the address of the destination host or network, the address of the gateway host, the status and type of the route (flags), the current number of active uses of the route (refcnt), the number of packets sent using that route (use), the maximum transmission unit (MTU) in bytes, and the interface name of the gate- way. A direct route is automatically added to the table for each configured interface when the network is brought up. Routes can also be added manually by the system administrator (route(1M)) or dynamically by the routing daemon (routed(1M)) or by IP itself if MTU discovery (RFC1191) is being used. The G flag indicates that the route is a gateway to another network. The H flag indicates that

E-28

Issue 3