CIDR 計算器
計算 CIDR 網段的詳細資訊
192.168.1.0/24
10.0.0.0/8
172.16.0.0/12
192.168.0.0/16
Frequently Asked Questions
What is CIDR notation?
CIDR represents an IP range using a base IP and prefix length, like 192.168.1.0/24, where /24 means the first 24 bits are the network portion.
How to calculate hosts in a CIDR block?
For a /N prefix, usable hosts = 2^(32-N) - 2. For /24 that is 254 usable hosts.
CIDR vs subnet mask?
They represent the same thing differently. /24 equals 255.255.255.0. CIDR is more compact and modern.
What is a supernet and how does it relate to CIDR?
A supernet combines multiple smaller networks into one larger CIDR block. For example, two /24 networks can be summarized as a single /23 supernet, simplifying routing tables.
How do I convert a subnet mask to CIDR notation?
Count the consecutive 1-bits in the binary subnet mask. For example, 255.255.240.0 = 11111111.11111111.11110000.00000000, which has 20 ones, so the CIDR notation is /20.
CIDR 快速參考表
| CIDR | 子網遮罩 | IP 數量 | 可用主機 |
|---|---|---|---|
| /32 | 255.255.255.255 | 1 | 1 |
| /30 | 255.255.255.252 | 4 | 2 |
| /28 | 255.255.255.240 | 16 | 14 |
| /24 | 255.255.255.0 | 256 | 254 |
| /20 | 255.255.240.0 | 4,096 | 4,094 |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
| /12 | 255.240.0.0 | 1,048,576 | 1,048,574 |
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 |
什麼是 CIDR?
CIDR(Classless Inter-Domain Routing,無類別域間路由)是一種 IP 位址分配和路由方法,使用可變長度子網遮罩取代傳統的 A、B、C 類別。
表示法:CIDR 使用斜線表示法,如 192.168.1.0/24,其中 /24 表示前 24 位元是網路部分。
優點:更靈活的 IP 分配、減少路由表大小、更有效利用 IP 位址空間。