cmdref.net - Cheat Sheet and Example

cmdref.net is command references/cheat sheets/examples for system engineers.

User Tools

Site Tools


Sidebar








Cloud



Etc


Reference














.

network:ip.html



Network#basic

IP address and Subnet Mask Cheat Sheet

Web Sites

Definition of term

Term Explanation
Public IP address
Private IP address
Term Explanation
static IP address
dynamic IP address Dynamic IP address is assigned by DHCP.

Private addresses

Class CIDR Start End Number of addresses Example
A 10.0.0.0/8 10.0.0.0 10.255.255.255 16,777,216 10.0.0.0/24
10.0.1.0/24
10.1.0.0/24
10.2.0.0/24
B 172.16.0.0/12 172.16.0.0 172.31.255.255 1,048,576 172.16.0.0/24
172.16.1.0/24
172.17.0.0/24
C 192.168.0.0/16 192.168.0.0 192.168.255.255 65,536 192.168.0.0/24
192.168.1.0/24
Class A = 10.0.0.0/8
Class B = 172.16.0.0/12
Class C = 192.168.0.0/16


IPv4 CIDR

  • the number of available host addresses is usually reduced by two, namely the largest address, which is reserved as the broadcast address, and the smallest address, which identifies the network itself.
CIDR Mask Hosts the number of available host
/32 255.255.255.255 1 -
/31 255.255.255.254 2 0
/30 255.255.255.252 4 2
/29 255.255.255.248 8 6
/28 255.255.255.240 16 14
/27 255.255.255.224 32 30
/26 255.255.255.192 64 62
/25 255.255.255.128 128 126
/24 255.255.255.0 256 254
/23 255.255.254.0 512 510
/22 255.255.252.0 1,024 1,022
/21 255.255.248.0 2,048 2,046
/20 255.255.240.0 4,096 4,094
/19 255.255.224.0 8,192 8,190
/18 255.255.192.0 16,384 16,382
/17 255.255.128.0 32,768 32,766
/16 255.255.0.0 131,072 131,070
/8 255.0.0.0 16,777,216 16,777,214
CIDR /24 /25 /26 /27 /28 /29 /30
Mask 255.255.255.0 255.255.255.128 255.255.255.192 255.255.255.224 255.255.255.240 255.255.255.248 255.255.255.252
Hosts 254 126 62 30 14 6 2
Examples 10.1.0.0/24 10.1.0.0/25 10.1.0.0/26 10.1.0.0/27
10.1.0.32/27
10.1.0.64/26 10.1.0.64/27
10.1.0.96/27
10.1.0.128/25 10.1.0.128/26 10.1.0.128/27
10.1.0.160/27
10.1.0.192/26 10.1.0.192/27
10.1.0.224/27
10.1.1.0/24 10.1.1.0/25 10.1.1.0/26 10.1.1.0/27
10.1.1.32/27
10.1.1.64/26 10.1.1.64/27
10.1.1.96/27
10.1.1.128/25 10.1.1.128/26 10.1.1.128/27
10.1.1.160/27
10.1.1.192/26 10.1.1.192/27
10.1.1.224/27
10.1.2.0/24
/30 /29 /28 /27
192.168.0.X 2 6 14 30
0 the network itself the network itself the network itself the network itself
1 host1 host1 host1 host1
2 host2 host2 host2 host2
3 broadcast address host3 host3 host3
4 the network itself host4 host4 host4
5 host1 host5 host5 host5
6 host2 host6 host6 host6
7 broadcast address the network itself host7 host7
8 the network itself the network itself host8 host8
9 host1 host1 host9 host9
10 host2 host2 host10 host10
11 broadcast address host3 host11 host11
12 the network itself host4 host12 host12
13 host1 host5 host13 host13
14 host2 host6 host14 host14
15 broadcast address broadcast address broadcast address host15
16 the network itself the network itself the network itself host16
17 host1 host1 host1 host17
18 host2 host2 host2 host18
19 broadcast address host3 host3 host19
20 the network itself host4 host4 host20
21 host1 host5 host5 host21
22 host2 host6 host6 host22
23 broadcast address broadcast address host7 host23
24 the network itself the network itself host8 host24
25 host1 host1 host9 host25
26 host2 host2 host10 host26
27 broadcast address host3 host11 host27
28 the network itself host4 host12 host28
29 host1 host5 host13 host29
30 host2 host6 host14 host30
31 broadcast address broadcast address broadcast address broadcast address
abbr abbr abbr abbr abbr
240 the network itself the network itself the network itself
241 host1 host1 host1
242 host2 host2 host2
243 broadcast address host3 host3
244 the network itself host4 host4
245 host1 host5 host5
246 host2 host6 host6
247 broadcast address broadcast address host7
248 the network itself the network itself host8
249 host1 host1 host9
250 host2 host2 host10
251 broadcast address host3 host11
252 the network itself host4 host12
253 host1 host5 host13
254 host2 host6 host14
255 broadcast address broadcast address broadcast address

Cheat Sheet

n=network, H=host

CIDR Hosts the number of
available host
Note
n.n.n.H/30 4 2 n.n.n.0 - 3, n.n.n.4 - 7, n.n.n.8 - 11, n.n.n.12-15, ….
n.n.n.H/29 8 6 /24 = 32 Networks
n.n.n.0 - 7, n.n.n.8 - 15, n.n.n.16 - 23, n.n.n.24 - 31,
n.n.n.32 - 39, n.n.n.40 - 47, n.n.n.48 - 55, n.n.n.56 - 63,
n.n.n.64 - 71, n.n.n.72 - 79, n.n.n.80 - 87, n.n.n.88 - 95,
n.n.n.96 - 103, n.n.n.104 - 111, n.n.n.112 - 119, n.n.n.120 - 127,
n.n.n.128 - 135, n.n.n.136 - 143, n.n.n.144 - 151, n.n.n.152 - 159,
n.n.n.160 - 167, n.n.n.168 - 175, n.n.n.176 - 183, n.n.n.184 - 191,
n.n.n.192 - 199, n.n.n.200 - 207, n.n.n.208 - 215, n.n.n.216 - 223,
n.n.n.224 - 231, n.n.n.232 - 239, n.n.n.240 - 247, n.n.n.248 - 255
n.n.n.H/28 16 14 /24 = 16 Networks
n.n.n.0 - 15, n.n.n.16 - 31, n.n.n.32 - 47, n.n.n.48 - 63,
n.n.n.64 - 79, n.n.n.80 - 95, n.n.n.96 - 111, n.n.n.112 - 127,
n.n.n.128 - 143, n.n.n.144 - 159, n.n.n.160 - 175, n.n.n.176 - 191,
n.n.n.192 - 207, n.n.n.208 - 233, n.n.n.234 - 239, n.n.n.240 - 255
n.n.n.H/27 32 30 /24 = 8 Networks
n.n.n.0 - 31, n.n.n.32 - 63, n.n.n.64 - 95, n.n.n.96 - 127,
n.n.n.128 - 159, n.n.n.160 - 191, n.n.n.192 - 223, n.n.n.224 - 255
n.n.n.H/26 64 62 n.n.n.0 - 63, n.n.n.64 - 127,
n.n.n.128 - 191, n.n.n.192 - 255
n.n.n.H/25 128 126 n.n.n.0 - 127,
n.n.n.128 - 255
n.n.n.H/24 256 254 n.n.0.0 - 255,
n.n.1.0 - 255,
n.n.2.0 - 255
n.n.H.H/23 512 510 n.n.0.0 - n.n.1.255,
n.n.2.0 - n.n.3.255,
n.n.4.0 - n.n.5.255,….

Example

/29(255.255.255.248)
Example Hosts the network itself Host Start - End broadcast address
10.0.255.0/29 8 10.0.255.0 10.0.255.1 - 10.0.255.6 10.0.255.7
10.0.255.8/29 8 10.0.255.8 10.0.255.9 - 10.0.255.14 10.0.255.15
10.0.255.16/29 8 10.0.255.16 10.0.255.17 - 10.0.255.22 10.0.255.23
10.0.255.24/29 8 10.0.255.24 10.0.255.25 - 10.0.255.30 10.0.255.31
/28(255.255.255.240)
Example Hosts the network itself Host Start - End broadcast address
10.0.255.0/28 16 10.0.255.0 10.0.255.1 - 10.0.255.14 10.0.255.15
10.0.255.16/28 16 10.0.255.16 10.0.255.17 - 10.0.255.30 10.0.255.31
10.0.255.32/28 16 10.0.255.32 10.0.255.33 - 10.0.255.46 10.0.255.47
10.0.255.208/240 16 10.0.255.208 10.0.255.209 - 10.0.255.222 10.0.255.223
10.0.255.224/240 16 10.0.255.224 10.0.255.225 - 10.0.255.238 10.0.255.239
10.0.255.32/240 16 10.0.255.240 10.0.255.241 - 10.0.255.254 10.0.255.255
/27(255.255.255.224)
Example Hosts the network itself Host Start - End broadcast address
10.0.255.0/27 32 10.0.255.0 10.0.255.1 - 10.0.255.30 10.0.255.31
10.0.255.32/27 32 10.0.255.32 10.0.255.33 - 10.0.255.62 10.0.255.63
10.0.255.64/27 32 10.0.255.64 10.0.255.65 - 10.0.255.94 10.0.255.95
10.0.255.192/27 32 10.0.255.192 10.0.255.193 - 10.0.255.222 10.0.255.223
10.0.255.224/27 32 10.0.255.224 10.0.255.225 - 10.0.255.254 10.0.255.255
/26(255.255.255.192)
Example Hosts the network itself Host Start - End broadcast address
192.168.0.0/26 64 192.168.0.0 192.168.0.1 - 192.168.0.62 192.168.0.63
192.168.0.64/26 64 192.168.0.64 192.168.0.65 - 192.168.0.126 192.168.0.127
192.168.0.128/26 64 192.168.0.128 192.168.0.129 - 192.168.0.190 192.168.0.191
192.168.0.192/26 64 192.168.0.192 192.168.0.193 - 192.168.0.254 192.168.0.255
/25(255.255.255.128)
Example Hosts the network itself Host Start - End broadcast address
192.168.0.0/25 128 192.168.0.0 192.168.0.1 - 192.168.1.126 192.168.0.127
192.168.0.128/25 128 192.168.0.128 192.168.0.129 - 192.168.0.254 192.168.0.255
/24(255.255.255.0)
Example Hosts the network itself Host Start - End broadcast address
192.168.0.0/24 256 192.168.0.0 192.168.0.1 - 192.168.0.254 192.168.0.255
/23(255.255.254.0)
Example Hosts the network itself Host Start - End broadcast address
192.168.0.0/23 512 192.168.0.0 192.168.0.1 - 192.168.1.254 192.168.1.255
192.168.2.0/23 512 192.168.2.0 192.168.2.1 - 192.168.3.254 192.168.3.255
192.168.10.0/23 512 192.168.10.0 192.168.10.1 - 192.168.11.254 192.168.1.255
/22(255.255.252.0)
Example Hosts the network itself Host Start - End broadcast address
192.168.0.0/22 1,024 192.168.0.0 192.168.0.1 - 192.168.3.254 192.168.3.255
192.168.4.0/22 1,024 192.168.4.0 192.168.4.1 - 192.168.7.254 192.168.7.255
192.168.200.0/22 1,024 192.168.200.0 192.168.200.1 - 192.168.203.254 192.168.203.255
/21(255.255.248.0)
Example Hosts the network itself Host Start - End broadcast address
192.168.0.0/21 2,048 192.168.0.0 192.168.0.1 - 192.168.7.254 192.168.7.255
192.168.8.0/21 2,048 192.168.0.0 192.168.8.1 - 192.168.15.254 192.168.15.255
192.168.200.0/21 2,048 192.168.200.0 192.168.200.1 - 192.168.207.254 192.168.207.255
/20(255.255.240.0)
Example Hosts the network itself Host Start - End broadcast address
192.168.0.0/20 4,096 192.168.0.0 192.168.0.1 - 192.168.15.254 192.168.15.255


IP Design

Example
Location Segment Hosts Start-End Example
Location1 10.1.0.0/16 131,072 network itself : 10.1.0.0
Host : 10.1.0.1 - 10.1.255.254
broadcast : 10.1.255.255
10.1.0.0/24 (Hosts 256)
10.1.1.0/24 (Hosts 256)
10.1.255.0/24 (Hosts 256)
Location2 10.2.0.0/16 131,072 network itself : 10.2.0.0
Host : 10.2.0.1 - 10.2.255.254
broadcast : 10.2.255.255
10.2.0.0/24 (Hosts 256)
10.2.1.0/24 (Hosts 256)
10.2.255.0/24 (Hosts 256)
Location3 10.3.0.0/16 131,072 network itself : 10.3.0.0
Host : 10.3.0.1 - 10.3.255.254
broadcast : 10.3.255.255
10.3.0.0/24 (Hosts 256)
10.3.1.0/24 (Hosts 256)
10.3.255.0/24 (Hosts 256)
Location Segment Hosts Start-End Example
Location1 192.168.0.0/21 2,048 network itself : 192.168.0.0
Host : 192.168.0.1 - 192.168.7.254
broadcast : 192.168.7.255
192.168.0.0/24 (Hosts 256)
192.168.7.0/24 (Hosts 256)
Location2 192.168.8.0/21 2,048 network itself : 192.168.8.0
Host : 192.168.8.1 - 192.168.15.254
broadcast : 192.168.15.255
192.168.8.0/24 (Hosts 256)
192.168.15.0/24 (Hosts 256)
Location3 192.168.16.0/21 2,048 network itself : 192.168.16.0
Host : 192.168.16.1 - 192.168.23.254
broadcast : 192.168.23.255
192.168.20.0/24 (Hosts 256)
192.168.23.0/24 (Hosts 256)
Location Segment Hosts Start-End Example
Location1 192.168.0.0/24 256 network itself : 192.168.0.0
Host : 192.168.0.1 - 192.168.0.254
broadcast : 192.168.0.255
192.168.0.0/24 (Hosts 256)
Location2 192.168.1.0/24 256 network itself : 192.168.1.0
Host : 192.168.1.1 - 192.168.1.254
broadcast : 192.168.1.255
192.168.1.0/25 (Hosts 128 : 192.168.1.0-128)
192.168.1.128/25 (Hosts 128 : 192.168.1.128-255)
Location3 192.168.2.0/24 256 network itself : 192.168.2.0
Host : 192.168.2.1 - 192.168.2.254
broadcast : 192.168.2.255
192.168.3.0/26 (Hosts 64 : 192.168.2.0-63)
192.168.3.64/26 (Hosts 64 : 192.168.2.64-127)
192.168.3.128/26 (Hosts 64 : 192.168.2.128-191)
192.168.3.192/26 (Hosts 64 : 192.168.2.192-255)



network/ip.html.txt · Last modified: 2021/01/18 by admin

Page Tools