Print this page
XXXX adding PID information to netstat output
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man1m/netstat.1m
+++ new/usr/src/man/man1m/netstat.1m
1 1 '\" te
2 2 .\" Copyright (C) 2002, Sun Microsystems, Inc. All Rights Reserved
3 3 .\" Copyright 1989 AT&T
4 4 .\" Copyright (c) 1983 Regents of the University of California. All rights reserved. The Berkeley software License Agreement specifies the terms and conditions for redistribution.
5 -.TH NETSTAT 1M "Sep 02, 2015"
5 +.TH NETSTAT 1M "Jul 12, 2016"
6 6 .SH NAME
7 7 netstat \- show network status
8 8 .SH SYNOPSIS
9 9 .LP
10 10 .nf
11 -\fBnetstat\fR [\fB-anvR\fR] [\fB-f\fR \fIaddress_family\fR] [\fB-P\fR \fIprotocol\fR]
11 +\fBnetstat\fR [\fB-anuvR\fR] [\fB-f\fR \fIaddress_family\fR] [\fB-P\fR \fIprotocol\fR]
12 12 .fi
13 13
14 14 .LP
15 15 .nf
16 16 \fBnetstat\fR \fB-g\fR [\fB-nv\fR] [\fB-f\fR \fIaddress_family\fR]
17 17 .fi
18 18
19 19 .LP
20 20 .nf
21 21 \fBnetstat\fR \fB-p\fR [\fB-n\fR] [\fB-f\fR \fIaddress_family\fR]
22 22 .fi
23 23
24 24 .LP
25 25 .nf
26 26 \fBnetstat\fR \fB-s\fR [\fB-f\fR \fIaddress_family\fR] [\fB-P\fR \fIprotocol\fR]
27 27 [\fB-T\fR u | d ] [\fIinterval\fR [\fIcount\fR]]
28 28 .fi
29 29
30 30 .LP
31 31 .nf
32 32 \fBnetstat\fR \fB-m\fR [\fB-T\fR u | d ] [\fB-v\fR] [\fIinterval\fR [\fIcount\fR]]
33 33 .fi
34 34
35 35 .LP
36 36 .nf
37 37 \fBnetstat\fR \fB-i\fR [\fB-I\fR \fIinterface\fR] [\fB-an\fR] [\fB-f\fR \fIaddress_family\fR]
38 38 [\fB-T\fR u | d ] [\fIinterval\fR [\fIcount\fR]]
39 39 .fi
40 40
41 41 .LP
42 42 .nf
43 43 \fBnetstat\fR \fB-r\fR [\fB-anvR\fR] [\fB-f\fR \fIaddress_family\fR | \fIfilter\fR]
44 44 .fi
45 45
46 46 .LP
47 47 .nf
48 48 \fBnetstat\fR \fB-M\fR [\fB-ns\fR] [\fB-f\fR \fIaddress_family\fR]
49 49 .fi
50 50
51 51 .LP
52 52 .nf
53 53 \fBnetstat\fR \fB-D\fR [\fB-I\fR \fIinterface\fR] [\fB-f\fR \fIaddress_family\fR]
54 54 .fi
55 55
56 56 .SH DESCRIPTION
57 57 .LP
58 58 The \fBnetstat\fR command displays the contents of certain network-related data
59 59 structures in various formats, depending on the options you select.
60 60 .LP
61 61 The \fBnetstat\fR command has the several forms shown in the SYNOPSIS section,
62 62 above, listed as follows:
63 63 .RS +4
64 64 .TP
65 65 .ie t \(bu
66 66 .el o
67 67 The first form of the command (with no required arguments) displays a list of
68 68 active sockets for each protocol.
69 69 .RE
70 70 .RS +4
71 71 .TP
72 72 .ie t \(bu
73 73 .el o
74 74 The second, third, and fourth forms (\fB-g\fR, \fB-p\fR, and \fB-s\fR options)
75 75 display information from various network data structures.
76 76 .RE
77 77 .RS +4
78 78 .TP
79 79 .ie t \(bu
80 80 .el o
81 81 The fifth form (\fB-m\fR option) displays STREAMS memory statistics.
82 82 .RE
83 83 .RS +4
84 84 .TP
85 85 .ie t \(bu
86 86 .el o
87 87 The sixth form (\fB-i\fR option) shows the state of the interfaces.
88 88 .RE
89 89 .RS +4
90 90 .TP
91 91 .ie t \(bu
92 92 .el o
93 93 The seventh form (\fB-r\fR option) displays the routing table.
94 94 .RE
95 95 .RS +4
96 96 .TP
97 97 .ie t \(bu
98 98 .el o
99 99 The eighth form (\fB-M\fR option) displays the multicast routing table.
100 100 .RE
101 101 .RS +4
102 102 .TP
103 103 .ie t \(bu
104 104 .el o
105 105 The ninth form (\fB-D\fR option) displays the state of \fBDHCP\fR on one or all
106 106 interfaces.
107 107 .RE
108 108 .LP
109 109 These forms are described in greater detail below.
110 110 .LP
111 111 With no arguments (the first form), \fBnetstat\fR displays connected sockets
112 112 for \fBPF_INET\fR, \fBPF_INET6\fR, and \fBPF_UNIX\fR, unless modified otherwise
113 113 by the \fB-f\fR option.
114 114 .SH OPTIONS
115 115 .ne 2
116 116 .na
117 117 \fB\fB-a\fR\fR
118 118 .ad
119 119 .sp .6
120 120 .RS 4n
121 121 Show the state of all sockets, all routing table entries, or all interfaces,
122 122 both physical and logical. Normally, listener sockets used by server processes
123 123 are not shown. Under most conditions, only interface, host, network, and
124 124 default routes are shown and only the status of physical interfaces is shown.
125 125 .RE
126 126
127 127 .sp
128 128 .ne 2
129 129 .na
130 130 \fB\fB-f\fR \fIaddress_family\fR\fR
131 131 .ad
132 132 .sp .6
133 133 .RS 4n
134 134 Limit all displays to those of the specified \fIaddress_family\fR. The value of
135 135 \fIaddress_family\fR can be one of the following:
136 136 .sp
137 137 .ne 2
138 138 .na
139 139 \fB\fBinet\fR\fR
140 140 .ad
141 141 .RS 9n
142 142 For the \fBAF_INET\fR address family showing IPv4 information.
143 143 .RE
144 144
145 145 .sp
146 146 .ne 2
147 147 .na
148 148 \fB\fBinet6\fR\fR
149 149 .ad
150 150 .RS 9n
151 151 For the \fBAF_INET6\fR address family showing IPv6 information.
152 152 .RE
153 153
154 154 .sp
155 155 .ne 2
156 156 .na
157 157 \fB\fBunix\fR\fR
158 158 .ad
159 159 .RS 9n
160 160 For the \fBAF_UNIX\fR address family.
161 161 .RE
162 162
163 163 .RE
164 164
165 165 .sp
166 166 .ne 2
167 167 .na
168 168 \fB\fB-f\fR \fIfilter\fR\fR
169 169 .ad
170 170 .sp .6
171 171 .RS 4n
172 172 With \fB-r\fR only, limit the display of routes to those matching the specified
173 173 filter. A filter rule consists of a \fIkeyword\fR:\fIvalue\fR pair. The known
174 174 keywords and the value syntax are:
175 175 .sp
176 176 .ne 2
177 177 .na
178 178 \fB\fBaf:\fR{\fBinet\fR|\fBinet6\fR|\fBunix\fR|\fInumber\fR}\fR
179 179 .ad
180 180 .sp .6
181 181 .RS 4n
182 182 Selects an address family. This is identical to \fB-f\fR \fIaddress_family\fR
183 183 and both syntaxes are supported.
184 184 .RE
185 185
186 186 .sp
187 187 .ne 2
188 188 .na
189 189 \fB\fBoutif\fR:{\fIname\fR|\fIifIndex\fR|\fBany\fR|\fBnone\fR}\fR
190 190 .ad
191 191 .sp .6
192 192 .RS 4n
193 193 Selects an output interface. You can specify the interface by name (such as
194 194 \fBhme0\fR) or by \fBifIndex\fR number (for example, \fB2\fR). If \fBany\fR is
195 195 used, the filter matches all routes having a specified interface (anything
196 196 other than null). If \fBnone\fR is used, the filter matches all routes having a
197 197 null interface. Note that you can view the index number (\fIifIndex\fR) for an
198 198 interface with the \fB-a\fR option of \fBifconfig\fR(1M).
199 199 .RE
200 200
201 201 .sp
202 202 .ne 2
203 203 .na
204 204 \fB\fBdst\fR:{\fIip-address\fR[/\fImask\fR]|\fBany\fR|\fBnone\fR}\fR
205 205 .ad
206 206 .sp .6
207 207 .RS 4n
208 208 Selects a destination IP address. If specified with a mask length, then any
209 209 routes with matching or longer (more specific) masks are selected. If \fBany\fR
210 210 is used, then all but addresses but 0 are selected. If \fBnone\fR is used, then
211 211 address 0 is selected.
212 212 .RE
213 213
214 214 .sp
215 215 .ne 2
216 216 .na
217 217 \fB\fBflags:\fR[\fB+ -\fR]?[\fBABDGHLMSU\fR]\fB+\fR\fR
218 218 .ad
219 219 .sp .6
220 220 .RS 4n
221 221 Selects routes tagged with the specified flags. By default, the flags as
222 222 specified must be set in order to match. With a leading \fB+\fR, the flags
223 223 specified must be set but others are ignored. With a leading \fB-\fR, the flags
224 224 specified must not be set and others are permitted.
225 225 .RE
226 226
227 227 You can specify multiple instances of \fB-f\fR to specify multiple filters. For
228 228 example:
229 229 .sp
230 230 .in +2
231 231 .nf
232 232 % netstat -nr -f outif:hme0 -f outif:hme1 -f dst:10.0.0.0/8
233 233 .fi
234 234 .in -2
235 235 .sp
236 236
237 237 The preceding command displays routes within network 10.0.0.0/8, with mask
238 238 length 8 or greater, and an output interface of either \fBhme0\fR or
239 239 \fBhme1\fR, and excludes all other routes.
240 240 .RE
241 241
242 242 .sp
243 243 .ne 2
244 244 .na
245 245 \fB\fB-g\fR\fR
246 246 .ad
247 247 .sp .6
248 248 .RS 4n
249 249 Show the multicast group memberships for all interfaces. If the \fB-v\fR option
250 250 is included, source-specific membership information is also displayed. See
251 251 DISPLAYS, below.
252 252 .RE
253 253
254 254 .sp
255 255 .ne 2
256 256 .na
257 257 \fB\fB-i\fR\fR
258 258 .ad
259 259 .sp .6
260 260 .RS 4n
261 261 Show the state of the interfaces that are used for \fBIP\fR traffic. Normally
262 262 this shows statistics for the physical interfaces. When combined with the
263 263 \fB-a\fR option, this will also report information for the logical interfaces.
264 264 See \fBifconfig\fR(1M).
265 265 .RE
266 266
267 267 .sp
268 268 .ne 2
269 269 .na
270 270 \fB\fB-m\fR\fR
271 271 .ad
272 272 .sp .6
273 273 .RS 4n
274 274 Show the STREAMS memory statistics.
275 275 .RE
276 276
277 277 .sp
278 278 .ne 2
279 279 .na
280 280 \fB\fB-n\fR\fR
281 281 .ad
282 282 .sp .6
283 283 .RS 4n
284 284 Show network addresses as numbers. \fBnetstat\fR normally displays addresses as
285 285 symbols. This option may be used with any of the display formats.
286 286 .RE
287 287
288 288 .sp
289 289 .ne 2
290 290 .na
291 291 \fB\fB-p\fR\fR
292 292 .ad
293 293 .sp .6
294 294 .RS 4n
295 295 Show the net to media tables. See DISPLAYS, below.
296 296 .RE
297 297
298 298 .sp
299 299 .ne 2
300 300 .na
301 301 \fB\fB-r\fR\fR
302 302 .ad
303 303 .sp .6
304 304 .RS 4n
305 305 Show the routing tables. Normally, only interface, host, network, and default
306 306 routes are shown, but when this option is combined with the \fB-a\fR option,
307 307 all routes will be displayed, including cache. If you have not set up a
308 308 multicast route, \fB-ra\fR might not show any multicast routing entries,
309 309 although the kernel will derive such an entry if needed.
310 310 .RE
311 311
312 312 .sp
313 313 .ne 2
314 314 .na
315 315 \fB\fB-s\fR\fR
316 316 .ad
317 317 .sp .6
318 318 .RS 4n
319 319 Show per-protocol statistics. When used with the \fB-M\fR option, show
320 320 multicast routing statistics instead. When used with the \fB-a\fR option,
321 321 per-interface statistics will be displayed, when available, in addition to
322 322 statistics global to the system. See DISPLAYS, below.
323 323 .RE
324 324
325 325 .sp
326 326 .ne 2
↓ open down ↓ |
305 lines elided |
↑ open up ↑ |
327 327 .na
328 328 \fB\fB-T\fR \fBu\fR | \fBd\fR\fR
329 329 .ad
330 330 .sp .6
331 331 .RS 4n
332 332 Display a time stamp.
333 333 .sp
334 334 Specify \fBu\fR for a printed representation of the internal representation of
335 335 time. See \fBtime\fR(2). Specify \fBd\fR for standard date format. See
336 336 \fBdate\fR(1).
337 +.RE
338 +
339 +.sp
340 +.ne 2
341 +.na
342 +\fB\fB-u\fR\fR
343 +.ad
344 +.sp .6
345 +.RS 4n
346 +When specified, for each network endpoint \fBnetstat\fR will print the list of
347 +the processes currently have an open file descriptor pointing to that endpoint.
348 +\fBnetstat\fR will list the username, process id, and the program for each
349 +process in that list.
337 350 .RE
338 351
339 352 .sp
340 353 .ne 2
341 354 .na
342 355 \fB\fB-v\fR\fR
343 356 .ad
344 357 .sp .6
345 358 .RS 4n
346 359 Verbose. Show additional information for the sockets, STREAMS memory
347 360 statistics, routing table, and multicast group memberships.
348 361 .RE
349 362
350 363 .sp
351 364 .ne 2
352 365 .na
353 366 \fB\fB-I\fR \fIinterface\fR\fR
354 367 .ad
355 368 .sp .6
356 369 .RS 4n
357 370 Show the state of a particular interface. \fIinterface\fR can be any valid
358 371 interface such as \fBhme0\fR or \fBeri0\fR. Normally, the status and statistics
359 372 for physical interfaces are displayed. When this option is combined with the
360 373 \fB-a\fR option, information for the logical interfaces is also reported.
361 374 .RE
362 375
363 376 .sp
364 377 .ne 2
365 378 .na
366 379 \fB\fB-M\fR\fR
367 380 .ad
368 381 .sp .6
369 382 .RS 4n
370 383 Show the multicast routing tables. When used with the \fB-s\fR option, show
371 384 multicast routing statistics instead.
372 385 .RE
373 386
374 387 .sp
375 388 .ne 2
376 389 .na
377 390 \fB\fB-P\fR \fIprotocol\fR\fR
378 391 .ad
379 392 .sp .6
380 393 .RS 4n
381 394 Limit display of statistics or state of all sockets to those applicable to
382 395 \fIprotocol\fR. The protocol can be one of \fBip\fR, \fBipv6\fR, \fBicmp\fR,
383 396 \fBicmpv6\fR, \fBicmp\fR, \fBicmpv6\fR, \fBigmp\fR, \fBudp\fR, \fBtcp\fR,
384 397 \fBrawip\fR. \fBrawip\fR can also be specified as \fBraw\fR. The command
385 398 accepts protocol options only as all lowercase.
386 399 .RE
387 400
388 401 .sp
389 402 .ne 2
390 403 .na
391 404 \fB\fB-D\fR\fR
392 405 .ad
393 406 .sp .6
394 407 .RS 4n
395 408 Show the status of \fBDHCP\fR configured interfaces.
396 409 .RE
397 410
398 411 .sp
399 412 .ne 2
400 413 .na
401 414 \fB\fB-R\fR\fR
402 415 .ad
403 416 .sp .6
404 417 .RS 4n
405 418 This modifier displays extended security attributes for sockets and routing
406 419 table entries. The \fB-R\fR modifier is available only if the system is
407 420 configured with the Solaris Trusted Extensions feature.
408 421 .sp
409 422 With \fB-r\fR only, this option displays the routing entries' gateway security
410 423 attributes. See \fBroute\fR(1M) for more information on security attributes.
411 424 .sp
412 425 When displaying socket information using the first form of the command, this
413 426 option displays additional information for Multi-Level Port(MLP) sockets. This
414 427 includes:
415 428 .RS +4
416 429 .TP
417 430 .ie t \(bu
418 431 .el o
419 432 The label for the peer if the socket is connected.
420 433 .RE
421 434 .RS +4
422 435 .TP
423 436 .ie t \(bu
424 437 .el o
425 438 The following flags can be appended to the socket's "State" output:
426 439 .RS
427 440
428 441 .sp
429 442 .ne 2
430 443 .na
431 444 \fB\fBP\fR\fR
432 445 .ad
433 446 .RS 5n
434 447 The socket is a MLP on zone-private IP addresses.
435 448 .RE
436 449
437 450 .sp
438 451 .ne 2
439 452 .na
440 453 \fB\fBS\fR\fR
441 454 .ad
442 455 .RS 5n
443 456 The socket is a MLP on IP addresses shared between zones.
444 457 .RE
445 458 .SH OPERANDS
446 459 .ne 2
447 460 .na
448 461 \fB\fIinterval\fR\fR
449 462 .ad
450 463 .RS 12n
451 464 Display statistics accumulated since last display every \fIinterval\fR seconds,
452 465 repeating forever, unless \fIcount\fR is specified. When invoked with
453 466 \fIinterval\fR, the first row of netstat output shows statistics accumulated
454 467 since last reboot.
455 468 .sp
456 469 The following options support \fIinterval\fR: \fB-i\fR, \fB-m\fR, \fB-s\fR and
457 470 \fB-Ms\fR. Some values are configuration parameters and are just redisplayed at
458 471 each interval.
459 472 .RE
460 473
461 474 .sp
462 475 .ne 2
463 476 .na
464 477 \fB\fIcount\fR\fR
465 478 .ad
466 479 .RS 12n
467 480 Display interface statistics the number of times specified by \fIcount\fR, at
468 481 the interval specified by \fIinterval\fR.
469 482 .RE
470 483
471 484 .SH DISPLAYS
472 485 .SS "Active Sockets (First Form)"
473 486 .LP
474 487 The display for each active socket shows the local and remote address, the send
475 488 and receive queue sizes (in bytes), the send and receive windows (in bytes),
476 489 and the internal state of the protocol.
477 490 .LP
478 491 The symbolic format normally used to display socket addresses is either:
479 492 .sp
480 493 .in +2
481 494 .nf
482 495 \fBhostname\fR.\fIport\fR
483 496 .fi
484 497 .in -2
485 498 .sp
486 499 when the name of the host is specified, or
487 500 .sp
488 501 .in +2
489 502 .nf
490 503 \fInetwork\fR.\fIport\fR
491 504 .fi
492 505 .in -2
493 506 .sp
494 507 if a socket address specifies a network but no specific host.
495 508 .LP
496 509 The numeric host address or network number associated with the socket is used
497 510 to look up the corresponding symbolic hostname or network name in the
498 511 \fIhosts\fR or \fInetworks\fR database.
499 512 .LP
500 513 If the network or hostname for an address is not known, or if the \fB-n\fR
501 514 option is specified, the numerical network address is shown. Unspecified, or
502 515 "wildcard", addresses and ports appear as an asterisk (\fB*\fR). For more
503 516 information regarding the Internet naming conventions, refer to \fBinet\fR(7P)
504 517 and \fBinet6\fR(7P).
505 518 .LP
506 519 For SCTP sockets, because an endpoint can be represented by multiple addresses,
507 520 the verbose option (\fB-v\fR) displays the list of all the local and remote
508 521 addresses.
509 522 .SS "\fITCP Sockets\fR"
510 523 .LP
511 524 The possible state values for \fBTCP\fR sockets are as follows:
512 525 .sp
513 526 .ne 2
514 527 .na
515 528 \fB\fBBOUND\fR\fR
516 529 .ad
517 530 .RS 16n
518 531 Bound, ready to connect or listen.
519 532 .RE
520 533
521 534 .sp
522 535 .ne 2
523 536 .na
524 537 \fB\fBCLOSED\fR\fR
525 538 .ad
526 539 .RS 16n
527 540 Closed. The socket is not being used.
528 541 .RE
529 542
530 543 .sp
531 544 .ne 2
532 545 .na
533 546 \fB\fBCLOSING\fR\fR
534 547 .ad
535 548 .RS 16n
536 549 Closed, then remote shutdown; awaiting acknowledgment.
537 550 .RE
538 551
539 552 .sp
540 553 .ne 2
541 554 .na
542 555 \fB\fBCLOSE_WAIT\fR\fR
543 556 .ad
544 557 .RS 16n
545 558 Remote shutdown; waiting for the socket to close.
546 559 .RE
547 560
548 561 .sp
549 562 .ne 2
550 563 .na
551 564 \fB\fBESTABLISHED\fR\fR
552 565 .ad
553 566 .RS 16n
554 567 Connection has been established.
555 568 .RE
556 569
557 570 .sp
558 571 .ne 2
559 572 .na
560 573 \fB\fBFIN_WAIT_1\fR\fR
561 574 .ad
562 575 .RS 16n
563 576 Socket closed; shutting down connection.
564 577 .RE
565 578
566 579 .sp
567 580 .ne 2
568 581 .na
569 582 \fB\fBFIN_WAIT_2\fR\fR
570 583 .ad
571 584 .RS 16n
572 585 Socket closed; waiting for shutdown from remote.
573 586 .RE
574 587
575 588 .sp
576 589 .ne 2
577 590 .na
578 591 \fB\fBIDLE\fR\fR
579 592 .ad
580 593 .RS 16n
581 594 Idle, opened but not bound.
582 595 .RE
583 596
584 597 .sp
585 598 .ne 2
586 599 .na
587 600 \fB\fBLAST_ACK\fR\fR
588 601 .ad
589 602 .RS 16n
590 603 Remote shutdown, then closed; awaiting acknowledgment.
591 604 .RE
592 605
593 606 .sp
594 607 .ne 2
595 608 .na
596 609 \fB\fBLISTEN\fR\fR
597 610 .ad
598 611 .RS 16n
599 612 Listening for incoming connections.
600 613 .RE
601 614
602 615 .sp
603 616 .ne 2
604 617 .na
605 618 \fB\fBSYN_RECEIVED\fR\fR
606 619 .ad
607 620 .RS 16n
608 621 Initial synchronization of the connection under way.
609 622 .RE
610 623
611 624 .sp
612 625 .ne 2
613 626 .na
614 627 \fB\fBSYN_SENT\fR\fR
615 628 .ad
616 629 .RS 16n
617 630 Actively trying to establish connection.
618 631 .RE
619 632
620 633 .sp
621 634 .ne 2
622 635 .na
623 636 \fB\fBTIME_WAIT\fR\fR
624 637 .ad
625 638 .RS 16n
626 639 Wait after close for remote shutdown retransmission.
627 640 .RE
628 641
629 642 .SS "\fISCTP Sockets\fR"
630 643 .LP
631 644 The possible state values for SCTP sockets are as follows:
632 645 .sp
633 646 .ne 2
634 647 .na
635 648 \fB\fBCLOSED\fR\fR
636 649 .ad
637 650 .RS 21n
638 651 Closed. The socket is not being used.
639 652 .RE
640 653
641 654 .sp
642 655 .ne 2
643 656 .na
644 657 \fB\fBLISTEN\fR\fR
645 658 .ad
646 659 .RS 21n
647 660 Listening for incoming associations.
648 661 .RE
649 662
650 663 .sp
651 664 .ne 2
652 665 .na
653 666 \fB\fBESTABLISHED\fR\fR
654 667 .ad
655 668 .RS 21n
656 669 Association has been established.
657 670 .RE
658 671
659 672 .sp
660 673 .ne 2
661 674 .na
662 675 \fB\fBCOOKIE_WAIT\fR\fR
663 676 .ad
664 677 .RS 21n
665 678 \fBINIT\fR has been sent to the peer, awaiting acknowledgment.
666 679 .RE
667 680
668 681 .sp
669 682 .ne 2
670 683 .na
671 684 \fB\fBCOOKIE_ECHOED\fR\fR
672 685 .ad
673 686 .RS 21n
674 687 State cookie from the INIT-ACK has been sent to the peer, awaiting
675 688 acknowledgement.
676 689 .RE
677 690
678 691 .sp
679 692 .ne 2
680 693 .na
681 694 \fB\fBSHUTDOWN_PENDING\fR\fR
682 695 .ad
683 696 .RS 21n
684 697 \fBSHUTDOWN\fR has been received from the upper layer, awaiting acknowledgement
685 698 of all outstanding \fBDATA\fR from the peer.
686 699 .RE
687 700
688 701 .sp
689 702 .ne 2
690 703 .na
691 704 \fB\fBSHUTDOWN_SENT\fR\fR
692 705 .ad
693 706 .RS 21n
694 707 All outstanding data has been acknowledged in the \fBSHUTDOWN_SENT\fR state.
695 708 \fBSHUTDOWN\fR has been sent to the peer, awaiting acknowledgement.
696 709 .RE
697 710
698 711 .sp
699 712 .ne 2
700 713 .na
701 714 \fB\fBSHUTDOWN_RECEIVED\fR\fR
702 715 .ad
703 716 .RS 21n
704 717 \fBSHUTDOWN\fR has been received from the peer, awaiting acknowledgement of all
705 718 outstanding \fBDATA\fR.
706 719 .RE
707 720
708 721 .sp
709 722 .ne 2
710 723 .na
711 724 \fB\fBSHUTDOWN_ACK_SENT\fR\fR
712 725 .ad
713 726 .RS 21n
714 727 All outstanding data has been acknowledged in the \fBSHUTDOWN_RECEIVED\fR
715 728 state. \fBSHUTDOWN_ACK\fR has been sent to the peer.
716 729 .RE
717 730
718 731 .SS "Network Data Structures (Second Through Fifth Forms)"
719 732 .LP
720 733 The form of the display depends upon which of the \fB-g\fR, \fB-m\fR, \fB-p\fR,
721 734 or \fB-s\fR options you select.
722 735 .sp
723 736 .ne 2
724 737 .na
725 738 \fB\fB-g\fR\fR
726 739 .ad
727 740 .RS 6n
728 741 Displays the list of multicast group membership.
729 742 .RE
730 743
731 744 .sp
732 745 .ne 2
733 746 .na
734 747 \fB\fB-m\fR\fR
735 748 .ad
736 749 .RS 6n
737 750 Displays the memory usage, for example, STREAMS mblks.
738 751 .RE
739 752
740 753 .sp
741 754 .ne 2
742 755 .na
743 756 \fB\fB-p\fR\fR
744 757 .ad
745 758 .RS 6n
746 759 Displays the net to media mapping table. For IPv4, the address resolution table
747 760 is displayed. See \fBarp\fR(1M). For IPv6, the neighbor cache is displayed.
748 761 .RE
749 762
750 763 .sp
751 764 .ne 2
752 765 .na
753 766 \fB\fB-s\fR\fR
754 767 .ad
755 768 .RS 6n
756 769 Displays the statistics for the various protocol layers.
757 770 .RE
758 771
759 772 .sp
760 773 .LP
761 774 The statistics use the MIB specified variables. The defined values for
762 775 \fBipForwarding\fR are:
763 776 .sp
764 777 .ne 2
765 778 .na
766 779 \fB\fBforwarding(1)\fR\fR
767 780 .ad
768 781 .RS 21n
769 782 Acting as a gateway.
770 783 .RE
771 784
772 785 .sp
773 786 .ne 2
774 787 .na
775 788 \fB\fBnot-forwarding(2)\fR\fR
776 789 .ad
777 790 .RS 21n
778 791 Not acting as a gateway.
779 792 .RE
780 793
781 794 .sp
782 795 .LP
783 796 The IPv6 and ICMPv6 protocol layers maintain per-interface statistics. If the
784 797 \fB-a\fR option is specified with the \fB-s\fR option, then the per-interface
785 798 statistics as well as the total sums are displayed. Otherwise, just the sum of
786 799 the statistics are shown.
787 800 .LP
788 801 For the second, third, and fourth forms of the command, you must specify at
789 802 least \fB-g\fR, \fB-p\fR, or \fB-s\fR. You can specify any combination of these
790 803 options. You can also specify \fB-m\fR (the fifth form) with any set of the
791 804 \fB-g\fR, \fB-p\fR, and \fB-s\fR options. If you specify more than one of these
792 805 options, \fBnetstat\fR displays the information for each one of them.
793 806 .SS "Interface Status (Sixth Form)"
794 807 .LP
795 808 The interface status display lists information for all current interfaces, one
796 809 interface per line. If an interface is specified using the \fB-I\fR option, it
797 810 displays information for only the specified interface.
798 811 .LP
799 812 The list consists of the interface name, \fBmtu\fR (maximum transmission unit,
800 813 or maximum packet size)(see \fBifconfig\fR(1M)), the network to which the
801 814 interface is attached, addresses for each interface, and counter associated
802 815 with the interface. The counters show the number of input packets, input
803 816 errors, output packets, output errors, and collisions, respectively. For
804 817 Point-to-Point interfaces, the Net/Dest field is the name or address on the
805 818 other side of the link.
806 819 .LP
807 820 If the \fB-a\fR option is specified with either the \fB-i\fR option or the
808 821 \fB-I\fR option, then the output includes names of the physical interface(s),
809 822 counts for input packets and output packets for each logical interface, plus
810 823 additional information.
811 824 .LP
812 825 If the \fB-n\fR option is specified, the list displays the IP address instead
813 826 of the interface name.
814 827 .LP
815 828 If an optional \fIinterval\fR is specified, the output will be continually
816 829 displayed in \fIinterval\fR seconds until interrupted by the user or until
817 830 \fIcount\fR is reached. See OPERANDS.
818 831 .LP
819 832 The physical interface is specified using the \fB-I\fR option. When used with
820 833 the \fIinterval\fR operand, output for the \fB-I\fR option has the following
821 834 format:
822 835 .sp
823 836 .in +2
824 837 .nf
825 838 input eri0 output input (Total) output
826 839 packets errs packets errs colls packets errs packets errs colls
827 840 227681 0 659471 1 502 261331 0 99597 1 502
828 841 10 0 0 0 0 10 0 0 0 0
829 842 8 0 0 0 0 8 0 0 0 0
830 843 10 0 2 0 0 10 0 2 0 0
831 844 .fi
832 845 .in -2
833 846 .sp
834 847 .LP
835 848 If the input interface is not specified, the first interface of address family
836 849 \fBinet\fR or \fBinet6\fR will be displayed.
837 850 .SS "Routing Table (Seventh Form)"
838 851 .LP
839 852 The routing table display lists the available routes and the status of each.
840 853 Each route consists of a destination host or network, and a gateway to use in
841 854 forwarding packets. The \fIflags\fR column shows the status of the route. These
842 855 flags are as follows:
843 856 .sp
844 857 .ne 2
845 858 .na
846 859 \fB\fBU\fR\fR
847 860 .ad
848 861 .RS 5n
849 862 Indicates route is \fBup\fR.
850 863 .RE
851 864
852 865 .sp
853 866 .ne 2
854 867 .na
855 868 \fB\fBG\fR\fR
856 869 .ad
857 870 .RS 5n
858 871 Route is to a gateway.
859 872 .RE
860 873
861 874 .sp
862 875 .ne 2
863 876 .na
864 877 \fB\fBH\fR\fR
865 878 .ad
866 879 .RS 5n
867 880 Route is to a host and not a network.
868 881 .RE
869 882
870 883 .sp
871 884 .ne 2
872 885 .na
873 886 \fB\fBM\fR\fR
874 887 .ad
875 888 .RS 5n
876 889 Redundant route established with the \fB-multirt\fR option.
877 890 .RE
878 891
879 892 .sp
880 893 .ne 2
881 894 .na
882 895 \fB\fBS\fR\fR
883 896 .ad
884 897 .RS 5n
885 898 Route was established using the \fB-setsrc\fR option.
886 899 .RE
887 900
888 901 .sp
889 902 .ne 2
890 903 .na
891 904 \fB\fBD\fR\fR
892 905 .ad
893 906 .RS 5n
894 907 Route was created dynamically by a redirect.
895 908 .RE
896 909
897 910 .sp
898 911 .LP
899 912 If the \fB-a\fR option is specified, there will be routing entries with the
900 913 following flags:
901 914 .sp
902 915 .ne 2
903 916 .na
904 917 \fB\fBA\fR\fR
905 918 .ad
906 919 .RS 5n
907 920 Combined routing and address resolution entries.
908 921 .RE
909 922
910 923 .sp
911 924 .ne 2
912 925 .na
913 926 \fB\fBB\fR\fR
914 927 .ad
915 928 .RS 5n
916 929 Broadcast addresses.
917 930 .RE
918 931
919 932 .sp
920 933 .ne 2
921 934 .na
922 935 \fB\fBL\fR\fR
923 936 .ad
924 937 .RS 5n
925 938 Local addresses for the host.
926 939 .RE
927 940
928 941 .LP
929 942 Interface routes are created for each interface attached to the local host; the
930 943 gateway field for such entries shows the address of the outgoing interface.
931 944 .LP
932 945 The \fBuse\fR column displays the number of packets sent using a combined
933 946 routing and address resolution (\fBA\fR) or a broadcast (\fBB\fR) route. For a
934 947 local (\fBL\fR) route, this count is the number of packets received, and for
935 948 all other routes it is the number of times the routing entry has been used to
936 949 create a new combined route and address resolution entry.
937 950 .LP
938 951 The \fIinterface\fR entry indicates the network interface utilized for the
939 952 route.
940 953 .SS "Multicast Routing Tables (Eighth Form)"
941 954 .LP
942 955 The multicast routing table consists of the virtual interface table and the
943 956 actual routing table.
944 957 .SS "DHCP Interface Information (Ninth Form)"
945 958 .LP
946 959 The \fBDHCP\fR interface information consists of the interface name, its
947 960 current state, lease information, packet counts, and a list of flags.
948 961 .LP
949 962 The states correlate with the specifications set forth in \fIRFC 2131\fR.
950 963 .LP
951 964 Lease information includes:
952 965 .RS +4
953 966 .TP
954 967 .ie t \(bu
955 968 .el o
956 969 when the lease began;
957 970 .RE
958 971 .RS +4
959 972 .TP
960 973 .ie t \(bu
961 974 .el o
962 975 when lease renewal will begin; and
963 976 .RE
964 977 .RS +4
965 978 .TP
966 979 .ie t \(bu
967 980 .el o
968 981 when the lease will expire.
969 982 .RE
970 983 .sp
971 984 .LP
972 985 The flags currently defined include:
973 986 .sp
974 987 .ne 2
975 988 .na
976 989 \fB\fBBOOTP\fR\fR
977 990 .ad
978 991 .RS 11n
979 992 The interface has a lease obtained through \fBBOOTP\fR (IPv4 only).
980 993 .RE
981 994
982 995 .sp
983 996 .ne 2
984 997 .na
985 998 \fB\fBBUSY\fR\fR
986 999 .ad
987 1000 .RS 11n
988 1001 The interface is busy with a \fBDHCP\fR transaction.
989 1002 .RE
990 1003
991 1004 .sp
992 1005 .ne 2
993 1006 .na
994 1007 \fB\fBPRIMARY\fR\fR
995 1008 .ad
996 1009 .RS 11n
997 1010 The interface is the primary interface. See \fBdhcpinfo\fR(1) and
998 1011 \fBifconfig\fR(1M).
999 1012 .RE
1000 1013
1001 1014 .sp
1002 1015 .ne 2
1003 1016 .na
1004 1017 \fB\fBFAILED\fR\fR
1005 1018 .ad
1006 1019 .RS 11n
1007 1020 The interface is in failure state and must be manually restarted.
1008 1021 .RE
1009 1022
1010 1023 .LP
1011 1024 Packet counts are maintained for the number of packets sent, the number of
1012 1025 packets received, and the number of lease offers declined by the \fBDHCP\fR
1013 1026 client. All three counters are initialized to zero and then incremented while
1014 1027 obtaining a lease. The counters are reset when the period of lease renewal
1015 1028 begins for the interface. Thus, the counters represent either the number of
1016 1029 packets sent, received, and declined while obtaining the current lease, or the
1017 1030 number of packets sent, received, and declined while attempting to obtain a
1018 1031 future lease.
1019 1032 .SH FILES
1020 1033 .ne 2
1021 1034 .na
1022 1035 \fB\fB/etc/default/inet_type\fR\fR
1023 1036 .ad
1024 1037 .RS 26n
1025 1038 \fBDEFAULT_IP\fR setting
1026 1039 .RE
1027 1040
1028 1041 .SH SEE ALSO
1029 1042 .LP
1030 1043 \fBarp\fR(1M), \fBdhcpinfo\fR(1), \fBdhcpagent\fR(1M), \fBifconfig\fR(1M),
1031 1044 \fBiostat\fR(1M), \fBkstat\fR(1M), \fBmibiisa\fR(1M), \fBndp\fR(1M), \fBsavecore\fR(1M),
1032 1045 \fBvmstat\fR(1M), \fBhosts\fR(4), \fBinet_type\fR(4), \fBnetworks\fR(4),
1033 1046 \fBprotocols\fR(4), \fBservices\fR(4), \fBattributes\fR(5), \fBdhcp\fR(5),
1034 1047 \fBkstat\fR(7D), \fBinet\fR(7P), \fBinet6\fR(7P)
1035 1048 .sp
1036 1049 .LP
1037 1050 Droms, R., \fIRFC 2131, Dynamic Host Configuration Protocol\fR, Network Working
1038 1051 Group, March 1997.
1039 1052 .sp
1040 1053 .LP
1041 1054 Droms, R. \fIRFC 3315, Dynamic Host Configuration Protocol for IPv6
1042 1055 (DHCPv6)\fR. Cisco Systems. July 2003.
1043 1056 .SH NOTES
1044 1057 .LP
1045 1058 When displaying interface information, \fBnetstat\fR honors the
1046 1059 \fBDEFAULT_IP\fR setting in \fB/etc/default/inet_type\fR. If it is set to
1047 1060 \fBIP_VERSION4\fR, then \fBnetstat\fR will omit information relating to IPv6
1048 1061 interfaces, statistics, connections, routes and the like.
1049 1062 .LP
1050 1063 However, you can override the \fBDEFAULT_IP\fR setting in
1051 1064 \fB/etc/default/inet_type\fR on the command-line. For example, if you have used
1052 1065 the command-line to explicitly request IPv6 information by using the
1053 1066 \fBinet6\fR address family or one of the IPv6 protocols, it will override the
1054 1067 \fBDEFAULT_IP\fR setting.
1055 1068 .LP
1056 1069 If you need to examine network status information following a kernel crash, use
1057 1070 the \fBmdb\fR(1) utility on the \fBsavecore\fR(1M) output.
1058 1071 .LP
1059 1072 The \fBnetstat\fR utility obtains TCP statistics from the system by opening
1060 1073 \fB/dev/tcp\fR and issuing queries. Because of this, \fBnetstat\fR might
1061 1074 display an extra, unused connection in \fBIDLE\fR state when reporting
1062 1075 connection status.
1063 1076 .LP
1064 1077 Previous versions of \fBnetstat\fR had undocumented methods for reporting
1065 1078 kernel statistics published using the \fBkstat\fR(7D) facility. This
1066 1079 functionality has been removed. Use \fBkstat\fR(1M) instead.
1067 1080 .LP
1068 1081 \fBnetstat\fR restricts its output to information that is relevant to the zone
1069 1082 in which \fBnetstat\fR runs. (This is true for both shared-IP and exclusive-IP
1070 1083 zones.)
↓ open down ↓ |
724 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX