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