V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
There is no place like ::1
Livid
270.9D
573.22D
V2EX  ›  IPv6

macOS 在通过 DHCPv6 获得 IPv6 之后会拿到多个地址的原因

  •  
  •   Livid ·
    PRO
    · May 12, 2018 · 7125 views
    This topic created in 2917 days ago, the information mentioned may be changed or developed.

    Privacy Extensions for Stateless Address Autoconfiguration in IPv6

    https://tools.ietf.org/html/rfc4941

    通过 DHCPv6 获得 IPv6 地址之后,如果运行 ifconfig -a,那么会看到三个 inet6 地址,除了 fe80 开头的 link-local 地址之外,还有这两个:

    • autoconf secured
    • autoconf temporary

    如果这时候访问类似 bgp.he.net 之类的可以看到自己 IPv6 地址的服务,那么会看到的是 autoconf temporary 地址,而且这个地址会经常变化。这是 RFC4941 里定义了的一种隐私保护机制。

    5 replies    2018-11-22 10:33:21 +08:00
    hu6360567
        1
    hu6360567  
       May 12, 2018 via Android
    DHCPv6 一般不会拿到多个 ipv6 地址,使用无状态的自动分配并启用了隐私扩展才会。其中默认的 secured 地址是根据 mac 地址计算出来的,是固定的,一般用于其他主机连接本机。隐私地址一般用于向外发起连接时使用
    Livid
        2
    Livid  
    MOD
    OP
    PRO
       May 12, 2018
    @hu6360567 谢谢。刚刚还在编辑中。编辑完之后看到你的这条回复也上来了。
    Livid
        3
    Livid  
    MOD
    OP
    PRO
       May 12, 2018
    因此,如果是在 IPv6 上要进行 IP block,那么可能很多时候至少要封一个 /64。
    dndx
        4
    dndx  
       May 19, 2018
    对的。IPv6 使用 SLAAC 才会启用 Privacy Extensions,而 SLAAC 只有在 /64 或者更大的 block 上才可以使用。如果小于 /64 则只能走 DHCPv6,这种情况下 Privacy Extensions 不会(也没有必要)启用。
    teky
        5
    teky  
       Nov 22, 2018
    SLAAC 只在 /64 启用, 其他都不行
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3330 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 70ms · UTC 12:54 · PVG 20:54 · LAX 05:54 · JFK 08:54
    ♥ Do have faith in what you're doing.