0x00 前言

在配置一些网络环境的时候,我们想要对内网保留地址进行处理,但是有时候记不住哪些属于内网 IP 段,特此记录。

仅记录 IPv4 相关的 IP 段

0x01 常见内网 IP 段

10.0.0.0/8
10.0.0.0 - 10.255.255.255

172.16.0.0/12
172.16.0.0 - 172.31.255.255

192.168.0.0/16
192.168.0.0 - 192.168.255.255

来源:Address Allocation for Private Internets - IETF

0x02 其他保留 IP 段

但是根据 《Reserved IP addresses - Wikipedia, the free encyclopedia》 及《RFC 6890 - Special-Purpose IP Address Registries》的描述, 还有很多其它的内网IP段(包括IPv6),以及其它用途的保留IP地址。

0.0.0.0/8
0.0.0.0 - 0.255.255.255
用于当前网络内的广播消息。

100.64.0.0/10
100.64.0.0 - 100.127.255.255
由运营商使用的私网IP段,随着IPv4地址池的耗光,会有更多用户被分配到这个网段。

127.0.0.0/8
127.0.0.0 - 127.255.255.255
本机回环地址。

169.254.0.0/16
169.254.0.0 - 169.254.255.255
获取不到IP地址时使用,通常因为从DHCP服务器获取不到IP。

192.0.0.0/24
192.0.0.0 - 192.0.0.255
一般用户不可能被分配到这个IP段。
Used for the IANA IPv4 Special Purpose Address Registry as specified by RFC 5736

192.0.2.0/24
192.0.2.0 - 192.0.2.255
一般用户不可能被分配到这个IP段。
Assigned as “TEST-NET” in RFC 5737 for use solely in documentation and example source code and should not be used publicly.

198.18.0.0/15
198.18.0.0 - 198.19.255.255
一般用户不可能被分配到这个IP段。
用于测试两个独立子网的网间通信。

198.51.100.0/24
198.51.100.0 - 198.51.100.255
一般用户不可能被分配到这个IP段。
Assigned as “TEST-NET-2” in RFC 5737 for use solely in documentation and example source code and should not be used publicly.

203.0.113.0/24
203.0.113.0 - 203.0.113.255
一般用户不可能被分配到这个IP段。
Assigned as “TEST-NET-3” in RFC 5737 for use solely in documentation and example source code and should not be used publicly.

255.255.255.255/32
255.255.255.255
本网段的广播地址。

0x03 Reference

内网IP段有哪些 - 看看俺

保留IP地址 - Wiki Pedia