1 .\" Copyright (c) 1983, 1990, 1992, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\" must display the following acknowledgement:
14 .\" This product includes software developed by the University of
15 .\" California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" @(#)netstat.1 8.8 (Berkeley) 4/18/94
39 .Nd show network status
43 .Op Fl f Ar address_family
48 .Op Fl f Ar address_family
64 command symbolically displays the contents of various network-related
66 There are a number of output formats,
67 depending on the options for the information presented.
68 The first form of the command displays a list of active sockets for
70 The second form presents the contents of one of the other network
71 data structures according to the option selected.
72 Using the third form, with a
76 will continuously display the information regarding packet
77 traffic on the configured network interfaces.
78 The fourth form displays statistics about the named protocol.
80 The options have the following meaning:
83 With the default display,
84 show the address of any protocol control blocks associated with sockets; used
87 With the default display,
88 show the state of all sockets; normally sockets used by
89 server processes are not shown.
91 With either interface display (option
93 or an interval, as described below),
94 show the number of bytes in and out.
96 With either interface display (option
98 or an interval, as described below),
99 show the number of dropped packets.
100 .It Fl f Ar address_family
101 Limit statistics or address control block reports to those
104 The following address families
120 Show information related to multicast (group address) routing.
121 By default, show the IP Multicast virtual-interface and routing tables.
124 option is also present, show multicast routing statistics.
126 Show the state of the
128 host table (obsolete).
129 .It Fl I Ar interface
130 Show information about the specified interface;
133 interval as described below.
135 Show the state of interfaces which have been auto-configured
136 (interfaces statically configured into a system, but not
137 located at boot time are not shown).
140 options is also present, multicast addresses currently in use are shown
141 for each Ethernet interface and for each IP interface address.
142 Multicast addresses are shown on separate lines following the interface
143 address with which they are associated.
145 Extract values associated with the name list from the specified core
146 instead of the default
149 Show statistics recorded by the memory management routines
150 (the network manages a private pool of memory buffers).
152 Extract the name list from the specified system instead of the default
155 Show network addresses as numbers (normally
157 interprets addresses and attempts to display them
159 This option may be used with any of the display formats.
161 Show statistics about
163 which is either a well-known name for a protocol or an alias for it. Some
164 protocol names and aliases are listed in the file
166 A null response typically means that there are no interesting numbers to
168 The program will complain if
170 is unknown or if there is no statistics routine for it.
172 Show per-protocol statistics.
173 If this option is repeated, counters with a value of zero are suppressed.
175 Show the routing tables.
178 is also present, show routing statistics instead.
180 Show network interface statistics at intervals of
185 The default display, for active sockets, shows the local
186 and remote addresses, send and receive queue sizes (in bytes), protocol,
187 and the internal state of the protocol.
188 Address formats are of the form ``host.port'' or ``network.port''
189 if a socket's address specifies a network but no specific host address.
190 When known the host and network addresses are displayed symbolically
191 according to the data bases
195 respectively. If a symbolic name for an address is unknown, or if
198 option is specified, the address is printed numerically, according
199 to the address family.
200 For more information regarding
201 the Internet ``dot format,''
205 or ``wildcard'', addresses and ports appear as ``*''.
207 The interface display provides a table of cumulative
208 statistics regarding packets transferred, errors, and collisions.
209 The network addresses of the interface
210 and the maximum transmission unit (``mtu'') are also displayed.
212 The routing table display indicates the available routes and
213 their status. Each route consists of a destination host or network
214 and a gateway to use in forwarding packets. The flags field shows
215 a collection of information about the route stored as
216 binary choices. The individual flags are discussed in more
222 The mapping between letters and flags is:
223 .Bl -column XXXX RTF_BLACKHOLE
224 1 RTF_PROTO2 Protocol specific routing flag #1
225 2 RTF_PROTO1 Protocol specific routing flag #2
226 3 RTF_PROTO3 Protocol specific routing flag #3
227 B RTF_BLACKHOLE Just discard pkts (during updates)
228 C RTF_CLONING Generate new routes on use
229 c RTF_PRCLONING Protocol-specified generate new routes on use
230 D RTF_DYNAMIC Created dynamically (by redirect)
231 G RTF_GATEWAY Destination requires forwarding by intermediary
232 H RTF_HOST Host entry (net otherwise)
233 L RTF_LLINFO Valid protocol to link address translation
234 M RTF_MODIFIED Modified dynamically (by redirect)
235 R RTF_REJECT Host or net unreachable
236 S RTF_STATIC Manually added
237 U RTF_UP Route usable
238 W RTF_WASCLONED Route was generated as a result of cloning
239 X RTF_XRESOLVE External daemon translates proto to link address
242 Direct routes are created for each
243 interface attached to the local host;
244 the gateway field for such entries shows the address of the outgoing interface.
245 The refcnt field gives the
246 current number of active uses of the route. Connection oriented
247 protocols normally hold on to a single route for the duration of
248 a connection while connectionless protocols obtain a route while sending
249 to the same destination.
250 The use field provides a count of the number of packets
251 sent using that route. The interface entry indicates the network
252 interface utilized for the route.
260 interval argument, it displays a running count of statistics related to
262 An obsolescent version of this option used a numeric parameter
263 with no option, and is currently supported for backward compatibility.
264 This display consists of a column for the primary interface (the first
265 interface found during autoconfiguration) and a column summarizing
266 information for all interfaces.
267 The primary interface may be replaced with another interface with the
270 The first line of each screen of information contains a summary since the
271 system was last rebooted. Subsequent lines of output show values
272 accumulated over the preceding interval.
290 .\" .Bl -tag -width /dev/kmem -compact
292 .\" default kernel namelist
294 .\" default memory file
297 The notion of errors is ill-defined.