Print this page
9352 netstat(1M) should be able to print IPv4 networks in CIDR form


   5 NAME
   6        netstat - show network status
   7 
   8 SYNOPSIS
   9        netstat [-anvR] [-f address_family] [-P protocol]
  10 
  11 
  12        netstat -g [-nv] [-f address_family]
  13 
  14 
  15        netstat -p [-n] [-f address_family]
  16 
  17 
  18        netstat -s [-f address_family] [-P protocol]
  19             [-T u | d ] [interval [count]]
  20 
  21 
  22        netstat -m [-T u | d ] [-v] [interval [count]]
  23 
  24 
  25        netstat -i [-I interface] [-an] [-f address_family]
  26             [-T u | d ] [interval [count]]
  27 
  28 
  29        netstat -r [-anvR] [-f address_family | filter]
  30 
  31 
  32        netstat -M [-ns] [-f address_family]
  33 
  34 
  35        netstat -D [-I interface] [-f address_family]
  36 
  37 
  38 DESCRIPTION
  39        The netstat command displays the contents of certain network-related
  40        data structures in various formats, depending on the options you
  41        select.
  42 
  43        The netstat command has the several forms shown in the SYNOPSIS
  44        section, above, listed as follows:
  45 
  46            o      The first form of the command (with no required arguments)
  47                   displays a list of active sockets for each protocol.
  48 
  49            o      The second, third, and fourth forms (-g, -p, and -s options)
  50                   display information from various network data structures.
  51 
  52            o      The fifth form (-m option) displays STREAMS memory


  62 
  63            o      The ninth form (-D option) displays the state of DHCP on one
  64                   or all interfaces.
  65 
  66        These forms are described in greater detail below.
  67 
  68        With no arguments (the first form), netstat displays connected sockets
  69        for PF_INET, PF_INET6, and PF_UNIX, unless modified otherwise by the -f
  70        option.
  71 
  72 OPTIONS
  73        -a
  74 
  75            Show the state of all sockets, all routing table entries, or all
  76            interfaces, both physical and logical. Normally, listener sockets
  77            used by server processes are not shown. Under most conditions, only
  78            interface, host, network, and default routes are shown and only the
  79            status of physical interfaces is shown.
  80 
  81 









  82        -f address_family
  83 
  84            Limit all displays to those of the specified address_family. The
  85            value of address_family can be one of the following:
  86 
  87            inet
  88                     For the AF_INET address family showing IPv4 information.
  89 
  90 
  91            inet6
  92                     For the AF_INET6 address family showing IPv6 information.
  93 
  94 
  95            unix
  96                     For the AF_UNIX address family.
  97 
  98 
  99 
 100        -f filter
 101 




   5 NAME
   6        netstat - show network status
   7 
   8 SYNOPSIS
   9        netstat [-anvR] [-f address_family] [-P protocol]
  10 
  11 
  12        netstat -g [-nv] [-f address_family]
  13 
  14 
  15        netstat -p [-n] [-f address_family]
  16 
  17 
  18        netstat -s [-f address_family] [-P protocol]
  19             [-T u | d ] [interval [count]]
  20 
  21 
  22        netstat -m [-T u | d ] [-v] [interval [count]]
  23 
  24 
  25        netstat -i [-I interface] [-acn] [-f address_family]
  26             [-T u | d ] [interval [count]]
  27 
  28 
  29        netstat -r [-acnvR] [-f address_family | filter]
  30 
  31 
  32        netstat -M [-cns] [-f address_family]
  33 
  34 
  35        netstat -D [-I interface] [-f address_family]
  36 
  37 
  38 DESCRIPTION
  39        The netstat command displays the contents of certain network-related
  40        data structures in various formats, depending on the options you
  41        select.
  42 
  43        The netstat command has the several forms shown in the SYNOPSIS
  44        section, above, listed as follows:
  45 
  46            o      The first form of the command (with no required arguments)
  47                   displays a list of active sockets for each protocol.
  48 
  49            o      The second, third, and fourth forms (-g, -p, and -s options)
  50                   display information from various network data structures.
  51 
  52            o      The fifth form (-m option) displays STREAMS memory


  62 
  63            o      The ninth form (-D option) displays the state of DHCP on one
  64                   or all interfaces.
  65 
  66        These forms are described in greater detail below.
  67 
  68        With no arguments (the first form), netstat displays connected sockets
  69        for PF_INET, PF_INET6, and PF_UNIX, unless modified otherwise by the -f
  70        option.
  71 
  72 OPTIONS
  73        -a
  74 
  75            Show the state of all sockets, all routing table entries, or all
  76            interfaces, both physical and logical. Normally, listener sockets
  77            used by server processes are not shown. Under most conditions, only
  78            interface, host, network, and default routes are shown and only the
  79            status of physical interfaces is shown.
  80 
  81 
  82        -c
  83 
  84            Print IPv4 networks using CIDR (x.y.z.a/NN) notation with the -i,
  85            -r, and -M options. IPv6 networks default to this, but due to
  86            backward compatibility, IPv4 ones do not without this flag.  A
  87            noncontiguous IPv4 netmask will print "/NM" if this flag is
  88            enabled.
  89 
  90 
  91        -f address_family
  92 
  93            Limit all displays to those of the specified address_family. The
  94            value of address_family can be one of the following:
  95 
  96            inet
  97                     For the AF_INET address family showing IPv4 information.
  98 
  99 
 100            inet6
 101                     For the AF_INET6 address family showing IPv6 information.
 102 
 103 
 104            unix
 105                     For the AF_UNIX address family.
 106 
 107 
 108 
 109        -f filter
 110