Skip to content

IPTool Subnet List

mikael edited this page Dec 26, 2023 · 1 revision

Introduction

The subnet list command of iptool is meant to be a quick reference when trying to calculate the size of a subnet.

Usage

Use the iptool subnet list command to display a cheat sheet for all IPv4 subnets.

Usage:
  iptool subnet list [flags]

Aliases:
  list, ls

Flags:
  -h, --help                  help for list
  -p, --prefix-lengths ints   a list of prefix lengths (0-32)

Output

Default

By default the command prints all subnet masks:

Command

iptool subnet list

Output

CIDR  Subnet Mask      Addresses   Wildcard Mask
--------------------------------------------------
 /32  255.255.255.255  1           0.0.0.0
 /31  255.255.255.254  2           0.0.0.1
 /30  255.255.255.252  4           0.0.0.3
 /29  255.255.255.248  8           0.0.0.7
 /28  255.255.255.240  16          0.0.0.15
 /27  255.255.255.224  32          0.0.0.31
 /26  255.255.255.192  64          0.0.0.63
 /25  255.255.255.128  128         0.0.0.127
 /24  255.255.255.0    256         0.0.0.255
 /23  255.255.254.0    512         0.0.1.255
 /22  255.255.252.0    1024        0.0.3.255
 /21  255.255.248.0    2048        0.0.7.255
 /20  255.255.240.0    4096        0.0.15.255
 /19  255.255.224.0    8192        0.0.31.255
 /18  255.255.192.0    16384       0.0.63.255
 /17  255.255.128.0    32768       0.0.127.255
 /16  255.255.0.0      65536       0.0.255.255
 /15  255.254.0.0      131072      0.1.255.255
 /14  255.252.0.0      262144      0.3.255.255
 /13  255.248.0.0      524288      0.7.255.255
 /12  255.240.0.0      1048576     0.15.255.255
 /11  255.224.0.0      2097152     0.31.255.255
 /10  255.192.0.0      4194304     0.63.255.255
  /9  255.128.0.0      8388608     0.127.255.255
  /8  255.0.0.0        16777216    0.255.255.255
  /7  254.0.0.0        33554432    1.255.255.255
  /6  252.0.0.0        67108864    3.255.255.255
  /5  248.0.0.0        134217728   7.255.255.255
  /4  240.0.0.0        268435456   15.255.255.255
  /3  224.0.0.0        536870912   31.255.255.255
  /2  192.0.0.0        1073741824  63.255.255.255
  /1  128.0.0.0        2147483648  127.255.255.255
  /0  0.0.0.0          4294967295  255.255.255.255

Selection

Use the --prefix-lengths (or -p) flag to select the prefixes to display:

Command

iptool subnet list --prefix-lengths 8,16,24,30

Output

CIDR  Subnet Mask      Addresses   Wildcard Mask
--------------------------------------------------
  /8  255.0.0.0        16777216    0.255.255.255
 /16  255.255.0.0      65536       0.0.255.255
 /24  255.255.255.0    256         0.0.0.255
 /30  255.255.255.252  4           0.0.0.3

FAQs

  1. FAQs

Command Groups

Inspect Commands

Subnet Commands

TCP Commands

Clone this wiki locally