计算 subnets and address ranges
Divide 网络为 subnets using CIDR notation. Calculate 网络 address, 广播, 主机范围, 和可用主机数量.
- 1
subnet 是 defined 通过 IP address 和 prefix 长度 (CIDR, e.g., 192.168.1.0/24). prefix determines 网络/主机边界: /24 means 第一 24 bits 是网络, 最后 8 是 hosts. 网络 address 有所有主机 bits as 0; 广播有 所有主机 bits as 1; usable hosts 是在 之间.
- 2 IP 信息查询器 →
Enter IP address 具有 CIDR prefix (e.g., 192.168.1.0/24) 到 see 网络 address, 广播 address, 主机范围, 和数字的 usable hosts. 此是 必要为 网络规划和 firewall 配置.
- 3 高精度计算器 →
计算 the number of usable hosts: 2^(32-prefix) - 2 (subtract network and broadcast). For /24: 2^8 - 2 = 254 hosts. For /30: 2^2 - 2 = 2 hosts (point-to-point link). For /31: 2 hosts (RFC 3021, no broadcast).
常见问题
- 什么是 CIDR notation?
- Classless Inter-Domain Routing notation: IP/prefix, e.g., 192.168.1.0/24. prefix (0-32 为 IPv4, 0-128 为 IPv6) specifies 数字的 网络 bits. 它 replaced classful 系统 (, B, C) 哪个 wasted addresses 通过 fixing 网络/主机边界.
- 为什么 subtract 2 从主机数量?
- 第一 address (所有主机 bits 0) 是网络 address, 和最后 (所有主机 bits 1) 是广播 address. 都不能够是 assigned 到主机. 为 /24: 256 - 2 = 254 usable hosts. /31 (RFC 3021) 和 /32 是 exceptions.