1.\" Copyright (c) 1983, 1990, 1992, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 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. Neither the name of the University nor the names of its contributors 13.\" may be used to endorse or promote products derived from this software 14.\" without specific prior written permission. 15.\" 16.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26.\" SUCH DAMAGE. 27.\" 28.\" @(#)netstat.1 8.8 (Berkeley) 4/18/94 29.\" $FreeBSD$ 30.\" 31.Dd May 27, 2022 32.Dt NETSTAT 1 33.Os 34.Sh NAME 35.Nm netstat 36.Nd show network status and statistics 37.Sh SYNOPSIS 38.Bk -words 39.Bl -tag -width "netstat" 40.It Nm 41.Op Fl -libxo 42.Op Fl 46AaCLnPRSTWx 43.Op Fl f Ar protocol_family | Fl p Ar protocol 44.Op Fl M Ar core 45.Op Fl N Ar system 46.It Nm Fl i | I Ar interface 47.Op Fl -libxo 48.Op Fl 46abdhnW 49.Op Fl f Ar address_family 50.Op Fl M Ar core 51.Op Fl N Ar system 52.It Nm Fl w Ar wait 53.Op Fl -libxo 54.Op Fl I Ar interface 55.Op Fl 46d 56.Op Fl M Ar core 57.Op Fl N Ar system 58.Op Fl q Ar howmany 59.It Nm Fl s 60.Op Fl -libxo 61.Op Fl 46sz 62.Op Fl f Ar protocol_family | Fl p Ar protocol 63.Op Fl M Ar core 64.Op Fl N Ar system 65.It Nm Fl i | I Ar interface Fl s 66.Op Fl -libxo 67.Op Fl 46s 68.Op Fl f Ar protocol_family | Fl p Ar protocol 69.Op Fl M Ar core 70.Op Fl N Ar system 71.It Nm Fl m 72.Op Fl -libxo 73.Op Fl M Ar core 74.Op Fl N Ar system 75.It Nm Fl B 76.Op Fl -libxo 77.Op Fl z 78.Op Fl I Ar interface 79.It Nm Fl r 80.Op Fl -libxo 81.Op Fl 46nW 82.Op Fl F Ar fibnum 83.Op Fl f Ar address_family 84.It Nm Fl rs 85.Op Fl -libxo 86.Op Fl s 87.Op Fl M Ar core 88.Op Fl N Ar system 89.It Nm Fl g 90.Op Fl -libxo 91.Op Fl 46W 92.Op Fl f Ar address_family 93.It Nm Fl gs 94.Op Fl -libxo 95.Op Fl 46s 96.Op Fl f Ar address_family 97.Op Fl M Ar core 98.Op Fl N Ar system 99.It Nm Fl Q 100.Op Fl -libxo 101.El 102.Ek 103.Sh DESCRIPTION 104The 105.Nm 106command symbolically displays the contents of various network-related 107data structures. 108There are a number of output formats, 109depending on the options for the information presented. 110.Bl -tag -width indent 111.It Xo 112.Bk -words 113.Nm 114.Op Fl 46AaCLnRSTWx 115.Op Fl f Ar protocol_family | Fl p Ar protocol 116.Op Fl M Ar core 117.Op Fl N Ar system 118.Ek 119.Xc 120Display a list of active sockets 121(protocol control blocks) 122for each network protocol. 123.Pp 124The default display for active sockets shows the local 125and remote addresses, send and receive queue sizes (in bytes), protocol, 126and the internal state of the protocol. 127Address formats are of the form 128.Dq host.port 129or 130.Dq network.port 131if a socket's address specifies a network but no specific host address. 132When known, the host and network addresses are displayed symbolically 133according to the databases 134.Xr hosts 5 135and 136.Xr networks 5 , 137respectively. 138If a symbolic name for an address is unknown, or if 139the 140.Fl n 141option is specified, the address is printed numerically, according 142to the address family. 143For more information regarding 144the Internet IPv4 145.Dq dot format , 146refer to 147.Xr inet 3 . 148Unspecified, 149or 150.Dq wildcard , 151addresses and ports appear as 152.Dq Li * . 153.Bl -tag -width indent 154.It Fl -libxo 155Generate output via 156.Xr libxo 3 157in a selection of different human and machine readable formats. 158See 159.Xr xo_parse_args 3 160for details on command line arguments. 161.It Fl 4 162Show IPv4 only. 163See 164.Sx GENERAL OPTIONS . 165.It Fl 6 166Show IPv6 only. 167See 168.Sx GENERAL OPTIONS . 169.It Fl A 170Show the address of a protocol control block (PCB) 171associated with a socket; used for debugging. 172.It Fl a 173Show the state of all sockets; 174normally sockets used by server processes are not shown. 175.It Fl c 176Show the used TCP stack for each session. 177.It Fl C 178Show the congestion control algorithm and diagnostic information of TCP sockets. 179.It Fl L 180Show the size of the various listen queues. 181The first count shows the number of unaccepted connections, 182the second count shows the amount of unaccepted incomplete connections, 183and the third count is the maximum number of queued connections. 184.It Fl n 185Do not resolve numeric addresses and port numbers to names. 186See 187.Sx GENERAL OPTIONS . 188.It Fl P 189Display the log ID for each socket. 190.It Fl R 191Display the flowid and flowtype for each socket. 192flowid is a 32 bit hardware specific identifier for each flow. 193flowtype defines which protocol fields are hashed to produce the id. 194A complete listing is available in 195.Pa sys/mbuf.h 196under 197.Dv M_HASHTYPE_* . 198.It Fl S 199Show network addresses as numbers (as with 200.Fl n ) 201but show ports symbolically. 202.It Fl T 203Display diagnostic information from the TCP control block. 204Fields include the number of packets requiring retransmission, 205received out-of-order, and those advertising a zero-sized window. 206.It Fl W 207Avoid truncating addresses even if this causes some fields to overflow. 208.It Fl x 209Display socket buffer and TCP timer statistics for each 210internet socket. 211.Pp 212The 213.Fl x 214flag causes 215.Nm 216to output all the information recorded about data 217stored in the socket buffers. 218The fields are: 219.Bl -column ".Li R-HIWA" 220.It Li R-HIWA Ta Receive buffer high water mark, in bytes. 221.It Li S-HIWA Ta Send buffer high water mark, in bytes. 222.It Li R-LOWA Ta Receive buffer low water mark, in bytes. 223.It Li S-LOWA Ta Send buffer low water mark, in bytes. 224.It Li R-BCNT Ta Receive buffer byte count. 225.It Li S-BCNT Ta Send buffer byte count. 226.It Li R-BMAX Ta Maximum bytes that can be used in the receive buffer. 227.It Li S-BMAX Ta Maximum bytes that can be used in the send buffer. 228.It Li rexmt Ta Time, in seconds, to fire Retransmit Timer, or 0 if not armed. 229.It Li persist Ta Time, in seconds, to fire Retransmit Persistence, or 0 if not armed. 230.It Li keep Ta Time, in seconds, to fire Keep Alive, or 0 if not armed. 231.It Li 2msl Ta Time, in seconds, to fire 2*msl TIME_WAIT Timer, or 0 if not armed. 232.It Li delack Ta Time, in seconds, to fire Delayed ACK Timer, or 0 if not armed. 233.It Li rcvtime Ta Time, in seconds, since last packet received. 234.El 235.It Fl f Ar protocol_family 236Filter by 237.Ar protocol_family . 238See 239.Sx GENERAL OPTIONS . 240.It Fl p Ar protocol 241Filter by 242.Ar protocol . 243See 244.Sx GENERAL OPTIONS . 245.It Fl M 246Use an alternative core. 247See 248.Sx GENERAL OPTIONS . 249.It Fl N 250Use an alternative kernel image. 251See 252.Sx GENERAL OPTIONS . 253.El 254.It Xo 255.Bk -words 256.Nm 257.Fl i | I Ar interface 258.Op Fl 46abdhnW 259.Op Fl f Ar address_family 260.Op Fl M Ar core 261.Op Fl N Ar system 262.Ek 263.Xc 264Show the state of all network interfaces or a single 265.Ar interface 266which have been auto-configured 267(interfaces statically configured into a system, but not 268located at boot time are not shown). 269An asterisk 270.Pq Dq Li * 271after an interface name indicates that the interface is 272.Dq down . 273.Pp 274When 275.Nm 276is invoked with 277.Fl i 278.Pq all interfaces 279or 280.Fl I Ar interface , 281it provides a table of cumulative 282statistics regarding packets transferred, errors, and collisions. 283The network addresses of the interface 284and the maximum transmission unit 285.Pq Dq mtu 286are also displayed. 287.Bl -tag -width indent 288.It Fl 4 289Show IPv4 only. 290See 291.Sx GENERAL OPTIONS . 292.It Fl 6 293Show IPv6 only. 294See 295.Sx GENERAL OPTIONS . 296.It Fl a 297Multicast addresses currently in use are shown 298for each Ethernet interface and for each IP interface address. 299Multicast addresses are shown on separate lines following the interface 300address with which they are associated. 301.It Fl b 302Show the number of bytes in and out. 303.It Fl d 304Show the number of dropped packets. 305.It Fl h 306Print all counters in human readable form. 307.It Fl n 308Do not resolve numeric addresses and port numbers to names. 309See 310.Sx GENERAL OPTIONS . 311.It Fl W 312Avoid truncating interface names even if this causes some fields to overflow. 313.Sx GENERAL OPTIONS . 314.It Fl f Ar protocol_family 315Filter by 316.Ar protocol_family . 317See 318.Sx GENERAL OPTIONS . 319.El 320.It Xo 321.Bk -words 322.Nm 323.Fl w Ar wait 324.Op Fl I Ar interface 325.Op Fl 46d 326.Op Fl M Ar core 327.Op Fl N Ar system 328.Op Fl q Ar howmany 329.Ek 330.Xc 331At intervals of 332.Ar wait 333seconds, display the information regarding packet traffic on all 334configured network interfaces or a single 335.Ar interface . 336.Pp 337When 338.Nm 339is invoked with the 340.Fl w 341option and a 342.Ar wait 343interval argument, it displays a running count of statistics related to 344network interfaces. 345An obsolescent version of this option used a numeric parameter 346with no option, and is currently supported for backward compatibility. 347By default, this display summarizes information for all interfaces. 348Information for a specific interface may be displayed with the 349.Fl I Ar interface 350option. 351.Bl -tag -width indent 352.It Fl I Ar interface 353Only show information regarding 354.Ar interface 355.It Fl 4 356Show IPv4 only. 357See 358.Sx GENERAL OPTIONS . 359.It Fl 6 360Show IPv6 only. 361See 362.Sx GENERAL OPTIONS . 363.It Fl d 364Show the number of dropped packets. 365.It Fl M 366Use an alternative core. 367See 368.Sx GENERAL OPTIONS . 369.It Fl N 370Use an alternative kernel image. 371See 372.Sx GENERAL OPTIONS . 373.It Fl q 374Exit after 375.Ar howmany 376outputs. 377.El 378.It Xo 379.Bk -words 380.Nm 381.Fl s 382.Op Fl 46sz 383.Op Fl f Ar protocol_family | Fl p Ar protocol 384.Op Fl M Ar core 385.Op Fl N Ar system 386.Ek 387.Xc 388Display system-wide statistics for each network protocol. 389.Bl -tag -width indent 390.It Fl 4 391Show IPv4 only. 392See 393.Sx GENERAL OPTIONS . 394.It Fl 6 395Show IPv6 only. 396See 397.Sx GENERAL OPTIONS . 398.It Fl s 399If 400.Fl s 401is repeated, counters with a value of zero are suppressed. 402.It Fl z 403Reset statistic counters after displaying them. 404.It Fl f Ar protocol_family 405Filter by 406.Ar protocol_family . 407See 408.Sx GENERAL OPTIONS . 409.It Fl p Ar protocol 410Filter by 411.Ar protocol . 412See 413.Sx GENERAL OPTIONS . 414.It Fl M 415Use an alternative core. 416See 417.Sx GENERAL OPTIONS . 418.It Fl N 419Use an alternative kernel image 420See 421.Sx GENERAL OPTIONS . 422.El 423.It Xo 424.Bk -words 425.Nm 426.Fl i | I Ar interface Fl s 427.Op Fl 46s 428.Op Fl f Ar protocol_family | Fl p Ar protocol 429.Op Fl M Ar core 430.Op Fl N Ar system 431.Ek 432.Xc 433Display per-interface statistics for each network protocol. 434.Bl -tag -width indent 435.It Fl 4 436Show IPv4 only 437See 438.Sx GENERAL OPTIONS . 439.It Fl 6 440Show IPv6 only 441See 442.Sx GENERAL OPTIONS . 443.It Fl s 444If 445.Fl s 446is repeated, counters with a value of zero are suppressed. 447.It Fl f Ar protocol_family 448Filter by 449.Ar protocol_family . 450See 451.Sx GENERAL OPTIONS . 452.It Fl p Ar protocol 453Filter by 454.Ar protocol . 455See 456.Sx GENERAL OPTIONS . 457.It Fl M 458Use an alternative core 459See 460.Sx GENERAL OPTIONS . 461.It Fl N 462Use an alternative kernel image 463See 464.Sx GENERAL OPTIONS . 465.El 466.It Xo 467.Bk -words 468.Nm 469.Fl m 470.Op Fl M Ar core 471.Op Fl N Ar system 472.Ek 473.Xc 474Show statistics recorded by the memory management routines 475.Pq Xr mbuf 9 . 476The network manages a private pool of memory buffers. 477.Bl -tag -width indent 478.It Fl M 479Use an alternative core 480See 481.Sx GENERAL OPTIONS . 482.It Fl N 483Use an alternative kernel image 484See 485.Sx GENERAL OPTIONS . 486.El 487.It Xo 488.Bk -words 489.Nm 490.Fl B 491.Op Fl z 492.Op Fl I Ar interface 493.Ek 494.Xc 495Show statistics about 496.Xr bpf 4 497peers. 498This includes information like 499how many packets have been matched, dropped and received by the 500bpf device, also information about current buffer sizes and device 501states. 502.Pp 503The 504.Xr bpf 4 505flags displayed when 506.Nm 507is invoked with the 508.Fl B 509option represent the underlying parameters of the bpf peer. 510Each flag is 511represented as a single lower case letter. 512The mapping between the letters and flags in order of appearance are: 513.Bl -column ".Li i" 514.It Li p Ta Set if listening promiscuously 515.It Li i Ta Dv BIOCIMMEDIATE No has been set on the device 516.It Li f Ta Dv BIOCGHDRCMPLT No status: source link addresses are being 517filled automatically 518.It Li s Ta Dv BIOCGSEESENT No status: see packets originating locally and 519remotely on the interface. 520.It Li a Ta Packet reception generates a signal 521.It Li l Ta Dv BIOCLOCK No status: descriptor has been locked 522.El 523.Pp 524For more information about these flags, please refer to 525.Xr bpf 4 . 526.Bl -tag -width indent 527.It Fl z 528Reset statistic counters after displaying them. 529.El 530.It Xo 531.Bk -words 532.Nm 533.Fl r 534.Op Fl 46AnW 535.Op Fl F Ar fibnum 536.Op Fl f Ar address_family 537.Op Fl M Ar core 538.Op Fl N Ar system 539.Ek 540.Xc 541Display the contents of routing tables. 542.Pp 543When 544.Nm 545is invoked with the routing table option 546.Fl r , 547it lists the available routes and their status. 548Each route consists of a destination host or network, and a gateway to use 549in forwarding packets. 550The flags field shows a collection of information about the route stored 551as binary choices. 552The individual flags are discussed in more detail in the 553.Xr route 8 554and 555.Xr route 4 556manual pages. 557The mapping between letters and flags is: 558.Bl -column ".Li W" ".Dv RTF_WASCLONED" 559.It Li 1 Ta Dv RTF_PROTO1 Ta "Protocol specific routing flag #1" 560.It Li 2 Ta Dv RTF_PROTO2 Ta "Protocol specific routing flag #2" 561.It Li 3 Ta Dv RTF_PROTO3 Ta "Protocol specific routing flag #3" 562.It Li B Ta Dv RTF_BLACKHOLE Ta "Just discard pkts (during updates)" 563.It Li b Ta Dv RTF_BROADCAST Ta "The route represents a broadcast address" 564.It Li D Ta Dv RTF_DYNAMIC Ta "Created dynamically (by redirect)" 565.It Li G Ta Dv RTF_GATEWAY Ta "Destination requires forwarding by intermediary" 566.It Li H Ta Dv RTF_HOST Ta "Host entry (net otherwise)" 567.It Li L Ta Dv RTF_LLINFO Ta "Valid protocol to link address translation" 568.It Li M Ta Dv RTF_MODIFIED Ta "Modified dynamically (by redirect)" 569.It Li R Ta Dv RTF_REJECT Ta "Host or net unreachable" 570.It Li S Ta Dv RTF_STATIC Ta "Manually added" 571.It Li U Ta Dv RTF_UP Ta "Route usable" 572.It Li X Ta Dv RTF_XRESOLVE Ta "External daemon translates proto to link address" 573.El 574.Pp 575Direct routes are created for each 576interface attached to the local host; 577the gateway field for such entries shows the address of the outgoing interface. 578The refcnt field gives the 579current number of active uses of the route. 580Connection oriented 581protocols normally hold on to a single route for the duration of 582a connection while connectionless protocols obtain a route while sending 583to the same destination. 584The use field provides a count of the number of packets 585sent using that route. 586The interface entry indicates the network interface utilized for the route. 587.Bl -tag -width indent 588.It Fl 4 589Show IPv4 only. 590See 591.Sx GENERAL OPTIONS . 592.It Fl 6 593Show IPv6 only. 594See 595.Sx GENERAL OPTIONS . 596.It Fl n 597Do not resolve numeric addresses and port numbers to names. 598See 599.Sx GENERAL OPTIONS . 600.It Fl W 601Show the path MTU for each route, and print interface names with a 602wider field size. 603.It Fl F 604Display the routing table with the number 605.Ar fibnum . 606If the specified 607.Ar fibnum 608is -1 or 609.Fl F 610is not specified, 611the default routing table is displayed. 612.It Fl f 613Display the routing table for a particular 614.Ar address_family . 615.It Fl M 616Use an alternative core 617See 618.Sx GENERAL OPTIONS . 619.It Fl N 620Use an alternative kernel image 621See 622.Sx GENERAL OPTIONS . 623.El 624.It Xo 625.Bk -words 626.Nm 627.Fl rs 628.Op Fl s 629.Op Fl M Ar core 630.Op Fl N Ar system 631.Ek 632.Xc 633Display routing statistics. 634.Bl -tag -width indent 635.It Fl s 636If 637.Fl s 638is repeated, counters with a value of zero are suppressed. 639.It Fl M 640Use an alternative core 641See 642.Sx GENERAL OPTIONS . 643.It Fl N 644Use an alternative kernel image 645See 646.Sx GENERAL OPTIONS . 647.El 648.It Xo 649.Bk -words 650.Nm 651.Fl g 652.Op Fl 46W 653.Op Fl f Ar address_family 654.Op Fl M Ar core 655.Op Fl N Ar system 656.Ek 657.Xc 658Display the contents of the multicast virtual interface tables, 659and multicast forwarding caches. 660Entries in these tables will appear only when the kernel is 661actively forwarding multicast sessions. 662This option is applicable only to the 663.Cm inet 664and 665.Cm inet6 666address families. 667.Bl -tag -width indent 668.It Fl 4 669Show IPv4 only 670See 671.Sx GENERAL OPTIONS . 672.It Fl 6 673Show IPv6 only 674See 675.Sx GENERAL OPTIONS . 676.It Fl W 677Avoid truncating addresses even if this causes some fields to overflow. 678.It Fl f Ar protocol_family 679Filter by 680.Ar protocol_family . 681See 682.Sx GENERAL OPTIONS . 683.It Fl M 684Use an alternative core 685See 686.Sx GENERAL OPTIONS . 687.It Fl N 688Use an alternative kernel image 689See 690.Sx GENERAL OPTIONS . 691.El 692.It Xo 693.Bk -words 694.Nm 695.Fl gs 696.Op Fl 46s 697.Op Fl f Ar address_family 698.Op Fl M Ar core 699.Op Fl N Ar system 700.Ek 701.Xc 702Show multicast routing statistics. 703.Bl -tag -width indent 704.It Fl 4 705Show IPv4 only 706See 707.Sx GENERAL OPTIONS . 708.It Fl 6 709Show IPv6 only 710See 711.Sx GENERAL OPTIONS . 712.It Fl s 713If 714.Fl s 715is repeated, counters with a value of zero are suppressed. 716.It Fl f Ar protocol_family 717Filter by 718.Ar protocol_family . 719See 720.Sx GENERAL OPTIONS . 721.It Fl M 722Use an alternative core 723See 724.Sx GENERAL OPTIONS . 725.It Fl N 726Use an alternative kernel image 727See 728.Sx GENERAL OPTIONS . 729.El 730.It Xo 731.Bk -words 732.Nm 733.Fl Q 734.Ek 735.Xc 736Show 737.Xr netisr 9 738statistics. 739The flags field shows available ISR handlers: 740.Bl -column ".Li W" ".Dv NETISR_SNP_FLAGS_DRAINEDCPU" 741.It Li C Ta Dv NETISR_SNP_FLAGS_M2CPUID Ta "Able to map mbuf to cpu id" 742.It Li D Ta Dv NETISR_SNP_FLAGS_DRAINEDCPU Ta "Has queue drain handler" 743.It Li F Ta Dv NETISR_SNP_FLAGS_M2FLOW Ta "Able to map mbuf to flow id" 744.El 745.El 746.Ss GENERAL OPTIONS 747Some options have the general meaning: 748.Bl -tag -width flag 749.It Fl 4 750Is shorthand for 751.Fl f 752.Ar inet 753.Pq Show only IPv4 754.It Fl 6 755Is shorthand for 756.Fl f 757.Ar inet6 758.Pq Show only IPv6 759.It Fl f Ar address_family , Fl p Ar protocol 760Limit display to those records 761of the specified 762.Ar address_family 763or a single 764.Ar protocol . 765The following address families and protocols are recognized: 766.Pp 767.Bl -tag -width ".Cm netgraph , ng Pq Dv AF_NETGRAPH" -compact 768.It Em Family 769.Em Protocols 770.It Cm inet Pq Dv AF_INET 771.Cm divert , icmp , igmp , ip , ipsec , pim, sctp , tcp , udp 772.It Cm inet6 Pq Dv AF_INET6 773.Cm icmp6 , ip6 , ipsec6 , rip6 , sctp , tcp , udp 774.It Cm pfkey Pq Dv PF_KEY 775.Cm pfkey 776.It Cm netgraph , ng Pq Dv AF_NETGRAPH 777.Cm ctrl , data 778.It Cm unix Pq Dv AF_UNIX 779.It Cm link Pq Dv AF_LINK 780.El 781.Pp 782The program will complain if 783.Ar protocol 784is unknown or if there is no statistics routine for it. 785.It Fl M 786Extract values associated with the name list from the specified core 787instead of the default 788.Pa /dev/kmem . 789.It Fl N 790Extract the name list from the specified system instead of the default, 791which is the kernel image the system has booted from. 792.It Fl n 793Show network addresses and ports as numbers. 794Normally 795.Nm 796attempts to resolve addresses and ports, 797and display them symbolically. 798.El 799.Sh EXAMPLES 800Show packet traffic information (packets, bytes, errors, packet drops, etc) for 801interface re0 updated every 2 seconds and exit after 5 outputs: 802.Bd -literal -offset indent 803$ netstat -w 2 -q 5 -I re0 804.Ed 805.Pp 806Show statistics for ICMP on any interface: 807.Bd -literal -offset indent 808$ netstat -s -p icmp 809.Ed 810.Pp 811Show routing tables: 812.Bd -literal -offset indent 813$ netstat -r 814.Ed 815.Pp 816Same as above, but without resolving numeric addresses and port numbers to 817names: 818.Bd -literal -offset indent 819$ netstat -rn 820.Ed 821.Sh SEE ALSO 822.Xr fstat 1 , 823.Xr nfsstat 1 , 824.Xr procstat 1 , 825.Xr ps 1 , 826.Xr sockstat 1 , 827.Xr libxo 3 , 828.Xr xo_parse_args 3 , 829.Xr bpf 4 , 830.Xr inet 4 , 831.Xr route 4 , 832.Xr unix 4 , 833.Xr hosts 5 , 834.Xr networks 5 , 835.Xr protocols 5 , 836.Xr services 5 , 837.Xr iostat 8 , 838.Xr route 8 , 839.Xr trpt 8 , 840.Xr vmstat 8 , 841.Xr mbuf 9 842.Sh HISTORY 843The 844.Nm 845command appeared in 846.Bx 4.2 . 847.Pp 848IPv6 support was added by WIDE/KAME project. 849.Sh BUGS 850The notion of errors is ill-defined. 851