|
|
1.1 ! root 1: .\" Copyright (c) 1983, 1990 The Regents of the University of California. ! 2: .\" All rights reserved. ! 3: .\" ! 4: .\" Redistribution and use in source and binary forms are permitted provided ! 5: .\" that: (1) source distributions retain this entire copyright notice and ! 6: .\" comment, and (2) distributions including binaries display the following ! 7: .\" acknowledgement: ``This product includes software developed by the ! 8: .\" University of California, Berkeley and its contributors'' in the ! 9: .\" documentation or other materials provided with the distribution and in ! 10: .\" all advertising materials mentioning features or use of this software. ! 11: .\" Neither the name of the University nor the names of its contributors may ! 12: .\" be used to endorse or promote products derived from this software without ! 13: .\" specific prior written permission. ! 14: .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED ! 15: .\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF ! 16: .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 17: .\" ! 18: .\" @(#)netstat.1 6.11 (Berkeley) 7/24/90 ! 19: .\" ! 20: .Dd July 24, 1990 ! 21: .Dt NETSTAT 1 ! 22: .Os BSD 4.2 ! 23: .Sh NAME ! 24: .Nm netstat ! 25: .Nd show network status ! 26: .Sh SYNOPSIS ! 27: .Nm netstat ! 28: .Op Fl Aan ! 29: .Op Fl f Ar address_family ! 30: .Op Ar system ! 31: .Op Ar core ! 32: .Nm netstat ! 33: .Op Fl himnrs ! 34: .Op Fl f Ar address_family ! 35: .Op Ar system ! 36: .Op Ar core ! 37: .Nm netstat ! 38: .Op Fl n ! 39: .Op Fl I Op Ar interface ! 40: .Ar interval ! 41: .Op Ar system ! 42: .Op Ar core ! 43: .Nm netstat ! 44: .Op Fl p Ar protocol ! 45: .Op Ar system ! 46: .Op Ar core ! 47: .Sh DESCRIPTION ! 48: The ! 49: .Nm netstat ! 50: command symbolically displays the contents of various network-related ! 51: data structures. ! 52: There are a number of output formats, ! 53: depending on the options for the information presented. ! 54: The first form of the command displays a list of active sockets for ! 55: each protocol. ! 56: The second form presents the contents of one of the other network ! 57: data structures according to the option selected. ! 58: Using the third form, with an ! 59: .Ar interval ! 60: specified, ! 61: .Nm netstat ! 62: will continuously display the information regarding packet ! 63: traffic on the configured network interfaces. ! 64: The fourth form displays statistics about the named protocol. ! 65: .Pp ! 66: The options have the following meaning: ! 67: .Tw Fl ! 68: .Tp Fl A ! 69: With the default display, ! 70: show the address of any protocol control blocks associated with sockets; used ! 71: for debugging. ! 72: .Tp Fl a ! 73: With the default display, ! 74: show the state of all sockets; normally sockets used by ! 75: server processes are not shown. ! 76: .Tp Fl d ! 77: With either interface display (option ! 78: .Fl i ! 79: or an interval, as described below), ! 80: show the number of dropped packets. ! 81: .Tp Fl h ! 82: Show the state of the IMP host table. ! 83: .Tp Fl i ! 84: Show the state of interfaces which have been auto-configured ! 85: (interfaces statically configured into a system, but not ! 86: located at boot time are not shown). ! 87: .Tp Cx Fl I ! 88: .Ws ! 89: .Ar interface ! 90: .Cx ! 91: Show information only about this interface; ! 92: used with an ! 93: .Ar interval ! 94: as described below. ! 95: .Tp Fl m ! 96: Show statistics recorded by the memory management routines ! 97: (the network manages a private pool of memory buffers). ! 98: .Tp Fl n ! 99: Show network addresses as numbers (normally ! 100: .Nm netstat ! 101: interprets addresses and attempts to display them ! 102: symbolically). ! 103: This option may be used with any of the display formats. ! 104: .Tp Cx Fl p ! 105: .Ws ! 106: .Ar protocol ! 107: .Cx ! 108: Show statistics about ! 109: .Ar protocol , ! 110: which is either a well-known name for a protocol or an alias for it. Some ! 111: protocol names and aliases are listed in the file ! 112: .Pa /etc/protocols . ! 113: A null response typically means that there are no interesting numbers to ! 114: report. ! 115: The program will complain if ! 116: .Ar protocol ! 117: is unknown or if there is no statistics routine for it. ! 118: .Tp Fl s ! 119: Show per-protocol statistics. ! 120: .Tp Fl r ! 121: Show the routing tables. ! 122: When ! 123: .Fl s ! 124: is also present, show routing statistics instead. ! 125: .Tp Cx Fl f ! 126: .Ws ! 127: .Ar address_family ! 128: .Cx ! 129: Limit statistics or address control block reports to those ! 130: of the specified ! 131: .Ar address family . ! 132: The following address families ! 133: are recognized: ! 134: .Ar inet , ! 135: for ! 136: .Li AF_INET , ! 137: .Ar ns , ! 138: for ! 139: .Li AF_NS , ! 140: and ! 141: .Ar unix , ! 142: for ! 143: .Li AF_UNIX . ! 144: .Tp ! 145: .Pp ! 146: The arguments, ! 147: .Ar system ! 148: and ! 149: .Ar core ! 150: allow substitutes for the defaults ! 151: .Dq Pa vmunix ! 152: and ! 153: .Dq Pa /dev/kmem . ! 154: .Pp ! 155: The default display, for active sockets, shows the local ! 156: and remote addresses, send and receive queue sizes (in bytes), protocol, ! 157: and the internal state of the protocol. ! 158: Address formats are of the form ``host.port'' or ``network.port'' ! 159: if a socket's address specifies a network but no specific host address. ! 160: When known the host and network addresses are displayed symbolically ! 161: according to the data bases ! 162: .Pa /etc/hosts ! 163: and ! 164: .Pa /etc/networks , ! 165: respectively. If a symbolic name for an address is unknown, or if ! 166: the ! 167: .Fl n ! 168: option is specified, the address is printed numerically, according ! 169: to the address family. ! 170: For more information regarding ! 171: the Internet ``dot format,'' ! 172: refer to ! 173: .Xr inet 3 ) . ! 174: Unspecified, ! 175: or ``wildcard'', addresses and ports appear as ``*''. ! 176: .Pp ! 177: The interface display provides a table of cumulative ! 178: statistics regarding packets transferred, errors, and collisions. ! 179: The network addresses of the interface ! 180: and the maximum transmission unit (``mtu'') are also displayed. ! 181: .Pp ! 182: The routing table display indicates the available routes and ! 183: their status. Each route consists of a destination host or network ! 184: and a gateway to use in forwarding packets. The flags field shows ! 185: the state of the route (``U'' if ``up''), whether the route ! 186: is to a gateway (``G''), whether the route was created dynamically ! 187: by a redirect (``D''), and whether the route has been modified ! 188: by a redirect (``M''). Direct routes are created for each ! 189: interface attached to the local host; ! 190: the gateway field for such entries shows the address of the outgoing interface. ! 191: The refcnt field gives the ! 192: current number of active uses of the route. Connection oriented ! 193: protocols normally hold on to a single route for the duration of ! 194: a connection while connectionless protocols obtain a route while sending ! 195: to the same destination. ! 196: The use field provides a count of the number of packets ! 197: sent using that route. The interface entry indicates the network ! 198: interface utilized for the route. ! 199: .Pp ! 200: When ! 201: .Nm netstat ! 202: is invoked with an ! 203: .Ar interval ! 204: argument, it displays a running count of statistics related to ! 205: network interfaces. This display consists of a ! 206: column for the primary interface ! 207: (the first interface found during autoconfiguration) ! 208: and a column summarizing ! 209: information for all interfaces. ! 210: The primary interface may be replaced with another interface with the ! 211: .Fl I ! 212: option. ! 213: The first line of each screen of information contains a summary since the ! 214: system was last rebooted. Subsequent lines of output show values ! 215: accumulated over the preceding interval. ! 216: .Sh SEE ALSO ! 217: .Xr iostat 1 , ! 218: .Xr vmstat 1 , ! 219: .Xr hosts 5 , ! 220: .Xr networks 5 , ! 221: .Xr protocols 5 , ! 222: .Xr services 5 , ! 223: .Xr trpt 8 ! 224: .Sh HISTORY ! 225: .Nm Netstat ! 226: appeared in 4.2 BSD. ! 227: .Sh BUGS ! 228: The notion of errors is ill-defined. Collisions mean ! 229: something else for the IMP.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.