Commit | Line | Data |
---|---|---|
ac63c3f4 KB |
1 | .\" Copyright (c) 1983 The Regents of the University of California. |
2 | .\" All rights reserved. | |
93874d5d | 3 | .\" |
ac63c3f4 KB |
4 | .\" Redistribution and use in source and binary forms are permitted |
5 | .\" provided that the above copyright notice and this paragraph are | |
6 | .\" duplicated in all such forms and that any documentation, | |
7 | .\" advertising materials, and other materials related to such | |
8 | .\" distribution and use acknowledge that the software was developed | |
9 | .\" by the University of California, Berkeley. The name of the | |
10 | .\" University may not be used to endorse or promote products derived | |
11 | .\" from this software without specific prior written permission. | |
12 | .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR | |
13 | .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | |
14 | .\" WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
15 | .\" | |
e3419641 | 16 | .\" @(#)netstat.1 6.8 (Berkeley) 9/20/88 |
93874d5d | 17 | .\" |
e3419641 | 18 | .TH NETSTAT 1 "September 20, 1988" |
93874d5d KM |
19 | .UC 5 |
20 | .SH NAME | |
21 | netstat \- show network status | |
22 | .SH SYNOPSIS | |
23 | .B netstat | |
24 | [ | |
84efacbd | 25 | .B \-Aan |
93874d5d | 26 | ] [ |
114898a7 KS |
27 | .B \-f |
28 | .I address_family | |
29 | ] [ | |
84efacbd | 30 | .I system |
93874d5d | 31 | ] [ |
84efacbd MK |
32 | .I core |
33 | ] | |
34 | .br | |
35 | .B netstat | |
36 | [ | |
37 | .B \-himnrs | |
93874d5d | 38 | ] [ |
84efacbd MK |
39 | .B \-f |
40 | .I address_family | |
93874d5d KM |
41 | ] [ |
42 | .I system | |
43 | ] [ | |
44 | .I core | |
45 | ] | |
84efacbd MK |
46 | .br |
47 | .B netstat | |
48 | [ | |
49 | .B \-n | |
50 | ] [ | |
51 | .B \-I | |
52 | .I interface | |
53 | ] | |
54 | .I interval | |
55 | [ | |
56 | .I system | |
57 | ] [ | |
58 | .I core | |
59 | ] | |
57d17fbd MK |
60 | .br |
61 | .B netstat | |
62 | [ | |
63 | .B \-p | |
64 | .I protocol | |
65 | ] [ | |
66 | .I system | |
67 | ] [ | |
68 | .I core | |
69 | ] | |
93874d5d KM |
70 | .SH DESCRIPTION |
71 | The | |
72 | .I netstat | |
73 | command symbolically displays the contents of various network-related | |
84efacbd MK |
74 | data structures. |
75 | There are a number of output formats, | |
76 | depending on the options for the information presented. | |
77 | The first form of the command displays a list of active sockets for | |
78 | each protocol. | |
79 | The second form presents the contents of one of the other network | |
80 | data structures according to the option selected. | |
81 | Using the third form, with an | |
82 | .I interval | |
83 | specified, | |
84 | .I netstat | |
85 | will continuously display the information regarding packet | |
86 | traffic on the configured network interfaces. | |
57d17fbd | 87 | The fourth form displays statistics about the named protocol. |
84efacbd MK |
88 | .PP |
89 | The options have the following meaning: | |
93874d5d KM |
90 | .TP |
91 | .B \-A | |
84efacbd MK |
92 | With the default display, |
93 | show the address of any protocol control blocks associated with sockets; used | |
94 | for debugging. | |
93874d5d KM |
95 | .TP |
96 | .B \-a | |
84efacbd | 97 | With the default display, |
93874d5d | 98 | show the state of all sockets; normally sockets used by |
84efacbd | 99 | server processes are not shown. |
77560d37 MK |
100 | .B \-d |
101 | With either interface display (option | |
102 | .B \-i | |
103 | or an interval, as described below), | |
104 | show the number of dropped packets. | |
93874d5d KM |
105 | .TP |
106 | .B \-h | |
84efacbd | 107 | Show the state of the IMP host table. |
93874d5d KM |
108 | .TP |
109 | .B \-i | |
84efacbd | 110 | Show the state of interfaces which have been auto-configured |
93874d5d | 111 | (interfaces statically configured into a system, but not |
84efacbd | 112 | located at boot time are not shown). |
93874d5d | 113 | .TP |
b8edfa5e | 114 | .BI \-I " interface" |
84efacbd MK |
115 | Show information only about this interface; |
116 | used with an | |
b8edfa5e | 117 | .I interval |
84efacbd | 118 | as described below. |
b8edfa5e | 119 | .TP |
93874d5d | 120 | .B \-m |
84efacbd MK |
121 | Show statistics recorded by the memory management routines |
122 | (the network manages a private pool of memory buffers). | |
93874d5d KM |
123 | .TP |
124 | .B \-n | |
84efacbd | 125 | Show network addresses as numbers (normally |
93874d5d KM |
126 | .I netstat |
127 | interprets addresses and attempts to display them | |
84efacbd MK |
128 | symbolically). |
129 | This option may be used with any of the display formats. | |
93874d5d | 130 | .TP |
57d17fbd MK |
131 | .BI \-p " protocol" |
132 | Show statistics about | |
133 | .IR protocol , | |
134 | which is either a well-known name for a protocol or an alias for it. Some | |
135 | protocol names and aliases are listed in the file | |
136 | .IR /etc/protocols . | |
137 | A null response typically means that there are no interesting numbers to | |
138 | report. | |
139 | The program will complain if | |
140 | .I protocol | |
141 | is unknown or if there is no statistics routine for it. | |
142 | .TP | |
93874d5d | 143 | .B \-s |
84efacbd | 144 | Show per-protocol statistics. |
93874d5d KM |
145 | .TP |
146 | .B \-r | |
84efacbd MK |
147 | Show the routing tables. |
148 | When | |
149 | .B \-s | |
150 | is also present, show routing statistics instead. | |
114898a7 KS |
151 | .TP |
152 | .BI \-f " address_family" | |
84efacbd | 153 | Limit statistics or address control block reports to those |
114898a7 KS |
154 | of the specified |
155 | .IR address\ family . | |
84efacbd MK |
156 | The following address families |
157 | are recognized: | |
114898a7 KS |
158 | .IR inet , |
159 | for | |
84efacbd | 160 | .BR AF_INET , |
114898a7 KS |
161 | .IR ns , |
162 | for | |
84efacbd MK |
163 | .BR AF_NS , |
164 | and | |
165 | .IR unix , | |
166 | for | |
167 | .BR AF_UNIX . | |
93874d5d KM |
168 | .PP |
169 | The arguments, | |
170 | .I system | |
171 | and | |
172 | .I core | |
173 | allow substitutes for the defaults ``/vmunix'' and ``/dev/kmem''. | |
174 | .PP | |
84efacbd | 175 | The default display, for active sockets, shows the local |
93874d5d | 176 | and remote addresses, send and receive queue sizes (in bytes), protocol, |
84efacbd | 177 | and the internal state of the protocol. |
93874d5d KM |
178 | Address formats are of the form ``host.port'' or ``network.port'' |
179 | if a socket's address specifies a network but no specific host address. | |
180 | When known the host and network addresses are displayed symbolically | |
181 | according to the data bases | |
182 | .I /etc/hosts | |
183 | and | |
184 | .IR /etc/networks , | |
185 | respectively. If a symbolic name for an address is unknown, or if | |
186 | the | |
187 | .B \-n | |
84efacbd MK |
188 | option is specified, the address is printed numerically, according |
189 | to the address family. | |
190 | For more information regarding | |
191 | the Internet ``dot format,'' | |
93874d5d | 192 | refer to |
84efacbd | 193 | .IR inet (3N). |
93874d5d KM |
194 | Unspecified, |
195 | or ``wildcard'', addresses and ports appear as ``*''. | |
196 | .PP | |
197 | The interface display provides a table of cumulative | |
198 | statistics regarding packets transferred, errors, and collisions. | |
84efacbd | 199 | The network addresses of the interface |
93874d5d KM |
200 | and the maximum transmission unit (``mtu'') are also displayed. |
201 | .PP | |
202 | The routing table display indicates the available routes and | |
203 | their status. Each route consists of a destination host or network | |
204 | and a gateway to use in forwarding packets. The flags field shows | |
84efacbd | 205 | the state of the route (``U'' if ``up''), whether the route |
77560d37 MK |
206 | is to a gateway (``G''), whether the route was created dynamically |
207 | by a redirect (``D''), and whether the route has been modified | |
208 | by a redirect (``M''). Direct routes are created for each | |
84efacbd MK |
209 | interface attached to the local host; |
210 | the gateway field for such entries shows the address of the outgoing interface. | |
211 | The refcnt field gives the | |
93874d5d KM |
212 | current number of active uses of the route. Connection oriented |
213 | protocols normally hold on to a single route for the duration of | |
84efacbd MK |
214 | a connection while connectionless protocols obtain a route while sending |
215 | to the same destination. | |
216 | The use field provides a count of the number of packets | |
93874d5d KM |
217 | sent using that route. The interface entry indicates the network |
218 | interface utilized for the route. | |
219 | .PP | |
220 | When | |
221 | .I netstat | |
222 | is invoked with an | |
223 | .I interval | |
224 | argument, it displays a running count of statistics related to | |
84efacbd MK |
225 | network interfaces. This display consists of a |
226 | column for the primary interface | |
227 | (the first interface found during autoconfiguration) | |
228 | and a column summarizing | |
229 | information for all interfaces. | |
230 | The primary interface may be replaced with another interface with the | |
231 | .I \-I | |
232 | option. | |
233 | The first line of each screen of information contains a summary since the | |
93874d5d KM |
234 | system was last rebooted. Subsequent lines of output show values |
235 | accumulated over the preceding interval. | |
236 | .SH SEE ALSO | |
237 | iostat(1), | |
238 | vmstat(1), | |
239 | hosts(5), | |
240 | networks(5), | |
241 | protocols(5), | |
242 | services(5), | |
ac63c3f4 | 243 | trpt(8) |
93874d5d KM |
244 | .SH BUGS |
245 | The notion of errors is ill-defined. Collisions mean | |
246 | something else for the IMP. |