• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL



netstat Shows network status.
netstat [-Aan] [-f <address_family>] [-M <core>] [-N <system>]
netstat [-dghirmnrs] [-f <address_family>] [-M <core>] [-N <system>]
netstat [-dn] [-I <interface>] [-M <core>] [-N <system>] [-w <wait>]
netstat [-p <protocol>] [-M <core>] [-N <system>]

netstat symbolically displays the contents of various network-related data structures. There are a number of output formats, depending on the options used for the information presented.
The first form displays a list of active sockets for each protocol.
The second form displays the contents of one of the other network data structures according to the option selected.
The third form, with a <wait> interval specified, netstat continuously displays the information regarding packet traffic on the configured network interfaces.
The fourth form, displays statistics about the named protocol.
-A Shows the address of any protocol control blocks associated with sockets with the default display. Used for debugging.
-a Shows the state of all sockets with the default display. Normally sockets used by server processes are not shown.
-n Shows network addresses as numbers. Normally, netstat interprets addresses and attempts to display them symbolically. This option may be used with any of the display formats.
-f <address_family> Limits statistics or address control block reports to those of the specified <address_family>. The following address families are recognized: inet (for AF_INET); ipx (for AF_IPX); ns (for AF_NS); iso (for AF_ISO); local (for AF_LOCAL); unix (for AF_UNIX).
-M <core> Extracts values associated with the name list from the specified <core> instead of the default /dev/kmem.
-N <system> Extracts the name list from the specified <system> instead of the default /bsd.
-d Shows the number of dropped packets.
-g Shows information relating to multicast (group address) routing. By default, shows the IP multicast virtual-interface and routing tables. If -s option is also specified, shows multicast routing statistics.
-h Shows the state of the IMP host table (obsolete).
-i Shows the state of interfaces that have been auto-configured (interfaces statically configured into a system, but not located at boot time are not shown). If the -a option is also specified, multicast addresses currently in use are shown for each ethernet interface and for each IP interface address. Multicast addresses are shown on separate lines following the interface address with which they are associated.
-m Shows statistics recorded by the memory management routines. The network manages a private pool of memory buffers.
-r Shows the routing tables. When -s is also specified, shows routing statistics instead.
-s Shows per-protocol statistics. If this option is repeated, counters with a value of zero are suppressed.
-I <interface> Shows information about the specified <interface>. Used with a <wait> interval.
-w <wait> Shows network interface statistics at intervals of <wait> seconds.
-p <protocol> Shows statistics about <protocol>, which is either a well-known name for a protocol or an alias for it. Some protocol names and aliases are listed in /etc/protocols. A null response typically means that there are no interesting numbers to report. The program complains if <protocol> is unknown, or if there is no statistics routine for it.
The routing table display indicates the available routes and their status. Each route consists of a destination host or network and a gateway to use in forwarding packets. The flags field shows a collection of information about the route stored as binary choices. The individual flags are discussed in route (8) and route (4) man pages. The mapping between letters and flags is as follows:
1 RTF_PROTO2 Protocol-specific routing flag 1.
2 RTF_PROTO1 Protocol specific routing flag 2.
B RTF_BLACKHOLE Just discards pkts during ukpdates.
C RTF_CLONING Generates new routes on use.
D RTF_DYNAMIC Created dynamically by redirect.
G RTF_GATEWAY Destination requires forwarding by intermediary.
H RTF_HOST Host entry (otherwise inet).
L RTF_LLINFO Valid protocol to link address translation.
M RTF_MODIFIED Modified dynamically by redirect.
R RTF_REJECT Host or net unreachable.
S RTF_STATIC Manually added.
U RTF_UP Route usable.
X RTF_XRESOLVE External daemon translates proto to link address.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint