无类域间路由cidr
Internet and most of the network infrastructures uses IP Protocol. IP protocol uses IP addresses in order to connect different hosts and networks over globe. Classless Inter Domain Routing or CIDR is hierarchical IP addressing scheme used to set IP addresses to the hosts and network. Here we will learn how to calculate IP address, Network Address, Broadcast Address, Network Mask and provide these as cheat sheet.
互联网和大多数网络基础结构都使用IP协议。 IP协议使用IP地址以连接全球各地的不同主机和网络。 无类域间路由或CIDR是用于为主机和网络设置IP地址的分层IP寻址方案。 在这里,我们将学习如何计算IP地址,网络地址,广播地址,网络掩码并将其作为备忘单提供。
IP地址,网络地址,广播地址,网络掩码计算 (IP address, Network Address, Broadcast Address, Network Mask Calculation)
We will calculate given network parameters in this part we can use following cheat sheet. In this example we will use 192.168.1.0
as network address. We need 10 IP address for our host. If we look to the table we see that Potential host numbers a 2 and its multiply. So we will use 16 host line which have /28
network mask or 255.255.255.240
. So the network information will be like below.
我们将在这一部分中计算给定的网络参数,我们可以使用以下速查表。 在此示例中,我们将使用192.168.1.0
作为网络地址。 我们的主机需要10个IP地址。 如果看表,我们会看到潜在主机编号为2及其乘积。 因此,我们将使用具有/28
网络掩码或255.255.255.240
16个主机行。 因此,网络信息将如下所示。
Network Address: 192.168.1.0
Host IP Range: 192.168.1.1 - 192.168.1.10
Actual Useable Host IP Count: 14
Broadcast Address: 192.168.1.15
CIDR备忘单 (CIDR Cheat Sheet)
Here is some explanation
这是一些解释
Prefix
is bit count for network addressPrefix
是网络地址的位数Amount Of a Class C
is how many C class network can be created in this networkC类的
Amount Of a Class C
是可以在该网络中创建多少个C类网络Potential Hosts
is the count of IP numbersPotential Hosts
是IP数量的计数Actual Hosts
is the count of usable IP numbers because 1 IP is used for network address and 1 IP is used for broadcast purposes.Actual Hosts
是可用IP数量的计数,因为1 IP用于网络地址,1 IP用于广播目的。Netmask
is decimal presentation of the prefix with IP format.Netmask
是IP格式的前缀的十进制表示形式。
Prefix | Amount Of a Class C | Potential Hosts | Actual Hosts | Netmask | # of subnets |
/31 | 1/128 | 2 | 255.255.255.254 | 128 | |
/30 | 1/64 | 4 | 2 | 255.255.255.252 | 64 |
/29 | 1/32 | 8 | 6 | 255.255.255.248 | 32 |
/28 | 1/16 | 16 | 14 | 255.255.255.240 | 16 |
/27 | 1/8 | 32 | 30 | 255.255.255.224 | 8 |
/26 | 1/4 | 64 | 62 | 255.255.255.192 | 4 |
/25 | 1/2 | 128 | 126 | 255.255.255.128 | 2 |
/24 | 1 | 256 | 254 | 255.255.255.0 | 1 |
/23 | 2 | 512 | 510 | 255.255.254.0 | 128 |
/22 | 4 | 1,024 | 1,022 | 255.255.252.0 | 64 |
/21 | 8 | 2,048 | 2,046 | 255.255.248.0 | 32 |
/20 | 16 | 4,096 | 4,094 | 255.255.240.0 | 16 |
/19 | 32 | 8,192 | 8,190 | 255.255.224.0 | 8 |
/18 | 64 | 16,384 | 16,382 | 255.255.192.0 | 4 |
/17 | 128 | 32,768 | 32,766 | 255.255.128.0 | 2 |
/16 | 256 = 1 class B net | 65,536 | 65,534 | 255.255.0.0 | 1 |
/15 | 512 = 2 B nets | 131,072 | 131,070 | 255.254.0.0 | 128 |
/14 | 1,024 = 4 B nets | 262,144 | 262,142 | 255.252.0.0 | 64 |
/13 | 2,048 = 8 B nets | 524,288 | 524,286 | 255.248.0.0 | 32 |
/12 | 4,096 = 16 B nets | 1,048,576 | 1,048,574 | 255.240.0.0 | 16 |
/11 | 8,192 = 32 B nets | 2,097,152 | 2,097,150 | 255.224.0.0 | 8 |
/10 | 16,384 = 64 B nets | 4,194,304 | 4,194,302 | 255.192.0.0 | 4 |
/9 | 32,768 = 128 B nets | 8,388,608 | 8,388,606 | 255.128.0.0 | 2 |
/8 | 65,536 = 256 B nets = 1 A net | 16,777,216 | 16,777,214 | 255.0.0.0 | 1 |
/7 | 131,072 = 2 A nets | 33,554,432 | 33,554,430 | 254.0.0.0 | 128 |
/6 | 262,144 = 4 A nets | 67,108,864 | 67,108,862 | 252.0.0.0 | 64 |
/5 | 524,888 = 8 A nets | 134,217,728 | 134,217,726 | 248.0.0.0 | 32 |
/4 | 1,048,576 = 16 A nets | 268,435,456 | 268,435,454 | 240.0.0.0 | 16 |
/3 | 2,097,152 = 32 A nets | 536,870,912 | 536,870,910 | 224.0.0.0 | 8 |
/2 | 4,194,304 = 64 A nets | 1,073,741,824 | 1,073,741,822 | 192.0.0.0 | 4 |
/1 | 8,388,608 = 128 A nets | 2,147,483,648 | 2,147,483,646 | 128.0.0.0 | 2 |
/0 | 16,777,216 = 256 A nets | 4,294,967,296 | 4,294,967,294 | 0.0.0.0 | 1 |
字首 | C类金额 | 潜在主机 | 实际主机 | 网路遮罩 | 子网数 |
/ 31 | 1/128 | 2 | 255.255.255.254 | 128 | |
/ 30 | 1/64 | 4 | 2 | 255.255.255.252 | 64 |
/ 29 | 1/32 | 8 | 6 | 255.255.255.248 | 32 |
/ 28 | 1/16 | 16 | 14 | 255.255.255.240 | 16 |
/ 27 | 1/8 | 32 | 30 | 255.255.255.224 | 8 |
/ 26 | 1/4 | 64 | 62 | 255.255.255.192 | 4 |
/ 25 | 1/2 | 128 | 126 | 255.255.255.128 | 2 |
/ 24 | 1个 | 256 | 254 | 255.255.255.0 | 1个 |
/ 23 | 2 | 512 | 510 | 255.255.254.0 | 128 |
/ 22 | 4 | 1,024 | 1,022 | 255.255.252.0 | 64 |
/ 21 | 8 | 2,048 | 2,046 | 255.255.248.0 | 32 |
/ 20 | 16 | 4,096 | 4,094 | 255.255.240.0 | 16 |
/ 19 | 32 | 8,192 | 8,190 | 255.255.224.0 | 8 |
/ 18 | 64 | 16,384 | 16,382 | 255.255.192.0 | 4 |
/ 17 | 128 | 32,768 | 32,766 | 255.255.128.0 | 2 |
/ 16 | 256 = 1个B级网 | 65,536 | 65,534 | 255.255.0.0 | 1个 |
/ 15 | 512 = 2个B网 | 131,072 | 131,070 | 255.254.0.0 | 128 |
/ 14 | 1,024 = 4个B网 | 262,144 | 262,142 | 255.252.0.0 | 64 |
/ 13 | 2,048 = 8个B网 | 524,288 | 524,286 | 255.248.0.0 | 32 |
/ 12 | 4,096 = 16个B网 | 1,048,576 | 1,048,574 | 255.240.0.0 | 16 |
/ 11 | 8,192 = 32个B网 | 2,097,152 | 2,097,150 | 255.224.0.0 | 8 |
/ 10 | 16,384 = 64个B网 | 4,194,304 | 4,194,302 | 255.192.0.0 | 4 |
/ 9 | 32,768 = 128 B网 | 8,388,608 | 8,388,606 | 255.128.0.0 | 2 |
/ 8 | 65,536 = 256 B网= 1 A网 | 16,777,216 | 16,777,214 | 255.0.0.0 | 1个 |
/ 7 | 131,072 = 2个A网 | 33,554,432 | 33,554,430 | 254.0.0.0 | 128 |
/ 6 | 262,144 = 4 A网 | 67,108,864 | 67,108,862 | 252.0.0.0 | 64 |
/ 5 | 524,888 = 8个A网 | 134,217,728 | 134,217,726 | 248.0.0.0 | 32 |
/ 4 | 1,048,576 = 16 A网 | 268,435,456 | 268,435,454 | 240.0.0.0 | 16 |
/ 3 | 2,097,152 = 32个A网 | 536,870,912 | 536,870,910 | 224.0.0.0 | 8 |
/ 2 | 4,194,304 = 64 A网 | 1,073,741,824 | 1,073,741,822 | 192.0.0.0 | 4 |
/ 1 | 8,388,608 = 128 A网 | 2,147,483,648 | 2,147,483,646 | 128.0.0.0 | 2 |
/ 0 | 16,777,216 = 256个A网 | 4,294,967,296 | 4,294,967,294 | 0.0.0.0 | 1个 |
另一个CIDR备忘单 (Another CIDR Cheat Sheet)
CIDR Total number Network Description:
Notation: of addresses: Mask:
--------------------------------------------------------------
/0 4,294,967,296 0.0.0.0 Every Address
/1 2,147,483,648 128.0.0.0 128 /8 nets
/2 1,073,741,824 192.0.0.0 64 /8 nets
/3 536,870,912 224.0.0.0 32 /8 nets
/4 268,435,456 240.0.0.0 16 /8 nets
/5 134,217,728 248.0.0.0 8 /8 nets
/6 67,108,864 252.0.0.0 4 /8 nets
/7 33,554,432 254.0.0.0 2 /8 nets
/8 16,777,214 255.0.0.0 1 /8 net (Class A)
--------------------------------------------------------------
/9 8,388,608 255.128.0.0 128 /16 nets
/10 4,194,304 255.192.0.0 64 /16 nets
/11 2,097,152 255.224.0.0 32 /16 nets
/12 1,048,576 255.240.0.0 16 /16 nets
/13 524,288 255.248.0.0 8 /16 nets
/14 262,144 255.252.0.0 4 /16 nets
/15 131.072 255.254.0.0 2 /16 nets
/16 65,536 255.255.0.0 1 /16 (Class B)
--------------------------------------------------------------
/17 32,768 255.255.128.0 128 /24 nets
/19 16,384 255.255.192.0 64 /24 nets
/19 8,192 255.255.224.0 32 /24 nets
/20 4,096 255.255.240.0 16 /24 nets
/21 2,048 255.255.248.0 8 /24 nets
/22 1,024 255.255.252.0 4 /24 nets
/23 512 255.255.254.0 2 /24 nets
/24 256 255.255.255.0 1 /24 (Class C)
--------------------------------------------------------------
/25 128 255.255.255.128 Half of a /24
/26 64 255.255.255.192 Fourth of a /24
/27 32 255.255.255.224 Eighth of a /24
/28 16 255.255.255.240 1/16th of a /24
/29 8 255.255.255.248 5 Usable addresses
/30 4 255.255.255.252 1 Usable address
/31 2 255.255.255.254 Unusable
/32 1 255.255.255.255 Single host
--------------------------------------------------------------
Reserved Space:
0.0.0.0/8
127.0.0.0/8
192.0.2.0/24
10.0.0.0/8
172.16.0.0/12
192.168.0.0/16
169.254.0.0/16
翻译自: https://www.poftut.com/network-classless-inter-domain-routing-cidr-cheat-sheet/
无类域间路由cidr