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