BSD 4_4 development
[unix-history] / usr / share / man / cat1 / netstat.0
CommitLineData
28b214ee
C
1NETSTAT(1) BSD Reference Manual NETSTAT(1)
2
3N\bNA\bAM\bME\bE
4 n\bne\bet\bts\bst\bta\bat\bt - show network status
5
6S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
7 n\bne\bet\bts\bst\bta\bat\bt [-\b-A\bAB\bBa\ban\bn] [-\b-f\bf _\ba_\bd_\bd_\br_\be_\bs_\bs_\b__\bf_\ba_\bm_\bi_\bl_\by] [_\bs_\by_\bs_\bt_\be_\bm] [_\bc_\bo_\br_\be]
8 n\bne\bet\bts\bst\bta\bat\bt [-\b-B\bBi\bim\bmn\bnr\brs\bs] [-\b-f\bf _\ba_\bd_\bd_\br_\be_\bs_\bs_\b__\bf_\ba_\bm_\bi_\bl_\by] [-\b-M\bM _\bc_\bo_\br_\be] [-\b-N\bN _\bs_\by_\bs_\bt_\be_\bm]
9 n\bne\bet\bts\bst\bta\bat\bt [-\b-n\bn] [-\b-I\bI [_\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be]] [-\b-M\bM _\bc_\bo_\br_\be] [-\b-N\bN _\bs_\by_\bs_\bt_\be_\bm] [-\b-w\bw _\bw_\ba_\bi_\bt]
10 n\bne\bet\bts\bst\bta\bat\bt [-\b-p\bp _\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl] [-\b-M\bM _\bc_\bo_\br_\be] [-\b-N\bN _\bs_\by_\bs_\bt_\be_\bm]
11
12D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
13 The n\bne\bet\bts\bst\bta\bat\bt command symbolically displays the contents of various net-
14 work-related data structures. There are a number of output formats, de-
15 pending on the options for the information presented. The first form of
16 the command displays a list of active sockets for each protocol. The
17 second form presents the contents of one of the other network data struc-
18 tures according to the option selected. Using the third form, with a
19 _\bw_\ba_\bi_\bt interval specified, n\bne\bet\bts\bst\bta\bat\bt will continuously display the informa-
20 tion regarding packet traffic on the configured network interfaces. The
21 fourth form displays statistics about the named protocol.
22
23 The options have the following meaning:
24
25 -\b-A\bA With the default display, show the address of any protocol control
26 blocks associated with sockets; used for debugging.
27
28 -\b-B\bB With the default display, show the multicast routing tables. When
29 -\b-s\bs is also present, show multicast routing statistics instead.
30
31 -\b-a\ba With the default display, show the state of all sockets; normally
32 sockets used by server processes are not shown.
33
34 -\b-d\bd With either interface display (option -\b-i\bi or an interval, as de-
35 scribed below), show the number of dropped packets.
36
37 -\b-i\bi Show the state of interfaces which have been auto-configured (in-
38 terfaces statically configured into a system, but not located at
39 boot time are not shown).
40
41 -\b-I\bI _\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be
42 Show information only about this interface; used with an _\bw_\ba_\bi_\bt in-
43 terval as described below.
44
45 -\b-M\bM Extract values associated with the name list from the specified
46 core instead of the default _\b/_\bd_\be_\bv_\b/_\bk_\bm_\be_\bm.
47
48 -\b-m\bm Show statistics recorded by the memory management routines (the
49 network manages a private pool of memory buffers).
50
51 -\b-N\bN Extract the name list from the specified system instead of the de-
52 fault _\b/_\bv_\bm_\bu_\bn_\bi_\bx.
53
54 -\b-n\bn Show network addresses as numbers (normally n\bne\bet\bts\bst\bta\bat\bt interprets ad-
55 dresses and attempts to display them symbolically). This option
56 may be used with any of the display formats.
57
58 -\b-p\bp _\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl
59 Show statistics about _\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl, which is either a well-known name
60 for a protocol or an alias for it. Some protocol names and aliases
61 are listed in the file _\b/_\be_\bt_\bc_\b/_\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl_\bs. A null response typically
62 means that there are no interesting numbers to report. The program
63 will complain if _\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl is unknown or if there is no statistics
64
65
66 routine for it.
67
68 -\b-s\bs Show per-protocol statistics.
69
70 -\b-r\br Show the routing tables. When -\b-s\bs is also present, show routing
71 statistics instead.
72
73 -\b-f\bf _\ba_\bd_\bd_\br_\be_\bs_\bs_\b__\bf_\ba_\bm_\bi_\bl_\by
74 Limit statistics or address control block reports to those of the
75 specified _\ba_\bd_\bd_\br_\be_\bs_\bs _\bf_\ba_\bm_\bi_\bl_\by. The following address families are recog-
76 nized: _\bi_\bn_\be_\bt, for AF_INET, _\bn_\bs, for AF_NS, and _\bu_\bn_\bi_\bx, for AF_UNIX.
77
78 The default display, for active sockets, shows the local and remote ad-
79 dresses, send and receive queue sizes (in bytes), protocol, and the in-
80 ternal state of the protocol. Address formats are of the form
81 ``host.port'' or ``network.port'' if a socket's address specifies a net-
82 work but no specific host address. When known the host and network ad-
83 dresses are displayed symbolically according to the data bases _\b/_\be_\bt_\bc_\b/_\bh_\bo_\bs_\bt_\bs
84 and _\b/_\be_\bt_\bc_\b/_\bn_\be_\bt_\bw_\bo_\br_\bk_\bs, respectively. If a symbolic name for an address is
85 unknown, or if the -\b-n\bn option is specified, the address is printed numeri-
86 cally, according to the address family. For more information regarding
87 the Internet ``dot format,'' refer to inet(3)). Unspecified, or ``wild-
88 card'', addresses and ports appear as ``*''.
89
90 The interface display provides a table of cumulative statistics regarding
91 packets transferred, errors, and collisions. The network addresses of
92 the interface and the maximum transmission unit (``mtu'') are also dis-
93 played.
94
95 The routing table display indicates the available routes and their sta-
96 tus. Each route consists of a destination host or network and a gateway
97 to use in forwarding packets. The flags field shows the state of the
98 route (``U'' if ``up''), whether the route is to a gateway (``G''),
99 whether the route was created dynamically by a redirect (``D''), and
100 whether the route has been modified by a redirect (``M''). Direct routes
101 are created for each interface attached to the local host; the gateway
102 field for such entries shows the address of the outgoing interface. The
103 refcnt field gives the current number of active uses of the route. Con-
104 nection oriented protocols normally hold on to a single route for the du-
105 ration of a connection while connectionless protocols obtain a route
106 while sending to the same destination. The use field provides a count of
107 the number of packets sent using that route. The interface entry indi-
108 cates the network interface utilized for the route.
109
110 When n\bne\bet\bts\bst\bta\bat\bt is invoked with a _\bw_\ba_\bi_\bt interval argument, it displays a run-
111 ning count of statistics related to network interfaces. This display
112 consists of a column for the primary interface (the first interface found
113 during autoconfiguration) and a column summarizing information for all
114 interfaces. The primary interface may be replaced with another interface
115 with the -\b-I\bI option. The first line of each screen of information con-
116 tains a summary since the system was last rebooted. Subsequent lines of
117 output show values accumulated over the preceding interval.
118
119S\bSE\bEE\bE A\bAL\bLS\bSO\bO
120 iostat(1), nfsstat(1), ps(1), vmstat(1), hosts(5), networks(5),
121 protocols(5), services(5), trpt(8), trsp(8)
122
123H\bHI\bIS\bST\bTO\bOR\bRY\bY
124 The n\bne\bet\bts\bst\bta\bat\bt command appeared in 4.2BSD.
125
126B\bBU\bUG\bGS\bS
127 The notion of errors is ill-defined.
128
129 Collisions mean something else for the IMP.
130
1314.2 Berkeley Distribution June 12, 1993 2