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