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]
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]
44 .RB { \-\-interfaces | \-i }
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]
55 .RB { \-\-groups | \-g }
56 .RB [ \-\-numeric | \-n ]
57 .RB [ \-\-numeric-hosts ] [ \-\-numeric-ports ] [ \-\-numeric-ports ]
58 .RB [ \-\-continuous | \-c]
61 .RB { \-\-masquerade | \-M }
62 .RB [ \-\-extend | \-e ]
63 .RB [ \-\-numeric | \-n ]
64 .RB [ \-\-numeric-hosts ] [ \-\-numeric-ports ] [ \-\-numeric-ports ]
65 .RB [ \-\-continuous | \-c]
68 .RB { \-\-statistics | -s }
74 .RB { \-\-version | \-V }
77 .RB { \-\-help | \-h }
79 .IR address_family_options :
81 .RB [ \-\-protocol= { inet , unix , ipx , ax25 , netrom , ddp }[, ...] ]
82 .RB [ \-\-unix | \-x ]
83 .RB [ \-\-inet | \-\-ip ]
91 prints information about the Linux networking subsystem. The type of
92 information printed is controlled by the first argument, as follows:
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
107 .SS "\-\-masquerade , \-M"
108 Display a list of masqueraded connections.
109 .SS "\-\-statistics , \-s"
110 Display summary statistics for each protocol.
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
118 .SS "\-\-numeric-hosts"
119 shows numerical host addresses but does not affect the resolution of
121 .SS "\-\-numeric-ports"
122 shows numerical port numbers but does not affect the resolution of
124 .SS "\-\-numeric-users"
125 shows numerical user IDs but does not affect the resolution of host or
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.
132 is a comma (',') separated list of address family keywords like
140 This has the same effect as using the
142 .BR \-\-unix " (" \-x ),
152 includes raw, udp and tcp protocol sockets.
153 .SS "\-c, \-\-continuous"
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.)
166 Show both listening and non-listening sockets. With the
168 option, show interfaces that are not marked
170 Print routing information from the FIB. (This is the default.)
172 Print routing information from the route cache.
177 .SS Active Internet connections \fR(TCP, UDP, raw)\fR
179 The protocol (tcp, udp, raw) used by the socket.
181 The count of bytes not copied by the user program connected to this socket.
183 The count of bytes not acknowledged by the remote host.
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."
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
200 The socket has an established connection.
204 The socket is actively attempting to establish a connection.
208 A connection request has been received from the network.
212 The socket is closed, and the connection is shutting down.
216 Connection is closed, and the socket is waiting for a shutdown from the
221 The socket is waiting after close to handle packets still in the network.
225 The socket is not being used.
229 The remote end has shut down, waiting for the socket to close.
233 The remote end has shut down, and the socket is closed. Waiting for
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 )
242 .BR \-\-all " (" \-a )
247 Both sockets are shut down but we still don't have all our data
252 The state of the socket is unknown.
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.
259 causes this column to be included. You will also need
261 privileges to see this information on sockets you don't own. This
262 identification information is not yet available for IPX sockets.
264 (this needs to be written)
266 .SS Active UNIX domain Sockets
268 The protocol (usually unix) used by the socket.
270 The reference count (i.e. attached processes via this socket).
272 The flags displayed is SO_ACCEPTON (displayed as
279 is used on unconnected sockets if their corresponding
280 processes are waiting for a connect request. The other flags are not
283 There are several types of socket access:
287 The socket is used in Datagram (connectionless) mode.
291 This is a stream (connection) socket.
295 The socket is used as a raw socket.
299 This one serves reliably-delivered messages.
303 This is a sequential packet socket.
307 Raw interface access socket.
311 Who ever knows what the future will bring us - just fill in here :-)
314 This field will contain one of the following Keywords:
317 The socket is not allocated
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 )
324 .BR \-\-all " (" \-a )
328 The socket is about to establish a connection.
331 The socket is connected.
334 The socket is disconnecting.
337 The socket is not connected to another one.
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.
347 This is the path name as which the corresponding processes attached
350 .SS Active IPX sockets
351 (this needs to be done by somebody who knows it)
353 .SS Active NET/ROM sockets
354 (this needs to be done by somebody who knows it)
356 .SS Active AX.25 sockets
357 (this needs to be done by somebody who knows it)
360 Starting with Linux release 2.2
362 does not show interface statistics for alias interfaces. To get per
363 alias interface counters you need to setup explicit rules using the
370 -- The services translation file
373 -- Mount point for the proc filesystem, which gives access to kernel
374 status information via the following files.
377 -- device information
380 -- raw socket information
383 -- TCP socket information
386 -- UDP socket information
389 -- IGMP multicast information
392 -- Unix domain socket information
395 -- IPX socket information
398 -- AX25 socket information
400 .I /proc/net/appletalk
401 -- DDP (appletalk) socket information
404 -- NET/ROM socket information
407 -- IP routing information
409 .I /proc/net/ax25_route
410 -- AX25 routing information
412 .I /proc/net/ipx_route
413 -- IPX routing information
415 .I /proc/net/nr_nodes
418 .I /proc/net/nr_neigh
419 -- NET/ROM neighbours
421 .I /proc/net/ip_masquerade
422 -- masqueraded connections
436 Occasionally strange information may appear if a socket changes
437 as it is viewed. This is unlikely to occur.
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>.
447 The man page and the command included in the net-tools
448 package is totally rewritten by Bernd Eckenfels