一些用户可能会使用静态IPv6地址进行http请求,而其他用户则不会。
看看我正在发布的机器的主要接口上的一些IPv6地址:
C:\>netsh interface ipv6 show address interface=4 level=normal
Querying active state...
Interface 4: Local Area Connection
Addr Type DAD State Valid Life Pref. Life Address
--------- ---------- ------------ ------------ -----------------------------
[...]
Temporary Preferred 23h59m47s 3h59m47s 2001:4830:16c0:0:f51c:8f47:26ff:596b
Temporary Deprecated 23h59m47s 0s 2001:4830:16c0:0:8d09:1a8:6039:548b
Temporary Deprecated 23h59m47s 0s 2001:4830:16c0:0:954b:fd2d:6528:a6b2
Temporary Deprecated 23h59m47s 0s 2001:4830:16c0:0:4c27:9415:e1cc:5a5a
Temporary Deprecated 23h59m47s 0s 2001:4830:16c0:0:951f:b93:b21e:1d97
Temporary Deprecated 23h59m47s 0s 2001:4830:16c0:0:59c3:d575:189e:4fbb
Temporary Deprecated 6h32m45s 0s 2001:4830:16c0:0:f838:1133:38d0:894c
Public Preferred 23h59m47s 3h59m47s 2001:4830:16c0:0:20b:dbff:fe26:9fc5
Link Preferred infinite infinite fe80::20b:dbff:fe26:9fc5
No entries were found.
我省略了一些其他的地址,这些地址只会让人更加困惑。
请注意,除了“Link”地址之外,还有一个“Public”地址和一堆“Temporary”地址(其中大多数是“已弃用”的)。
“Link”地址只是接口的本地链接地址,用于各种本地管理通信。 (顾名思义,它只能用于与同一“链路”上的其他主机通信;它不能用于需要路由的流量中。)
naesten@hydrogen:~% ipv6calc -i fe80::20b:dbff:fe26:9fc5 2>/dev/null
Address type: unicast, link-local
Registry for address: reserved
Interface identifier: 020b:dbff:fe26:9fc5
EUI-48/MAC address: 00:0b:db:26:9f:c5
MAC is a global unique one
MAC is an unicast one
OUI is: Dell ESG PCBA Test
正如您所看到的,该地址的接口标识符(右侧64位)直接基于接口的MAC地址。
其他显示的地址恰好来自我提供的sixxs子网2001:4830:16c0::/48
,但不幸的是它们现在无法使用,因为POD已经关闭。
"Public"地址只需将前缀与链路本地地址中相同的接口标识符连接在一起,这应该不足为奇(考虑到名称),因为这是服务器和长时间运行的点对点程序通常侦听的地址。
那么这些"Temporary"地址呢?
现在是令人困惑的部分:所有这些其他地址是什么,它们从哪里来?
答案可以在RFC 4941 - IPv6无状态地址自动配置的隐私扩展中找到。你看,事实证明,在你的IP地址中永久使用相同的接口标识符使得对手“关联看似无关的活动”变得非常容易(省去了“跟踪cookie”的需要,并允许以后独立收集的数据进行组合)。
解决方案是为大多数通信使用临时IPv6地址。在任何给定时间,其中一个是“首选”地址,用于新的通信,其他一些地址是“有效”的但不是“首选”的,因此当到达切换到新的“首选”地址的时候,正在进行的通信不会受到不必要的干扰。没有地址保持“首选”或“有效”的时间超过TEMP_VALID_LIFETIME
或TEMP_PREFERRED_LIFETIME
。
特别是,第5节建立了以下默认值,这显然与我们在这里看到的一致:
TEMP_VALID_LIFETIME -- Default value: 1 week. Users should be able
to override the default value.
TEMP_PREFERRED_LIFETIME -- Default value: 1 day. Users should be
able to override the default value.