Calculate subnet information, divide networks into subnets, and plan IP address allocation.
Calculate subnet information, divide networks into subnets, and plan IP address allocation.
计算子网信息、将网络划分为子网并规划 IP 地址分配。
本页提供关于子网计算的原创、经人工审校的内容,解释 CIDR 表示法、网络与广播地址、可用主机范围,以及如何规划互不重叠的子网。
子网划分是把一个网络分割成更小、更易管理的子网的做法,有助于更好的组织、更强的安全性和更高效的 IP 地址利用。
隔离不同的网段并控制它们之间的流量。
按部门、功能或位置对设备进行逻辑分组。
更小的广播域意味着更少的网络拥塞。
根据实际需求更高效地分配 IP 地址。
CIDR(无类别域间路由)表示法用于描述 IP 网络,斜杠(/)后的数字表示网络部分占用的位数。
| CIDR | 子网掩码 | 每子网主机数 | 可用主机 |
|---|---|---|---|
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /28 | 255.255.255.240 | 16 | 14 |
| /30 | 255.255.255.252 | 4 | 2 |
理解二进制有助于直观了解子网划分的原理:
Proper network planning ensures efficient use of IP space and allows for future growth.
确定你需要多少个子网以及每个子网需要多少主机。
始终为子网和主机预留至少 25-50% 的增长空间。
选择能提供足够地址且不浪费的 CIDR。
详细记录你的子网分配和用途。
Here are some real-world subnetting scenarios and solutions.
场景: You have a 192.168.1.0/24 network and need 4 subnets for different departments.
解决方案: Use /26 subnetting (4 subnets, 62 hosts each)
场景: You need to connect routers with point-to-point links using minimal IP addresses.
解决方案: Use /30 subnetting (2 usable hosts per subnet)
场景: Different departments need different numbers of hosts.
解决方案: Use different subnet sizes based on requirements