I encountered a strange issue in Windows 10 when all VPN connections suddenly stopped working with the following error message:
Can’t connect to VPN A connection to the remote computer could not be established. You might need to change the network settings for this connection.
I use a built-in Windows VPN client to connect. On the neighboring device, the VPN connection with the same settings works fine, so the problem is not with the remote VPN host.
There is a VPN error 720 in the Application log of Event Viewer:
EventID: 20227 Source: RasClient The user dialed a connection named VPN which has failed. The error code returned on failure is 720.
The basic recommendation in such cases is to reset the TCP/IP stack and network adapter settings on your computer with the following commands:
netsh winsock reset
netsh int ip reset
ipconfig /release
ipconfig /renew
ipconfig /flushdns
The connection may be blocked by Windows Firewall rules or a third-party antivirus/firewall (try to disable them for some time).
Make sure that Windows doesn’t use WinHTTP proxy to access the Internet.
netsh winhttp show proxy
Current WinHTTP proxy settings: Direct access (no proxy server).
In this example, a direct connection is used.
If you want to reset proxy settings, run the command below:
netsh winhttp reset proxy
In my case, I was not able to connect to VPN after doing it.
Then try to reinstall the WAN Miniports virtual adapters in the Device Manager.
- Open the Device Manager (
devmgmt.msc
), expand the Network Adapters section, and uninstall all devices with the name WAN Miniport; - For example, select WAN Miniport (SSTP), right-click it, and select Uninstall Device in the context menu;
- Move on to the next WAN Miniport device. You need to remove all devices:
- WAN Miniport (PPTP)
- WAN Miniport (PPPOE)
- WAN Miniport (Network Monitor)
- WAN Miniport (L2TP)
- WAN Miniport (IPv6)
- WAN Miniport (IP)
- WAN Miniport (IKEv2)
- Then rescan your hardware configuration (Action -> Scan for Hardware changes), and wait till Windows detects and installs drivers for WAN Miniport devices;
- After all WAN Miniports have been reinstalled, check your VPN connection. It should work.
SFC /scannow
DISM /Online /Cleanup-Image /CheckHealth
You can use PowerShell to diagnose any WAN Miniports issues.
Make sure that all protocols are enabled for a network adapter (Enabled=True
), and there are no third-party drivers among your filtering drivers (they can be added by your antivirus software).
$adapter=Get-NetAdapter -IncludeHidden | Where-Object {$_.InterfaceDescription -eq "WAN Miniport (PPTP)"}
Get-NetAdapterBinding -Name $adapter.name -IncludeHidden –AllBindings
You can enable/disable a filtering driver with the command:
Enable-NetAdapterBinding -Name $adapter.name -IncludeHidden -AllBindings -ComponentID ms_wanarp