Windows PowerShell:- Disable IPv6 and Tunneling with a simple command
In PowerShell, you are able to disable IPv6 on a Server using a single command as follows:
- reg add hklm\system\currentcontrolset\services\tcpip6\parameters /v DisabledComponents /t REG_DWORD /d 0xFF /f
Now you can take this a step further and also disable IPv6 tunneling as well and will explain why shortly:
- Get-NetAdapterBinding -ComponentID “ms_tcpip6” | disable-NetAdapterBinding -ComponentID “ms_tcpip6” –PassThru
The reason you disable tunneling is because some of the malware encountered, makes use of this and tunnels to IPv4 to get out.
Once you have run both commands then you need to reboot the server.
You will notice now on the adapter settings in control panel the tick is gone next to IPv6.
Just remember that you shouldn’t un-tick IPv6 from the adapter itself as it will “break” the server.
Hope it helps.