1 .\" $NetBSD: netstat.1,v 1.72 2015/03/23 18:33:17 roy 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
37 .Nd show network status
39 .ds address_family Fl f Ar address_family Ns Op , Ns Ar family ...
42 .Op \*[address_family]
46 .Op Fl bdghiLlmnqrSsTtv
47 .Op \*[address_family]
71 .Op \*[address_family]
80 command symbolically displays the contents of various network-related
82 There are a number of output formats,
83 depending on the options for the information presented.
84 The first form of the command displays a list of active sockets for
86 The second form presents the contents of one of the other network
87 data structures according to the option selected.
88 Using the third form, with a
92 will continuously display the information regarding packet
93 traffic on the configured network interfaces.
94 The fourth form displays statistics about the named protocol.
95 The fifth and sixth forms display per interface statistics for
96 the specified protocol or address family.
98 The options have the following meaning:
101 With the default display,
102 show the address of any protocol control blocks associated with sockets; used
105 With the default display,
106 show the state of all sockets; normally sockets used by
107 server processes are not shown.
109 With the default display,
113 To show only the peers listening to a specific interface,
119 option is present, show the current
123 With the interface display (option
125 show bytes in and out, instead of packets in and out.
127 With either interface display (option
129 or an interval, as described below),
130 show the number of dropped packets.
131 .It \*[address_family]
132 Limit statistics or address control block reports to those
134 .Ar address_families .
135 The following address families
162 Show information related to multicast (group address) routing.
163 By default, show the IP Multicast virtual-interface and routing tables.
166 option is also present, show multicast routing statistics.
170 in combination with either
174 output "human-readable" byte counts.
175 .It Fl I Ar interface
176 Show information about the specified interface;
179 interval as described below.
181 .Fl f Ar address_family
186 option is present, show per-interface statistics on the
194 Show the state of interfaces which have been auto-configured
195 (interfaces statically configured into a system, but not
196 located at boot time are not shown).
199 options is also present, multicast addresses currently in use are shown
200 for each Ethernet interface and for each IP interface address.
201 Multicast addresses are shown on separate lines following the interface
202 address with which they are associated.
204 .Fl f Ar address_family
209 option is present, show per-interface statistics on all interfaces
216 Don't show link-level routes (e.g., IPv4 ARP or IPv6 neighbour cache).
220 option, display wider fields for the IPv6 multicast routing table
230 to retrieve information and
231 extract values associated with the name list from the specified core.
234 option is not given but the
236 option is given, the default
240 Show statistics recorded by the mbuf memory management routines
241 (the network manages a private pool of memory buffers).
247 to retrieve information and extract the name list from the specified system.
248 For the default behavior when only
250 option is given, see the description about when
255 .Xr kvm_openfiles 3 .
257 Show network addresses and ports as numbers (normally
259 interprets addresses and ports and attempts to display them
261 This option may be used with any of the display formats.
263 Dump the contents of the protocol control block (PCB) located at kernel
266 This address may be obtained using the
269 The default protocol is TCP, but may be overridden using the
273 Show statistics about
275 which is either a well-known name for a protocol or an alias for it.
276 Some protocol names and aliases are listed in the file
278 A null response typically means that there are no interesting numbers to
280 The program will complain if
282 is unknown or if there is no statistics routine for it.
284 Show software interrupt queue setting/statistics for all protocols.
286 Show the routing tables.
289 is also present, show routing statistics instead.
291 Show network addresses as numbers (as with
293 but show ports symbolically).
295 Show per-protocol statistics.
296 If this option is repeated, counters with a value of zero are suppressed.
298 Show MPLS Tags for the routing tables.
299 If multiple tags exists, they will
300 be comma separated, first tag being the BoS one.
304 option, display the current value of the watchdog timer function.
306 Show extra (verbose) detail for the routing tables
308 or avoid truncation of long addresses.
310 Show network interface statistics at intervals of
316 when retrieving information.
319 may not be (fully) supported when using
321 This flag forces the use of the latter regardless, and emits a message if a
322 not yet fully supported feature is used in conjunction with it.
323 This flag might be removed at any time; do not rely on its presence.
326 The default display, for active sockets, shows the local
327 and remote addresses, send and receive queue sizes (in bytes), protocol,
328 and the internal state of the protocol.
329 Address formats are of the form ``host.port'' or ``network.port''
330 if a socket's address specifies a network but no specific host address.
331 When known the host and network addresses are displayed symbolically
332 according to the data bases
337 If a symbolic name for an address is unknown, or if
340 option is specified, the address is printed numerically, according
341 to the address family.
342 For more information regarding
343 the Internet ``dot format,''
347 or ``wildcard'', addresses and ports appear as ``*''.
350 command to find out which process or processes hold references to a socket.
352 The interface display provides a table of cumulative
353 statistics regarding packets transferred, errors, and collisions.
354 The network addresses of the interface
355 and the maximum transmission unit (``mtu'') are also displayed.
357 The routing table display indicates the available routes and
359 Each route consists of a destination host or network
360 and a gateway to use in forwarding packets.
361 The flags field shows
362 a collection of information about the route stored as
364 The individual flags are discussed in more
370 The mapping between letters and flags is:
371 .Bl -column XXXX RTF_BLACKHOLE
372 .It 1 RTF_PROTO1 Protocol specific routing flag #1
373 .It 2 RTF_PROTO2 Protocol specific routing flag #2
374 .It B RTF_BLACKHOLE Just discard pkts (during updates)
375 .It b RTF_BROADCAST Route represents a broadcast address
376 .It C RTF_CLONING Generate new routes on use
377 .It c RTF_CLONED Cloned routes (generated from RTF_CLONING)
378 .It D RTF_DYNAMIC Created dynamically (by redirect)
379 .It G RTF_GATEWAY Destination requires forwarding by intermediary
380 .It H RTF_HOST Host entry (net otherwise)
381 .It L RTF_LLINFO Valid protocol to link address translation.
382 .It l RTF_LOCAL Route represents a local address
383 .It M RTF_MODIFIED Modified dynamically (by redirect)
384 .It p RTF_ANNOUNCE Link level proxy
385 .It R RTF_REJECT Host or net unreachable
386 .It S RTF_STATIC Manually added
387 .It U RTF_UP Route usable
388 .It X RTF_XRESOLVE External daemon translates proto to link address
391 Direct routes are created for each
392 interface attached to the local host;
393 the gateway field for such entries shows the address of the outgoing interface.
394 The refcnt field gives the
395 current number of active uses of the route.
397 protocols normally hold on to a single route for the duration of
398 a connection while connectionless protocols obtain a route while sending
399 to the same destination.
400 The use field provides a count of the number of packets
401 sent using that route.
402 The mtu entry shows the mtu associated with
404 This mtu value is used as the basis for the TCP maximum
406 The 'L' flag appended to the mtu value indicates that
407 the value is locked, and that path mtu discovery is turned off for
411 indicates that the mtu for this route has not been set, and a default
412 TCP maximum segment size will be used.
413 The interface entry indicates
414 the network interface used for the route.
422 interval argument, it displays a running count of statistics related to
424 An obsolescent version of this option used a numeric parameter
425 with no option, and is currently supported for backward compatibility.
426 This display consists of a column for the primary interface (the first
427 interface found during autoconfiguration) and a column summarizing
428 information for all interfaces.
429 The primary interface may be replaced with another interface with the
432 The first line of each screen of information contains a summary since the
433 system was last rebooted.
434 Subsequent lines of output show values
435 accumulated over the preceding interval.
437 The first character of the flags column in the
439 option shows the status of the
441 descriptor which has three different values:
442 Idle ('I'), Waiting ('W') and Timed Out ('T').
443 The second character indicates whether the promisc flag is set.
444 The third character indicates the status of the immediate mode.
445 The fourth character indicates whether the peer will have the ability
446 to see the packets sent.
447 And the fifth character shows the header complete flag status.
467 IPv6 support was added by WIDE/KAME project.
469 .\" .Bl -tag -width /dev/mem -compact
471 .\" default kernel namelist
473 .\" default memory file
476 The notion of errors is ill-defined.