4 .\" Original: (mdw@tc.cornell.edu & dc6iq@insu1.etec.uni-karlsruhe.de)
6 .\" Modified: Bernd.Eckenfels@inka.de
7 .\" Modified: Andi Kleen ak@muc.de
8 .\" Modified: Tuan Hoang tqhoang@bigfoot.com
11 .TH NETSTAT 8 "19 December 2000" "net-tools" "Linux Programmer's Manual"
14 netstat \- Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships
19 .RI [ address_family_options ]
23 .RB [ \-\-listening | \-l ]
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]
36 .RB { \-\-route | \-r }
37 .RI [ address_family_options ]
38 .RB [ \-\-extend | \-e [ \-\-extend | \-e] ]
39 .RB [ \-\-verbose | \-v ]
40 .RB [ \-\-numeric | \-n ]
41 .RB [ \-\-numeric-hosts ] [ \-\-numeric-ports ] [ \-\-numeric-ports ]
42 .RB [ \-\-continuous | \-c]
46 .RB { \-\-interfaces | \-i }
49 .RB [ \-\-extend | \-e [ \-\-extend | \-e] ]
50 .RB [ \-\-verbose | \-v ]
51 .RB [ \-\-program | \-p ]
52 .RB [ \-\-numeric | \-n ]
53 .RB [ \-\-numeric-hosts ] [ \-\-numeric-ports ] [ \-\-numeric-ports ]
54 .RB [ \-\-continuous | \-c]
58 .RB { \-\-groups | \-g }
59 .RB [ \-\-numeric | \-n ]
60 .RB [ \-\-numeric-hosts ] [ \-\-numeric-ports ] [ \-\-numeric-ports ]
61 .RB [ \-\-continuous | \-c]
65 .RB { \-\-masquerade | \-M }
66 .RB [ \-\-extend | \-e ]
67 .RB [ \-\-numeric | \-n ]
68 .RB [ \-\-numeric-hosts ] [ \-\-numeric-ports ] [ \-\-numeric-ports ]
69 .RB [ \-\-continuous | \-c]
73 .RB { \-\-statistics | -s }
80 .RB { \-\-version | \-V }
83 .RB { \-\-help | \-h }
85 .IR address_family_options :
87 .RB [ \-\-protocol= { inet , unix , ipx , ax25 , netrom , ddp }[, ...] ]
88 .RB [ \-\-unix | \-x ]
89 .RB [ \-\-inet | \-\-ip ]
97 prints information about the Linux networking subsystem. The type of
98 information printed is controlled by the first argument, as follows:
103 displays a list of open sockets. If you don't specify any
104 address families, then the active sockets of all configured address
105 families will be printed.
106 .SS "\-\-route , \-r"
107 Display the kernel routing tables.
108 .SS "\-\-groups , \-g"
109 Display multicast group membership information for IPv4 and IPv6.
110 .SS "\-\-interface=\fIiface \fR, \fB\-i"
111 Display a table of all network interfaces, or the specified
113 .SS "\-\-masquerade , \-M"
114 Display a list of masqueraded connections.
115 .SS "\-\-statistics , \-s"
116 Display summary statistics for each protocol.
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
124 .SS "\-\-numeric-hosts"
125 shows numerical host addresses but does not affect the resolution of
127 .SS "\-\-numeric-ports"
128 shows numerical port numbers but does not affect the resolution of
130 .SS "\-\-numeric-users"
131 shows numerical user IDs but does not affect the resolution of host or
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.
138 is a comma (',') separated list of address family keywords like
146 This has the same effect as using the
148 .BR \-\-unix " (" \-x ),
158 includes raw, udp and tcp protocol sockets.
159 .SS "\-c, \-\-continuous"
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.)
172 Show both listening and non-listening sockets. With the
174 option, show interfaces that are not marked
176 Print routing information from the FIB. (This is the default.)
178 Print routing information from the route cache.
180 Netstat will cycle printing through statistics every
187 .SS Active Internet connections \fR(TCP, UDP, raw)\fR
189 The protocol (tcp, udp, raw) used by the socket.
191 The count of bytes not copied by the user program connected to this socket.
193 The count of bytes not acknowledged by the remote host.
195 Address and port number of the local end of the socket. Unless the
196 .BR \-\-numeric " (" \-n )
197 option is specified, the socket address is resolved to its canonical
198 host name (FQDN), and the port number is translated into the
199 corresponding service name.
200 .SS "Foreign Address"
201 Address and port number of the remote end of the socket.
202 Analogous to "Local Address."
204 The state of the socket. Since there are no states in raw mode and usually no
205 states used in UDP, this column may be left blank. Normally this can be one
210 The socket has an established connection.
214 The socket is actively attempting to establish a connection.
218 A connection request has been received from the network.
222 The socket is closed, and the connection is shutting down.
226 Connection is closed, and the socket is waiting for a shutdown from the
231 The socket is waiting after close to handle packets still in the network.
235 The socket is not being used.
239 The remote end has shut down, waiting for the socket to close.
243 The remote end has shut down, and the socket is closed. Waiting for
248 The socket is listening for incoming connections. Such sockets are
249 not included in the output unless you specify the
250 .BR \-\-listening " (" \-l )
252 .BR \-\-all " (" \-a )
257 Both sockets are shut down but we still don't have all our data
262 The state of the socket is unknown.
264 The username or the user id (UID) of the owner of the socket.
265 .SS "PID/Program name"
266 Slash-separated pair of the process id (PID) and process name of the
267 process that owns the socket.
269 causes this column to be included. You will also need
271 privileges to see this information on sockets you don't own. This
272 identification information is not yet available for IPX sockets.
274 (this needs to be written)
276 .SS Active UNIX domain Sockets
278 The protocol (usually unix) used by the socket.
280 The reference count (i.e. attached processes via this socket).
282 The flags displayed is SO_ACCEPTON (displayed as
289 is used on unconnected sockets if their corresponding
290 processes are waiting for a connect request. The other flags are not
293 There are several types of socket access:
297 The socket is used in Datagram (connectionless) mode.
301 This is a stream (connection) socket.
305 The socket is used as a raw socket.
309 This one serves reliably-delivered messages.
313 This is a sequential packet socket.
317 Raw interface access socket.
321 Who ever knows what the future will bring us - just fill in here :-)
324 This field will contain one of the following Keywords:
327 The socket is not allocated
330 The socket is listening for a connection request. Such
331 sockets are only included in the output if you specify the
332 .BR \-\-listening " (" \-l )
334 .BR \-\-all " (" \-a )
338 The socket is about to establish a connection.
341 The socket is connected.
344 The socket is disconnecting.
347 The socket is not connected to another one.
350 This state should never happen.
351 .SS "PID/Program name"
352 Process ID (PID) and process name of the process that has the socket open.
353 More info available in
354 .B "Active Internet connections"
355 section written above.
357 This is the path name as which the corresponding processes attached
360 .SS Active IPX sockets
361 (this needs to be done by somebody who knows it)
363 .SS Active NET/ROM sockets
364 (this needs to be done by somebody who knows it)
366 .SS Active AX.25 sockets
367 (this needs to be done by somebody who knows it)
370 Starting with Linux release 2.2
372 does not show interface statistics for alias interfaces. To get per
373 alias interface counters you need to setup explicit rules using the
380 -- The services translation file
383 -- Mount point for the proc filesystem, which gives access to kernel
384 status information via the following files.
387 -- device information
390 -- raw socket information
393 -- TCP socket information
396 -- UDP socket information
399 -- IGMP multicast information
402 -- Unix domain socket information
405 -- IPX socket information
408 -- AX25 socket information
410 .I /proc/net/appletalk
411 -- DDP (appletalk) socket information
414 -- NET/ROM socket information
417 -- IP routing information
419 .I /proc/net/ax25_route
420 -- AX25 routing information
422 .I /proc/net/ipx_route
423 -- IPX routing information
425 .I /proc/net/nr_nodes
428 .I /proc/net/nr_neigh
429 -- NET/ROM neighbours
431 .I /proc/net/ip_masquerade
432 -- masqueraded connections
446 Occasionally strange information may appear if a socket changes
447 as it is viewed. This is unlikely to occur.
450 The netstat user interface was written by Fred Baumgarten
451 <dc6iq@insu1.etec.uni-karlsruhe.de> the man page basically
452 by Matt Welsh <mdw@tc.cornell.edu>. It was updated by
453 Alan Cox <Alan.Cox@linux.org> but could do with a bit more
454 work. It was updated again by Tuan Hoang
455 <tqhoang@bigfoot.com>.
457 The man page and the command included in the net-tools
458 package is totally rewritten by Bernd Eckenfels