When testing an Always On VPN connection, the administrator may encounter a scenario where the VPN client fails to connect to the VPN server. On the Windows 10 client the error message states the following.
“Can’t connect to [connection name]. The network connection between your computer and the VPN server could not be established because the remote server is not responding. This could be because one of the network devices (e.g. firewalls, NAT, routers, etc.) between your computer and the remote server is not configured to allow VPN connections. Please contact your Administrator or your service provider to determine which device may be causing the problem.”
In addition, the Application event log records an error message with Event ID 20227 from the RasClient source. The error message states the following.
“The User [username] dialed a connection named [connection name] with has failed. The error code returned on failure is 809.”
Connection Timeout
The error code 809 indicates a VPN timeout, meaning the VPN server failed to respond. Often this is related directly to network connectivity, but sometimes other factors can come in to play.
Troubleshooting VPN Error Code 809
When troubleshooting VPN error code 809 the following items should be carefully checked.
- Name Resolution – Ensure the VPN server’s public hostname resolves to the correct IP address.
- Firewall Configuration – Confirm the edge firewall is configured properly. Inbound TCP port 443 is required for the Secure Socket Tunneling Protocol (SSTP) and inbound UDP ports 500 and 4500 are required for the Internet Key Exchange version 2 (IKEv2) protocol. Make sure that any NAT rules are forwarding traffic to the correct server.
- Load Balancer Configuration – If VPN servers are located behind a load balancer, make certain that virtual IP address and ports are configured correctly and that health checks are passing. For IKEv2 specifically, it is crucial that UDP ports 500 and 4500 be delivered to the same backend server. This commonly requires custom configuration. For example, on the KEMP LoadMaster the administrator will configure “port following”. On the F5 BIG-IP a custom “persistence profile” must be configured. On the Citrix NetScaler a “persistency group” must be defined.
IKEv2 Fragmentation
VPN error code 809 can also be caused by IKE fragmentation when using the IKEv2 VPN protocol. During IKEv2 connection establishment, payload sizes may exceed the IP Maximum Transmission Unit (MTU) for the network path between the client and server. This causes the IP packets to be fragmented. However, it is not uncommon for intermediary devices (routers, NAT devices, or firewalls) to block IP fragments. When this occurs, a VPN connection cannot be established. However, looking at a network trace of the connection attempt, the administrator will see that the connection begins but subsequently fails.
Enable IKEv2 Fragmentation Support
The IKEv2 protocol includes support for fragmenting packets at the IKE layer. This eliminates the need for fragmenting packets at the IP layer. IKEv2 fragmentation must be configured on both the client and server.
Client
IKEv2 fragmentation was introduced in Windows 10 1803 and is enabled by default. No client-side configuration is required.
Server
IKEv2 is commonly supported on many firewall and VPN devices. Consult the vendor’s documentation for configuration guidance. For Windows Server Routing and Remote Access (RRAS) servers, IKEv2 fragmentation was introduced in Windows Server 1803 and is also supported in Windows Server 2019. It is enabled via a registry key. The following PowerShell command can be used to enable IKEv2 fragmentation on supported servers.
New-ItemProperty -Path “HKLM:\SYSTEM\CurrentControlSet\Services\RemoteAccess\Parameters\Ikev2\” -Name EnableServerFragmentation -PropertyType DWORD -Value 1 -Force
Validation
Once IKEv2 fragmentation is configured on the VPN server, a network capture will reveal the IKE_SA_INIT packet now includes the IKEV2_FRAGMENTATION_SUPPORTED notification message.
Additional Information
Windows 10 Always On VPN and IKEv2 Fragmentation
gatorcritfcorg
/ August 23, 2019Your fix appears to have fixed the very frustrating problem I was having with IKEv2 on a W2016 VPN proof of concept I am testing. It worked internally, but failed from the i-net. I could see port 500 traffic coming across the firewall, but no 4500, a real head scratcher and time waster. And then I came upon this IKE fragmentation article, which offered a way forward from a highly qualified source no less. I proceeded to download a copy of W2019, configure it as a VPN server and walla! Connected. Thank you very much!
Richard M. Hicks
/ August 24, 2019Another satisfied customer! Glad I was able to help. 🙂
ivarson
/ September 18, 2019Whatever we’re looking for regarding Microsoft VPN, we always end up here. Great articles!
Richard M. Hicks
/ September 18, 2019Great to hear! Thanks for visiting! 🙂
Matt
/ November 1, 2019Richard – Thank you for always providing amazing articles on DirectAccess/Always On VPN.
We were battling with the IKEv2 Fragmentation issue for a while. I regularly checked your site for new information on the issue and as I hoped you have provided a solution!
Richard M. Hicks
/ November 1, 2019My pleasure! 😁
Russell Cozens (@RJCozens)
/ November 3, 2019I had these exact symptoms but it was the “Xbox Live Networking Service” that caused the problem. Stopping it allowed me to connect,