参考链接:为高级用户配置 IPv6 – Windows Server | Microsoft Learn
首先要添加注册表,不然会出错。
PS C:\Windows\system32> reg query HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters /v DisabledComponents
错误: 系统找不到指定的注册表项或值。
PS C:\Windows\system32> reg add “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters” /v DisabledComponents /t REG_DWORD /d 0xFF /f
操作成功完成。
PS C:\Windows\system32> reg query HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters /v DisabledComponents
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters
DisabledComponents REG_DWORD 0xff
DisableComponents 值定义:
0,启用所有 IPv 6 组件,默认设置
0xff,禁用所有 IPv 6 组件, 除 IPv 6 环回接口
0x20,以前缀策略中使用 IPv 4 而不是 IPv 6
0x10,禁用本机 IPv 6 接口
0x01,禁用所有隧道 IPv 6 接口
0x11,禁用除用于 IPv 6 环回接口所有 IPv 6 接口