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

   2 .\" Copyright (C) 2002, Sun Microsystems, Inc. All Rights Reserved
   3 .\" Copyright 1989 AT&T
   4 .\" Copyright (c) 1983 Regents of the University of California. All rights reserved. The Berkeley software License Agreement specifies the terms and conditions for redistribution.
   5 .TH NETSTAT 1M "Sep 02, 2015"
   6 .SH NAME
   7 netstat \- show network status
   8 .SH SYNOPSIS
   9 .LP
  10 .nf
  11 \fBnetstat\fR [\fB-anvR\fR] [\fB-f\fR \fIaddress_family\fR] [\fB-P\fR \fIprotocol\fR]
  12 .fi
  13 
  14 .LP
  15 .nf
  16 \fBnetstat\fR \fB-g\fR [\fB-nv\fR] [\fB-f\fR \fIaddress_family\fR]
  17 .fi
  18 
  19 .LP
  20 .nf
  21 \fBnetstat\fR \fB-p\fR [\fB-n\fR] [\fB-f\fR \fIaddress_family\fR]
  22 .fi
  23 
  24 .LP
  25 .nf
  26 \fBnetstat\fR \fB-s\fR [\fB-f\fR \fIaddress_family\fR] [\fB-P\fR \fIprotocol\fR]
  27      [\fB-T\fR u | d ] [\fIinterval\fR [\fIcount\fR]]
  28 .fi
  29 
  30 .LP
  31 .nf
  32 \fBnetstat\fR \fB-m\fR [\fB-T\fR u | d ] [\fB-v\fR] [\fIinterval\fR [\fIcount\fR]]
  33 .fi
  34 
  35 .LP
  36 .nf
  37 \fBnetstat\fR \fB-i\fR [\fB-I\fR \fIinterface\fR] [\fB-an\fR] [\fB-f\fR \fIaddress_family\fR]
  38      [\fB-T\fR u | d ] [\fIinterval\fR [\fIcount\fR]]
  39 .fi
  40 
  41 .LP
  42 .nf
  43 \fBnetstat\fR \fB-r\fR [\fB-anvR\fR] [\fB-f\fR \fIaddress_family\fR | \fIfilter\fR]
  44 .fi
  45 
  46 .LP
  47 .nf
  48 \fBnetstat\fR \fB-M\fR [\fB-ns\fR] [\fB-f\fR \fIaddress_family\fR]
  49 .fi
  50 
  51 .LP
  52 .nf
  53 \fBnetstat\fR \fB-D\fR [\fB-I\fR \fIinterface\fR] [\fB-f\fR \fIaddress_family\fR]
  54 .fi
  55 
  56 .SH DESCRIPTION
  57 .LP
  58 The \fBnetstat\fR command displays the contents of certain network-related data
  59 structures in various formats, depending on the options you select.
  60 .LP
  61 The \fBnetstat\fR command has the several forms shown in the SYNOPSIS section,
  62 above, listed as follows:
  63 .RS +4
  64 .TP
  65 .ie t \(bu
  66 .el o
  67 The first form of the command (with no required arguments) displays a list of
  68 active sockets for each protocol.


 107 .RE
 108 .LP
 109 These forms are described in greater detail below.
 110 .LP
 111 With no arguments (the first form), \fBnetstat\fR displays connected sockets
 112 for \fBPF_INET\fR, \fBPF_INET6\fR, and \fBPF_UNIX\fR, unless modified otherwise
 113 by the \fB-f\fR option.
 114 .SH OPTIONS
 115 .ne 2
 116 .na
 117 \fB\fB-a\fR\fR
 118 .ad
 119 .sp .6
 120 .RS 4n
 121 Show the state of all sockets, all routing table entries, or all interfaces,
 122 both physical and logical. Normally, listener sockets used by server processes
 123 are not shown. Under most conditions, only interface, host, network, and
 124 default routes are shown and only the status of physical interfaces is shown.
 125 .RE
 126 













 127 .sp
 128 .ne 2
 129 .na
 130 \fB\fB-f\fR \fIaddress_family\fR\fR
 131 .ad
 132 .sp .6
 133 .RS 4n
 134 Limit all displays to those of the specified \fIaddress_family\fR. The value of
 135 \fIaddress_family\fR can be one of the following:
 136 .sp
 137 .ne 2
 138 .na
 139 \fB\fBinet\fR\fR
 140 .ad
 141 .RS 9n
 142 For the \fBAF_INET\fR address family showing IPv4 information.
 143 .RE
 144 
 145 .sp
 146 .ne 2


   1 '\" te
   2 .\" Copyright 2018, Joyent, Inc.
   3 .\" Copyright (C) 2002, Sun Microsystems, Inc. All Rights Reserved
   4 .\" Copyright 1989 AT&T
   5 .\" Copyright (c) 1983 Regents of the University of California. All rights reserved. The Berkeley software License Agreement specifies the terms and conditions for redistribution.
   6 .TH NETSTAT 1M "Sep 02, 2015"
   7 .SH NAME
   8 netstat \- show network status
   9 .SH SYNOPSIS
  10 .LP
  11 .nf
  12 \fBnetstat\fR [\fB-anvR\fR] [\fB-f\fR \fIaddress_family\fR] [\fB-P\fR \fIprotocol\fR]
  13 .fi
  14 
  15 .LP
  16 .nf
  17 \fBnetstat\fR \fB-g\fR [\fB-nv\fR] [\fB-f\fR \fIaddress_family\fR]
  18 .fi
  19 
  20 .LP
  21 .nf
  22 \fBnetstat\fR \fB-p\fR [\fB-n\fR] [\fB-f\fR \fIaddress_family\fR]
  23 .fi
  24 
  25 .LP
  26 .nf
  27 \fBnetstat\fR \fB-s\fR [\fB-f\fR \fIaddress_family\fR] [\fB-P\fR \fIprotocol\fR]
  28      [\fB-T\fR u | d ] [\fIinterval\fR [\fIcount\fR]]
  29 .fi
  30 
  31 .LP
  32 .nf
  33 \fBnetstat\fR \fB-m\fR [\fB-T\fR u | d ] [\fB-v\fR] [\fIinterval\fR [\fIcount\fR]]
  34 .fi
  35 
  36 .LP
  37 .nf
  38 \fBnetstat\fR \fB-i\fR [\fB-I\fR \fIinterface\fR] [\fB-acn\fR] [\fB-f\fR \fIaddress_family\fR]
  39      [\fB-T\fR u | d ] [\fIinterval\fR [\fIcount\fR]]
  40 .fi
  41 
  42 .LP
  43 .nf
  44 \fBnetstat\fR \fB-r\fR [\fB-acnvR\fR] [\fB-f\fR \fIaddress_family\fR | \fIfilter\fR]
  45 .fi
  46 
  47 .LP
  48 .nf
  49 \fBnetstat\fR \fB-M\fR [\fB-cns\fR] [\fB-f\fR \fIaddress_family\fR]
  50 .fi
  51 
  52 .LP
  53 .nf
  54 \fBnetstat\fR \fB-D\fR [\fB-I\fR \fIinterface\fR] [\fB-f\fR \fIaddress_family\fR]
  55 .fi
  56 
  57 .SH DESCRIPTION
  58 .LP
  59 The \fBnetstat\fR command displays the contents of certain network-related data
  60 structures in various formats, depending on the options you select.
  61 .LP
  62 The \fBnetstat\fR command has the several forms shown in the SYNOPSIS section,
  63 above, listed as follows:
  64 .RS +4
  65 .TP
  66 .ie t \(bu
  67 .el o
  68 The first form of the command (with no required arguments) displays a list of
  69 active sockets for each protocol.


 108 .RE
 109 .LP
 110 These forms are described in greater detail below.
 111 .LP
 112 With no arguments (the first form), \fBnetstat\fR displays connected sockets
 113 for \fBPF_INET\fR, \fBPF_INET6\fR, and \fBPF_UNIX\fR, unless modified otherwise
 114 by the \fB-f\fR option.
 115 .SH OPTIONS
 116 .ne 2
 117 .na
 118 \fB\fB-a\fR\fR
 119 .ad
 120 .sp .6
 121 .RS 4n
 122 Show the state of all sockets, all routing table entries, or all interfaces,
 123 both physical and logical. Normally, listener sockets used by server processes
 124 are not shown. Under most conditions, only interface, host, network, and
 125 default routes are shown and only the status of physical interfaces is shown.
 126 .RE
 127 
 128 .sp
 129 .ne 2
 130 .na
 131 \fB\fB-c\fR\fR
 132 .ad
 133 .sp .6
 134 .RS 4n
 135 Print IPv4 networks using CIDR (x.y.z.a/NN) notation with the \fB-i\fR,
 136 \fB-r\fR, and \fB-M\fR options. IPv6 networks default to this, but due to
 137 backward compatibility, IPv4 ones do not without this flag.  A noncontiguous
 138 IPv4 netmask will print "/NM" if this flag is enabled.
 139 .RE
 140 
 141 .sp
 142 .ne 2
 143 .na
 144 \fB\fB-f\fR \fIaddress_family\fR\fR
 145 .ad
 146 .sp .6
 147 .RS 4n
 148 Limit all displays to those of the specified \fIaddress_family\fR. The value of
 149 \fIaddress_family\fR can be one of the following:
 150 .sp
 151 .ne 2
 152 .na
 153 \fB\fBinet\fR\fR
 154 .ad
 155 .RS 9n
 156 For the \fBAF_INET\fR address family showing IPv4 information.
 157 .RE
 158 
 159 .sp
 160 .ne 2