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