[!note] 本文档由 DeepSeek 总结并生成
要让 Windows 所有网络连接(包括 ping
、浏览器、游戏等)优先使用 IPv6,请按以下步骤操作:
或者使用 一键提升优先级脚本
以管理员身份运行 CMD/PowerShell,执行:
netsh interface ipv6 set prefixpolicy ::/0 100 0 persistent
netsh interface ipv6 set prefixpolicy ::ffff:0:0/96 40 1 persistent
netsh interface ipv6 set global randomizeidentifiers=disabled
netsh interface ipv6 set global randomizeidentifiers=enabled
::/0
:代表所有 IPv6 地址,优先级设为 100(最高)::ffff:0:0/96
:代表 IPv4 映射地址,优先级设为 40(低于 IPv6)netsh interface ipv6 show prefixpolicies
::/0
的 Precedence 为 100,且排在 ::ffff:0:0/96
之前。可以在 终端App
中依次运行以下命令检测连接情况:
Win + R
→ cmd
→ 回车) ping api.spotify.com
ping accounts.spotify.com
如果无需 -6
参数即可 ping 通 IPv6,则证明已经完成设置
nslookup spotify.com
ping
和 curl
ping api.spotify.com # 应返回 IPv6 地址
curl -v https://api.spotify.com # 应使用 IPv6 连接
ping
仍然走 IPv4?ipconfig /flushdns
)。netsh interface ipv6 reset