跳转到内容

专用网络

本页使用了标题或全文手工转换
维基百科,自由的百科全书

互联网的地址架构中,专用网络是指遵守 RFC 1918 (针对 IPv4 网络)和 RFC 4193 (针对 IPv6 网络)规范,使用专用IP地址空间的网络。私有 IP 无法直接连接互联网,需要使用网络地址转换(Network Address Translator,NAT)或者代理服务器(Proxy Server)来实现。与公网 IP 相比,私有 IP 是免费的,同时节省了 IP 地址资源,适合在局域网使用。

用途

[编辑]
  • 私有IP无法直接被互联网所访问,因此,相对于公网IP地址,它更加安全。
  • 私有IP常被用于家庭,学校和企业的局域网

IPv4 私有地址

[编辑]

IPv4 的私有IP定义在 RFC 1918

RFC1918 规定区块名 IP地址区段 IP数量 分类网络 说明 最大CIDR区块 (子网掩码 主机端位长
24位区块 10.0.0.0 – 10.255.255.255 16,777,216 单个A类网络 10.0.0.0/8 (255.0.0.0) 24位
20位元区块 172.16.0.0 – 172.31.255.255 1,048,576 16个连续B类网络 172.16.0.0/12 (255.240.0.0) 20位元
16位区块 192.168.0.0 – 192.168.255.255 65,536 256个连续C类网络 192.168.0.0/16 (255.255.0.0) 16位

共享地址

[编辑]

Shared Address Space(RFC 6598), IANA 于 2012 年将 100.64.0.0/10 定义用于运营商级 NAT ( Carrier-Grade NAT, CGN )场景。这些地址与 RFC1918 中定义的私有 IP 是不同的,只能用于运营商的内部网络,虽然在某些特性中与私有 IP 相同,但在定义上不能划为私有地址(更不是公用地址)。

IPv6 私有地址

[编辑]

IPv6的私有IP定义在 RFC 4193 , 地址块 fc00::/7 已保留。这些地址称为唯一本地地址( Unique Local Addresses, ULA )。它们被定义为单播地址,并在路由前缀中包含一个 40 位的随机数,以防止在两个私有网络互连时发生冲突。

根据 RFC 4193 第三章第二节,第 8 位设计为“ L 位”。其二进制值为 1 时授权予本地分配,为 0 时的作用暂未定义。[1]故而造成“唯一本地地址 RFC 定义是 fc00::/7 范围,但网络硬件生产厂商都设计其路由系统的唯一本地地址都在 fd00::/8 范围内”的现象。

地址快 前缀 L 位 全局路由 ID 子网 ID 接口 ID 可用地址数量
fc00::/7 7 位 1 位 40 位 16 位 64 位 2121
fc00::/8 f c xx:xxxx:xxxx :yyyy :zzzz:zzzz:zzzz:zzzz 2120
fd00::/8 f d xx:xxxx:xxxx :yyyy :zzzz:zzzz:zzzz:zzzz 2120

尽管在本地使用,但唯一本地地址的 IPv6 地址范围是全局的。

链路本地地址

[编辑]

RFC的定义参考

[编辑]
  • RFC 1918"Address Allocation for Private Internets"
  • RFC 2036"Observations on the use of Components of the Class A Address Space within the Internet"
  • RFC 2050"Internet Registry IP Allocation Guidelines"
  • RFC 2101"IPv4 Address Behaviour Today"
  • RFC 2663"IP Network Address Translator (NAT) Terminology and Considerations"
  • RFC 3022"Traditional IP Network Address Translator (Traditional NAT)"
  • RFC 3330"Special-Use IPv4 Addresses" (superseded)
  • RFC 5735"Special-Use IPv4 Addresses"
  • RFC 3879"Deprecating Site Local Addresses"
  • RFC 3927"Dynamic Configuration of IPv4 Link-Local Addresses"
  • RFC 4193"Unique Local IPv6 Unicast Addresses"
  • RFC 6598 - "IANA-Reserved IPv4 Prefix for Shared Address Space"
  1. ^ Set to 1 if the prefix is locally assigned. Set to 0 may be defined in the future. RFC 4193 Section 3.1