format changes and other fixes
[unix-history] / usr / src / usr.bin / netstat / netstat.1
CommitLineData
93874d5d
KM
1.\" Copyright (c) 1983 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
77570c49 5.\" @(#)netstat.1 6.4 (Berkeley) %G%
93874d5d 6.\"
b8edfa5e 7.TH NETSTAT 1 ""
93874d5d
KM
8.UC 5
9.SH NAME
10netstat \- show network status
11.SH SYNOPSIS
12.B netstat
13[
14.B \-Aahimnrs
15] [
114898a7
KS
16.B \-f
17.I address_family
18] [
b8edfa5e
KM
19.B \-I
20.I interface
93874d5d 21] [
b8edfa5e
KM
22.B \-p
23.I protocol
93874d5d
KM
24] [
25.I interval
26] [
27.I system
28] [
29.I core
30]
31.SH DESCRIPTION
32The
33.I netstat
34command symbolically displays the contents of various network-related
35data structures. The options have the following meaning:
36.TP
37.B \-A
38show the address of any associated protocol control blocks; used
39for debugging
40.TP
41.B \-a
42show the state of all sockets; normally sockets used by
43server processes are not shown
44.TP
45.B \-h
46show the state of the IMP host table
47.TP
48.B \-i
49show the state of interfaces which have been auto-configured
50(interfaces statically configured into a system, but not
51located at boot time are not shown)
52.TP
b8edfa5e
KM
53.BI \-I " interface"
54show information only about this interface
55(see also
56.I interval
57below)
58.TP
93874d5d
KM
59.B \-m
60show statistics recorded by the memory management routines
61(the network manages a ``private share'' of memory)
62.TP
63.B \-n
64show network addresses as numbers (normally
65.I netstat
66interprets addresses and attempts to display them
67symbolically)
68.TP
69.BI \-p " proto"
70show the state of sockets utilizing protocol
71.IR proto ;
72the protocol is specified symbolically, and may be any
73protocol listed in the file
74.IR /etc/protocols .
75.TP
76.B \-s
77show per-protocol statistics
78.TP
79.B \-r
80show the routing tables
114898a7
KS
81.TP
82.BI \-f " address_family"
83will limit statistics or address control block reports to those
84of the specified
85.IR address\ family .
86The two address families
87.IR inet ,
88for
77570c49
KM
89.B AF_INET
90and
114898a7
KS
91.IR ns ,
92for
77570c49
KM
93.B AF_NS
94are recognized.
93874d5d
KM
95.PP
96The arguments,
97.I system
98and
99.I core
100allow substitutes for the defaults ``/vmunix'' and ``/dev/kmem''.
101.PP
102If an
103.I interval
104is specified,
105.I netstat
106will continuously display the information regarding packet
107traffic on the configured network interfaces, pausing
108.I interval
109seconds before refreshing the screen.
110.PP
111There are a number of display formats, depending on the information
112presented. The default display, for active sockets, shows the local
113and remote addresses, send and receive queue sizes (in bytes), protocol,
114and, optionally, the internal state of the protocol.
115.PP
116Address formats are of the form ``host.port'' or ``network.port''
117if a socket's address specifies a network but no specific host address.
118When known the host and network addresses are displayed symbolically
119according to the data bases
120.I /etc/hosts
121and
122.IR /etc/networks ,
123respectively. If a symbolic name for an address is unknown, or if
124the
125.B \-n
126option is specified, the address is printed in the Internet ``dot format'';
127refer to
128.IR inet (3N)
129for more information regarding this format.
130Unspecified,
131or ``wildcard'', addresses and ports appear as ``*''.
132.PP
133The interface display provides a table of cumulative
134statistics regarding packets transferred, errors, and collisions.
135The network address (currently Internet specific) of the interface
136and the maximum transmission unit (``mtu'') are also displayed.
137.PP
138The routing table display indicates the available routes and
139their status. Each route consists of a destination host or network
140and a gateway to use in forwarding packets. The flags field shows
141the state of the route (``U'' if ``up''), and whether the route
142is to a gateway (``G''). Direct routes are created for each
143interface attached to the local host. The refcnt field gives the
144current number of active uses of the route. Connection oriented
145protocols normally hold on to a single route for the duration of
146a connection while connectionless protocols obtain a route then
147discard it. The use field provides a count of the number of packets
148sent using that route. The interface entry indicates the network
149interface utilized for the route.
150.PP
151When
152.I netstat
153is invoked with an
154.I interval
155argument, it displays a running count of statistics related to
156network interfaces. This display consists of a column summarizing
157information for all interfaces, and a column for the interface with
158the most traffic since the system was last rebooted. The first
159line of each screen of information contains a summary since the
160system was last rebooted. Subsequent lines of output show values
161accumulated over the preceding interval.
162.SH SEE ALSO
163iostat(1),
164vmstat(1),
165hosts(5),
166networks(5),
167protocols(5),
168services(5),
169trpt(8C)
170.SH BUGS
171The notion of errors is ill-defined. Collisions mean
172something else for the IMP.
af4148ae
MK
173.PP
174The
175.B \-p
176option is not yet implemented.