1 .\" $NetBSD: netstat.1,v 1.53 2009/09/13 02:53:17 elad Exp $
3 .\" Copyright (c) 1983, 1990, 1992, 1993
4 .\" The Regents of the University of California. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" @(#)netstat.1 8.8 (Berkeley) 4/18/94
32 .Dd September 12, 2009
37 .Nd show network status
41 .Op Fl f Ar address_family
46 .Op Fl f Ar address_family
70 .Op Fl f Ar address_family
79 command symbolically displays the contents of various network-related
81 There are a number of output formats,
82 depending on the options for the information presented.
83 The first form of the command displays a list of active sockets for
85 The second form presents the contents of one of the other network
86 data structures according to the option selected.
87 Using the third form, with a
91 will continuously display the information regarding packet
92 traffic on the configured network interfaces.
93 The fourth form displays statistics about the named protocol.
94 The fifth and sixth forms display per interface statistics for
95 the specified protocol or address family.
97 The options have the following meaning:
100 With the default display,
101 show the address of any protocol control blocks associated with sockets; used
104 With the default display,
105 show the state of all sockets; normally sockets used by
106 server processes are not shown.
108 With the default display,
112 To show only the peers listening to a specific interface,
118 option is present, show the current
122 With the interface display (option
124 show bytes in and out, instead of packets in and out.
126 With either interface display (option
128 or an interval, as described below),
129 show the number of dropped packets.
130 .It Fl f Ar address_family
131 Limit statistics or address control block reports to those
134 The following address families
161 Show information related to multicast (group address) routing.
162 By default, show the IP Multicast virtual-interface and routing tables.
165 option is also present, show multicast routing statistics.
166 .It Fl I Ar interface
167 Show information about the specified interface;
170 interval as described below.
172 .Fl f Ar address_family
177 option is present, show per-interface statistics on the
185 Show the state of interfaces which have been auto-configured
186 (interfaces statically configured into a system, but not
187 located at boot time are not shown).
190 options is also present, multicast addresses currently in use are shown
191 for each Ethernet interface and for each IP interface address.
192 Multicast addresses are shown on separate lines following the interface
193 address with which they are associated.
195 .Fl f Ar address_family
200 option is present, show per-interface statistics on all interfaces
207 Don't show link-level routes (e.g., IPv4 ARP or IPv6 neighbour cache).
209 Extract values associated with the name list from the specified core
210 instead of the default
213 Show statistics recorded by the memory management routines
214 (the network manages a private pool of memory buffers).
216 Extract the name list from the specified system instead of the default
219 Show network addresses and ports as numbers (normally
221 interprets addresses and ports and attempts to display them
223 This option may be used with any of the display formats.
225 Dump the contents of the protocol control block (PCB) located at kernel
228 This address may be obtained using the
231 The default protocol is TCP, but may be overridden using the
235 Show statistics about
237 which is either a well-known name for a protocol or an alias for it.
238 Some protocol names and aliases are listed in the file
240 A null response typically means that there are no interesting numbers to
242 The program will complain if
244 is unknown or if there is no statistics routine for it.
246 Show software interrupt queue setting/statistics for all protocols.
248 Show the routing tables.
251 is also present, show routing statistics instead.
253 Show network addresses as numbers (as with
255 but show ports symbolically).
257 Show per-protocol statistics.
258 If this option is repeated, counters with a value of zero are suppressed.
260 Show extra (verbose) detail for the routing tables
262 or avoid truncation of long addresses.
264 Show network interface statistics at intervals of
270 when retrieving information.
273 may not be (fully) supported when using
275 This flag forces the use of the latter regardless, and emits a message if a
276 not yet fully supported feature is used in conjunction with it.
277 This flag might be removed at any time; do not rely on its presence.
280 The default display, for active sockets, shows the local
281 and remote addresses, send and receive queue sizes (in bytes), protocol,
282 and the internal state of the protocol.
283 Address formats are of the form ``host.port'' or ``network.port''
284 if a socket's address specifies a network but no specific host address.
285 When known the host and network addresses are displayed symbolically
286 according to the data bases
291 If a symbolic name for an address is unknown, or if
294 option is specified, the address is printed numerically, according
295 to the address family.
296 For more information regarding
297 the Internet ``dot format,''
301 or ``wildcard'', addresses and ports appear as ``*''.
304 command to find out which process or processes hold references to a socket.
306 The interface display provides a table of cumulative
307 statistics regarding packets transferred, errors, and collisions.
308 The network addresses of the interface
309 and the maximum transmission unit (``mtu'') are also displayed.
311 The routing table display indicates the available routes and
313 Each route consists of a destination host or network
314 and a gateway to use in forwarding packets.
315 The flags field shows
316 a collection of information about the route stored as
318 The individual flags are discussed in more
324 The mapping between letters and flags is:
325 .Bl -column XXXX RTF_BLACKHOLE
326 .It 1 RTF_PROTO1 Protocol specific routing flag #1
327 .It 2 RTF_PROTO2 Protocol specific routing flag #2
328 .It B RTF_BLACKHOLE Just discard pkts (during updates)
329 .It C RTF_CLONING Generate new routes on use
330 .It c RTF_CLONED Cloned routes (generated from RTF_CLONING)
331 .It D RTF_DYNAMIC Created dynamically (by redirect)
332 .It G RTF_GATEWAY Destination requires forwarding by intermediary
333 .It H RTF_HOST Host entry (net otherwise)
334 .It L RTF_LLINFO Valid protocol to link address translation.
335 .It M RTF_MODIFIED Modified dynamically (by redirect)
336 .It R RTF_REJECT Host or net unreachable
337 .It S RTF_STATIC Manually added
338 .It U RTF_UP Route usable
339 .It X RTF_XRESOLVE External daemon translates proto to link address
342 Direct routes are created for each
343 interface attached to the local host;
344 the gateway field for such entries shows the address of the outgoing interface.
345 The refcnt field gives the
346 current number of active uses of the route.
348 protocols normally hold on to a single route for the duration of
349 a connection while connectionless protocols obtain a route while sending
350 to the same destination.
351 The use field provides a count of the number of packets
352 sent using that route.
353 The mtu entry shows the mtu associated with
355 This mtu value is used as the basis for the TCP maximum
357 The 'L' flag appended to the mtu value indicates that
358 the value is locked, and that path mtu discovery is turned off for
362 indicates that the mtu for this route has not been set, and a default
363 TCP maximum segment size will be used.
364 The interface entry indicates
365 the network interface used for the route.
373 interval argument, it displays a running count of statistics related to
375 An obsolescent version of this option used a numeric parameter
376 with no option, and is currently supported for backward compatibility.
377 This display consists of a column for the primary interface (the first
378 interface found during autoconfiguration) and a column summarizing
379 information for all interfaces.
380 The primary interface may be replaced with another interface with the
383 The first line of each screen of information contains a summary since the
384 system was last rebooted.
385 Subsequent lines of output show values
386 accumulated over the preceding interval.
388 The first character of the flags column in the
390 option shows the status of the
392 descriptor which has three different values:
393 Idle ('I'), Waiting ('W') and Timed Out ('T').
394 The second character indicates whether the promisc flag is set.
395 The third character indicates the status of the immediate mode.
396 The fourth character indicates whether the peer will have the ability
397 to see the packets sent.
398 And the fifth character shows the header complete flag status.
418 IPv6 support was added by WIDE/KAME project.
420 .\" .Bl -tag -width /dev/kmem -compact
422 .\" default kernel namelist
424 .\" default memory file
427 The notion of errors is ill-defined.