1NETSTAT(1)                  General Commands Manual                 NETSTAT(1)
2
3
4

NAME

6       netstat - show network status
7

SYNOPSIS

9       netstat [ -Aan ] [ -f address_family ] [ system ] [ core ]
10       netstat [ -himnrs ] [ -f address_family ] [ system ] [ core ]
11       netstat [ -n ] [ -I interface ] interval [ system ] [ core ]
12

DESCRIPTION

14       The  netstat command symbolically displays the contents of various net‐
15       work-related data structures.  There are a number  of  output  formats,
16       depending on the options for the information presented.  The first form
17       of the command displays a list of active  sockets  for  each  protocol.
18       The  second form presents the contents of one of the other network data
19       structures according to the option selected.   Using  the  third  form,
20       with  an  interval  specified,  netstat  will  continuously display the
21       information regarding packet traffic on the configured  network  inter‐
22       faces.
23
24       The options have the following meaning:
25
26       -A     With  the default display, show the address of any protocol con‐
27              trol blocks associated with sockets; used for debugging.
28
29       -a     With the default display, show the state of  all  sockets;  nor‐
30              mally sockets used by server processes are not shown.
31
32       -h     Show the state of the IMP host table.
33
34       -i     Show  the  state  of  interfaces which have been auto-configured
35              (interfaces statically configured into a system, but not located
36              at boot time are not shown).
37
38       -I interface
39              Show  information only about this interface; used with an inter‐
40              val as described below.
41
42       -m     Show statistics recorded by the memory management routines  (the
43              network manages a private pool of memory buffers).
44
45       -n     Show  network  addresses as numbers (normally netstat interprets
46              addresses and attempts  to  display  them  symbolically).   This
47              option may be used with any of the display formats.
48
49       -s     Show per-protocol statistics.
50
51       -r     Show  the routing tables.  When -s is also present, show routing
52              statistics instead.
53
54       -f address_family
55              Limit statistics or address control block reports  to  those  of
56              the  specified  address family.   The following address families
57              are recognized: inet, for AF_INET, ns, for AF_NS, and unix,  for
58              AF_UNIX.
59
60       The  arguments,  system  and  core  allow  substitutes for the defaults
61       ``/vmunix'' and ``/dev/kmem''.
62
63       The default display, for active sockets, shows  the  local  and  remote
64       addresses,  send  and receive queue sizes (in bytes), protocol, and the
65       internal state of the  protocol.   Address  formats  are  of  the  form
66       ``host.port''  or  ``network.port''  if  a socket's address specifies a
67       network but no specific host address.  When known the host and  network
68       addresses  are  displayed  symbolically  according  to  the  data bases
69       /etc/hosts and /etc/networks, respectively.  If a symbolic name for  an
70       address  is  unknown,  or if the -n option is specified, the address is
71       printed numerically, according to the address family.  For more  infor‐
72       mation  regarding  the  Internet  ``dot  format,''  refer  to inet(3N).
73       Unspecified, or ``wildcard'', addresses and ports appear as ``*''.
74
75       The interface display provides a table of cumulative statistics regard‐
76       ing packets transferred, errors, and collisions.  The network addresses
77       of the interface and the maximum transmission unit (``mtu'')  are  also
78       displayed.
79
80       The routing table display indicates the available routes and their sta‐
81       tus.  Each route consists of a destination host or network and a  gate‐
82       way  to  use in forwarding packets.  The flags field shows the state of
83       the route (``U'' if ``up''), whether the route is to a gateway (``G''),
84       and  whether  the  route was created dynamically by a redirect (``D'').
85       Direct routes are created for each  interface  attached  to  the  local
86       host;  the gateway field for such entries shows the address of the out‐
87       going interface.  The refcnt field gives the current number  of  active
88       uses of the route.  Connection oriented protocols normally hold on to a
89       single route for the duration of a connection while connectionless pro‐
90       tocols  obtain  a route while sending to the same destination.  The use
91       field provides a count of the number of packets sent using that  route.
92       The  interface  entry  indicates the network interface utilized for the
93       route.
94
95       When netstat is invoked with an interval argument, it displays  a  run‐
96       ning  count  of statistics related to network interfaces.  This display
97       consists of a column for the primary  interface  (the  first  interface
98       found  during  autoconfiguration)  and a column summarizing information
99       for all interfaces.  The primary interface may be replaced with another
100       interface  with the -I option.  The first line of each screen of infor‐
101       mation contains a summary since the system was last  rebooted.   Subse‐
102       quent lines of output show values accumulated over the preceding inter‐
103       val.
104

SEE ALSO

106       iostat(1), vmstat(1), hosts(5), networks(5), protocols(5), services(5),
107       trpt(8C)
108

BUGS

110       The  notion  of  errors is ill-defined.  Collisions mean something else
111       for the IMP.
112
113
114
1154.2 Berkeley Distribution         May 8, 1986                       NETSTAT(1)
Impressum