Prefer IPv4 over IPv6 on Windows

Use the following commands to change the preference on Windows to use IPv4 over IPv6.

netsh interface ipv6 set prefix ::/96 60 3
netsh interface ipv6 set prefix ::ffff:0:0/96 55 4

Confirm the precedence has changed with the following command:

netsh interface ipv6 show prefixpolicies

To make this permanent across reboots, issue the following command:

reg.exe add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters /v DisabledComponents /t REG_DWORD /d 0x20 /f

You can revert back to the default value by substituting 0x20 with 0x00 in the above command. For reference, here are the possible values.

IPv6 FunctionalityDisabledComponents registry value
Disable IPv6 protocol0xFF
Prefer IPv4 over IPv60x20
Disable IPv6 on all nontunnel interfaces0x10
Disable IPv6 on all tunnel interfaces0x01
Disable IPv6 on all nontunnel interfaces (except the loopback) and on IPv6 tunnel interface0x11
Default value0x00

Leave a Reply

Your email address will not be published. Required fields are marked *