ischar => isascii
[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.\"
114898a7 5.\" @(#)netstat.1 6.3 (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
89.BR AF_INET and
90.IR ns ,
91for
92.BR AF_NS are
93recognized.
93874d5d
KM
94.PP
95The arguments,
96.I system
97and
98.I core
99allow substitutes for the defaults ``/vmunix'' and ``/dev/kmem''.
100.PP
101If an
102.I interval
103is specified,
104.I netstat
105will continuously display the information regarding packet
106traffic on the configured network interfaces, pausing
107.I interval
108seconds before refreshing the screen.
109.PP
110There are a number of display formats, depending on the information
111presented. The default display, for active sockets, shows the local
112and remote addresses, send and receive queue sizes (in bytes), protocol,
113and, optionally, the internal state of the protocol.
114.PP
115Address formats are of the form ``host.port'' or ``network.port''
116if a socket's address specifies a network but no specific host address.
117When known the host and network addresses are displayed symbolically
118according to the data bases
119.I /etc/hosts
120and
121.IR /etc/networks ,
122respectively. If a symbolic name for an address is unknown, or if
123the
124.B \-n
125option is specified, the address is printed in the Internet ``dot format'';
126refer to
127.IR inet (3N)
128for more information regarding this format.
129Unspecified,
130or ``wildcard'', addresses and ports appear as ``*''.
131.PP
132The interface display provides a table of cumulative
133statistics regarding packets transferred, errors, and collisions.
134The network address (currently Internet specific) of the interface
135and the maximum transmission unit (``mtu'') are also displayed.
136.PP
137The routing table display indicates the available routes and
138their status. Each route consists of a destination host or network
139and a gateway to use in forwarding packets. The flags field shows
140the state of the route (``U'' if ``up''), and whether the route
141is to a gateway (``G''). Direct routes are created for each
142interface attached to the local host. The refcnt field gives the
143current number of active uses of the route. Connection oriented
144protocols normally hold on to a single route for the duration of
145a connection while connectionless protocols obtain a route then
146discard it. The use field provides a count of the number of packets
147sent using that route. The interface entry indicates the network
148interface utilized for the route.
149.PP
150When
151.I netstat
152is invoked with an
153.I interval
154argument, it displays a running count of statistics related to
155network interfaces. This display consists of a column summarizing
156information for all interfaces, and a column for the interface with
157the most traffic since the system was last rebooted. The first
158line of each screen of information contains a summary since the
159system was last rebooted. Subsequent lines of output show values
160accumulated over the preceding interval.
161.SH SEE ALSO
162iostat(1),
163vmstat(1),
164hosts(5),
165networks(5),
166protocols(5),
167services(5),
168trpt(8C)
169.SH BUGS
170The notion of errors is ill-defined. Collisions mean
171something else for the IMP.
af4148ae
MK
172.PP
173The
174.B \-p
175option is not yet implemented.