OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / net-tools / original / man8 / netstat.8
1 .\"
2 .\" netstat.8 
3 .\"
4 .\" Original: (mdw@tc.cornell.edu & dc6iq@insu1.etec.uni-karlsruhe.de)
5 .\"
6 .\" Modified: Bernd.Eckenfels@inka.de
7 .\" Modified: Andi Kleen ak@muc.de 
8 .\" Modified: Tuan Hoang tqhoang@bigfoot.com 
9 .\"
10 .\"
11 .TH NETSTAT 8 "19 December 2000" "net-tools" "Linux Programmer's Manual"
12
13 .SH NAME
14 netstat \- Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships
15
16 .SH SYNOPSIS
17
18 .B netstat 
19 .RI [ address_family_options ]
20 .RB [ \-\-tcp | \-t ]
21 .RB [ \-\-udp | \-u ]
22 .RB [ \-\-raw | \-w ]
23 .RB [ \-\-listening | \-l ]
24 .RB [ \-\-all | \-a ]
25 .RB [ \-\-numeric | \-n ]
26 .RB [ \-\-numeric-hosts ] [ \-\-numeric-ports ] [ \-\-numeric-ports ]
27 .RB [ \-\-symbolic | \-N ]
28 .RB [ \-\-extend | \-e  [ \-\-extend | \-e] ]
29 .RB [ \-\-timers | \-o ]
30 .RB [ \-\-program | \-p ]
31 .RB [ \-\-verbose | \-v ]
32 .RB [ \-\-continuous | \-c]
33 .P
34 .B netstat 
35 .RB { \-\-route | \-r }
36 .RI [ address_family_options ]
37 .RB [ \-\-extend | \-e  [ \-\-extend | \-e] ]
38 .RB [ \-\-verbose | \-v ]
39 .RB [ \-\-numeric | \-n ]
40 .RB [ \-\-numeric-hosts ] [ \-\-numeric-ports ] [ \-\-numeric-ports ]
41 .RB [ \-\-continuous | \-c]
42 .P
43 .B netstat
44 .RB { \-\-interfaces | \-i }
45 .RI [ iface ]
46 .RB [ \-\-all | \-a ]
47 .RB [ \-\-extend | \-e  [ \-\-extend | \-e] ]
48 .RB [ \-\-verbose | \-v ]
49 .RB [ \-\-program | \-p ]
50 .RB [ \-\-numeric | \-n ]
51 .RB [ \-\-numeric-hosts ] [ \-\-numeric-ports ] [ \-\-numeric-ports ]
52 .RB [ \-\-continuous | \-c]
53 .P
54 .B netstat
55 .RB { \-\-groups | \-g }
56 .RB [ \-\-numeric | \-n ]
57 .RB [ \-\-numeric-hosts ] [ \-\-numeric-ports ] [ \-\-numeric-ports ]
58 .RB [ \-\-continuous | \-c]
59 .P
60 .B netstat
61 .RB { \-\-masquerade | \-M }
62 .RB [ \-\-extend | \-e ]
63 .RB [ \-\-numeric | \-n ]
64 .RB [ \-\-numeric-hosts ] [ \-\-numeric-ports ] [ \-\-numeric-ports ]
65 .RB [ \-\-continuous | \-c]
66 .P
67 .B netstat
68 .RB { \-\-statistics | -s }
69 .RB [ \-\-tcp | \-t ]
70 .RB [ \-\-udp | \-u ]
71 .RB [ \-\-raw | \-w ]
72 .P
73 .B netstat 
74 .RB { \-\-version | \-V }
75 .P
76 .B netstat 
77 .RB { \-\-help | \-h }
78 .P
79 .IR address_family_options :
80 .PP
81 .RB [ \-\-protocol= { inet , unix , ipx , ax25 , netrom , ddp }[, ...] ]
82 .RB [ \-\-unix | \-x ] 
83 .RB [ \-\-inet | \-\-ip ]
84 .RB [ \-\-ax25 ]
85 .RB [ \-\-ipx ] 
86 .RB [ \-\-netrom ]
87 .RB [ \-\-ddp ]
88
89 .SH DESCRIPTION
90 .B Netstat
91 prints information about the Linux networking subsystem.  The type of
92 information printed is controlled by the first argument, as follows:
93 .SS (none)
94 By default,
95 .B
96 netstat 
97 displays a list of open sockets.  If you don't specify any
98 address families, then the active sockets of all configured address
99 families will be printed.
100 .SS "\-\-route , \-r"
101 Display the kernel routing tables.
102 .SS "\-\-groups , \-g"
103 Display multicast group membership information for IPv4 and IPv6.
104 .SS "\-\-interface=\fIiface \fR, \fB\-i"
105 Display a table of all network interfaces, or the specified
106 .IR iface ) .
107 .SS "\-\-masquerade , \-M"
108 Display a list of masqueraded connections.
109 .SS "\-\-statistics , \-s"
110 Display summary statistics for each protocol.
111 .SH OPTIONS
112 .SS "\-\-verbose , \-v"
113 Tell the user what is going on by being verbose. Especially print some
114 useful information about unconfigured address families.
115 .SS "\-\-numeric , \-n"
116 Show numerical addresses instead of trying to determine symbolic host, port
117 or user names.
118 .SS "\-\-numeric-hosts"
119 shows numerical host addresses but does not affect the resolution of
120 port or user names.
121 .SS "\-\-numeric-ports"
122 shows numerical port numbers but does not affect the resolution of
123 host or user names.
124 .SS "\-\-numeric-users"
125 shows numerical user IDs but does not affect the resolution of host or
126 port names.
127
128 .SS "\-\-protocol=\fIfamily \fR, \fB\-A"
129 Specifies the address families (perhaps better described as low level
130 protocols) for which connections are to be shown.
131 .I family 
132 is a comma (',') separated list of address family keywords like
133 .BR inet , 
134 .BR unix , 
135 .BR ipx , 
136 .BR ax25 , 
137 .BR netrom ,
138 and
139 .BR ddp .
140 This has the same effect as using the 
141 .BR \-\-inet ,
142 .BR \-\-unix " (" \-x ),
143 .BR \-\-ipx ,
144 .BR \-\-ax25 ,
145 .BR \-\-netrom ,
146 and
147 .B \-\-ddp 
148 options.
149 .P
150 The address family
151 .B inet
152 includes raw, udp and tcp protocol sockets.
153 .SS "\-c, \-\-continuous"
154 This will cause
155 .B netstat
156 to print the selected information every second continuously.
157 .SS "\-e, \-\-extend"
158 Display additional information.  Use this option twice for maximum detail.
159 .SS "\-o, \-\-timers"
160 Include information related to networking timers.
161 .SS "\-p, \-\-program"
162 Show the PID and name of the program to which each socket belongs.
163 .SS "\-l, \-\-listening"
164 Show only listening sockets.  (These are omitted by default.)
165 .SS "\-a, \-\-all"
166 Show both listening and non-listening sockets.  With the
167 .B --interfaces
168 option, show interfaces that are not marked 
169 .SS "\-F"
170 Print routing information from the FIB.  (This is the default.)
171 .SS "\-C"
172 Print routing information from the route cache.
173 .IR UP .
174 .P
175 .SH OUTPUT
176 .P
177 .SS Active Internet connections \fR(TCP, UDP, raw)\fR
178 .SS "Proto" 
179 The protocol (tcp, udp, raw) used by the socket. 
180 .SS "Recv-Q"
181 The count of bytes not copied by the user program connected to this socket.
182 .SS "Send-Q"
183 The count of bytes not acknowledged by the remote host.
184 .SS "Local Address" 
185 Address and port number of the local end of the socket.  Unless the
186 .BR \-\-numeric " (" \-n )
187 option is specified, the socket address is resolved to its canonical
188 host name (FQDN), and the port number is translated into the
189 corresponding service name.
190 .SS "Foreign Address"
191 Address and port number of the remote end of the socket.
192 Analogous to "Local Address."
193 .SS "State"
194 The state of the socket. Since there are no states in raw mode and usually no
195 states used in UDP, this column may be left blank. Normally this can be one
196 of several values:
197 .TP
198 .I
199 ESTABLISHED
200 The socket has an established connection.
201 .TP
202 .I
203 SYN_SENT
204 The socket is actively attempting to establish a connection.
205 .TP
206 .I
207 SYN_RECV
208 A connection request has been received from the network.
209 .TP
210 .I
211 FIN_WAIT1
212 The socket is closed, and the connection is shutting down.
213 .TP
214 .I
215 FIN_WAIT2
216 Connection is closed, and the socket is waiting for a shutdown from the
217 remote end.
218 .TP
219 .I
220 TIME_WAIT
221 The socket is waiting after close to handle packets still in the network.
222 .TP
223 .I
224 CLOSED
225 The socket is not being used.
226 .TP
227 .I
228 CLOSE_WAIT
229 The remote end has shut down, waiting for the socket to close.
230 .TP
231 .I
232 LAST_ACK
233 The remote end has shut down, and the socket is closed. Waiting for
234 acknowledgement.
235 .TP
236 .I
237 LISTEN
238 The socket is listening for incoming connections.  Such sockets are 
239 not included in the output unless you specify the 
240 .BR \-\-listening " (" \-l )
241 or 
242 .BR \-\-all " (" \-a )
243 option.
244 .TP
245 .I
246 CLOSING
247 Both sockets are shut down but we still don't have all our data
248 sent.
249 .TP
250 .I
251 UNKNOWN
252 The state of the socket is unknown.
253 .SS "User"
254 The username or the user id (UID) of the owner of the socket.
255 .SS "PID/Program name"
256 Slash-separated pair of the process id (PID) and process name of the 
257 process that owns the socket.
258 .B --program
259 causes this column to be included.  You will also need
260 .I superuser
261 privileges to see this information on sockets you don't own.  This
262 identification information is not yet available for IPX sockets.
263 .SS "Timer"
264 (this needs to be written)
265 .P
266 .SS Active UNIX domain Sockets
267 .SS "Proto" 
268 The protocol (usually unix) used by the socket.
269 .SS "RefCnt"
270 The reference count (i.e. attached processes via this socket).
271 .SS "Flags"
272 The flags displayed is SO_ACCEPTON (displayed as 
273 .BR ACC ),
274 SO_WAITDATA 
275 .RB ( W )
276 or SO_NOSPACE 
277 .RB ( N ). 
278 SO_ACCECPTON 
279 is used on unconnected sockets if their corresponding
280 processes are waiting for a connect request. The other flags are not
281 of normal interest.
282 .SS "Type"
283 There are several types of socket access:
284 .TP
285 .I
286 SOCK_DGRAM
287 The socket is used in Datagram (connectionless) mode.
288 .TP
289 .I
290 SOCK_STREAM
291 This is a stream (connection) socket.
292 .TP
293 .I
294 SOCK_RAW
295 The socket is used as a raw socket.
296 .TP
297 .I
298 SOCK_RDM
299 This one serves reliably-delivered messages.
300 .TP
301 .I
302 SOCK_SEQPACKET
303 This is a sequential packet socket.
304 .TP
305 .I
306 SOCK_PACKET
307 Raw interface access socket.
308 .TP
309 .I
310 UNKNOWN
311 Who ever knows what the future will bring us - just fill in here :-)
312 .PP
313 .SS "State"
314 This field will contain one of the following Keywords:
315 .TP
316 .I FREE
317 The socket is not allocated
318 .TP
319 .I LISTENING 
320 The socket is listening for a connection request.  Such
321 sockets are only included in the output if you specify the
322 .BR \-\-listening " (" \-l )
323 or
324 .BR \-\-all " (" \-a )
325 option.
326 .TP
327 .I CONNECTING
328 The socket is about to establish a connection.
329 .TP
330 .I CONNECTED
331 The socket is connected.
332 .TP
333 .I DISCONNECTING
334 The socket is disconnecting.
335 .TP
336 .I (empty)
337 The socket is not connected to another one.
338 .TP
339 .I UNKNOWN
340 This state should never happen.
341 .SS "PID/Program name"
342 Process ID (PID) and process name of the process that has the socket open. 
343 More info available in
344 .B "Active Internet connections"
345 section written above.
346 .SS "Path"
347 This is the path name as which the corresponding processes attached
348 to the socket.
349 .P
350 .SS Active IPX sockets
351 (this needs to be done by somebody who knows it)
352 .P
353 .SS Active NET/ROM sockets
354 (this needs to be done by somebody who knows it)
355 .P
356 .SS Active AX.25 sockets
357 (this needs to be done by somebody who knows it)
358 .PP
359 .SH NOTES
360 Starting with Linux release 2.2 
361 .B netstat -i 
362 does not show interface statistics for alias interfaces. To get per
363 alias interface counters you need to setup explicit rules using the
364 .BR ipchains(8) 
365 command.  
366
367 .SH FILES
368 .ta
369 .I /etc/services
370 -- The services translation file
371
372 .I /proc
373 -- Mount point for the proc filesystem, which gives access to kernel 
374 status information via the following files.
375
376 .I /proc/net/dev
377 -- device information
378
379 .I /proc/net/raw
380 -- raw socket information
381
382 .I /proc/net/tcp
383 -- TCP socket information
384
385 .I /proc/net/udp
386 -- UDP socket information
387
388 .I /proc/net/igmp
389 -- IGMP multicast information
390
391 .I /proc/net/unix
392 -- Unix domain socket information
393
394 .I /proc/net/ipx
395 -- IPX socket information
396
397 .I /proc/net/ax25
398 -- AX25 socket information
399
400 .I /proc/net/appletalk
401 -- DDP (appletalk) socket information
402
403 .I /proc/net/nr
404 -- NET/ROM socket information
405
406 .I /proc/net/route
407 -- IP routing information
408
409 .I /proc/net/ax25_route
410 -- AX25 routing information
411
412 .I /proc/net/ipx_route
413 -- IPX routing information
414
415 .I /proc/net/nr_nodes
416 -- NET/ROM nodelist
417
418 .I /proc/net/nr_neigh
419 -- NET/ROM neighbours
420
421 .I /proc/net/ip_masquerade
422 -- masqueraded connections
423
424 .I /proc/net/snmp
425 -- statistics
426 .fi
427 .P
428 .SH SEE ALSO
429 .BR route (8), 
430 .BR ifconfig (8), 
431 .BR ipchains (8),
432 .BR iptables (8),
433 .BR proc (5)
434 .P
435 .SH BUGS
436 Occasionally strange information may appear if a socket changes
437 as it is viewed. This is unlikely to occur.
438 .P
439 .SH AUTHORS
440 The netstat user interface was written by Fred Baumgarten
441 <dc6iq@insu1.etec.uni-karlsruhe.de> the man page basically
442 by Matt Welsh <mdw@tc.cornell.edu>. It was updated by
443 Alan Cox <Alan.Cox@linux.org> but could do with a bit more
444 work.  It was updated again by Tuan Hoang
445 <tqhoang@bigfoot.com>.
446 .br
447 The man page and the command included in the net-tools
448 package is totally rewritten by Bernd Eckenfels 
449 <ecki@linux.de>.