Troubleshooting Always On VPN Error Code 809

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.”

Always On VPN and IKEv2 Fragmentation

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.”

Troubleshooting Always On VPN Error Code 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.

Troubleshooting Always On VPN Error Code 809

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.

Always On VPN and IKEv2 Fragmentation

Additional Information

Windows 10 Always On VPN and IKEv2 Fragmentation

Windows 10 Always On VPN IKEv2 Security Configuration

Windows 10 Always On VPN Hands-On Training Classes

Leave a comment

23 Comments

  1. gatorcritfcorg

     /  August 23, 2019

    Your 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!

    Reply
  2. Whatever we’re looking for regarding Microsoft VPN, we always end up here. Great articles!

    Reply
  3. Matt

     /  November 1, 2019

    Richard – 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!

    Reply
  4. I had these exact symptoms but it was the “Xbox Live Networking Service” that caused the problem. Stopping it allowed me to connect,

    Reply
  5. Abe

     /  December 6, 2019

    I’ve also ran into this error and it’s ended up being the workstations Internet connection. I often test the VPN using my Samsung S8 Verizon hot spot and occasionally I get the 809 error. Usually rebooting my phone resolves it, or just waiting for Verizon to fix their network problems.Thanks Richard, all of your articles are always AMAZING.

    Reply
  6. Gustav

     /  March 17, 2020

    Hello VPN-master Rickard! Thank you for your blog and all the help that we’ve been getting thanks to it.

    We’re running a Windows Server 2019 RAS / AOV solution that’s been working for a while. Recently we had to change IP-scope to a bigger one and after that we’re seeing some strange issues.

    I found this blog when I was searching on Rasclient event ID 20227 + failure 809. We’re seeing the exact symptoms although IKEv2 Fragmentation is activated on server (and by default on Win 10 1909 clients). I just wanted to double check with you that we actually have IKEv2 Fragmentation issues:

    1. Network capture from client shows one frame sent to RAS without “IKEV2_FRAGMENTATION_SUPPORTED”.
    2. Network capture from RAS shows three identical frames without “IKEV2_FRAGMENTATION_SUPPORTED”.

    Does this mean that IKEV2_Fragmentation isn’t working?

    Thanks in advance!

    Reply
    • That’s unusual. During the initial IKEv2 handshake your client should indicate it supports IKEv2 fragmentation. If it doesn’t do that, it must be disabled. How that happened I have no idea because it is supposed to be enabled by default. Check that registry key on the client and make sure it wasn’t somehow disabled that way.

      Reply
      • Gustav

         /  March 19, 2020

        Thanks for answering! Yes, it’s really strange. And the timing for unusual VPN-problems is far from the best..

        When comparing route print on previous working config with current I found that we were missing a default route to gateway on public facing interface. After adding it (as persistant) I can see more IKE-responds from RAS. Also new traffic on protocol TEREDO “Tunneling IPv6 over UDP through NATs, Malformed Packet”. And client failure 809 is gone!
        route add -p 0.0.0.0 mask 0.0.0.0 if

        Now we’re moving on to new error, failure 812 but I’ve already found your other threads regarding that and started investigating problems with our NPS.

        Thank you for this (almost lifesaving) site and all the times you’ve helped us since we deployed Windows Server 2019 VPN + AOV.

        Have a great day Rickard!

  7. Paddy Berger

     /  April 29, 2020

    Hi Richard, I have a weird problem which I have now noticed a few times and wanted to know if you have come across this. I have a fully working aovpn solution across two sites, I have noticed that you can be working on the vpn but then all of a sudden no user can reconnect and they get the error 809/network connection between computer and vpn could not be established. A reboot of the server and all start to connect again. This has happened on both sites I have and not sure what the underlying issue maybe. It is random in that the connection could be stable for days and then stop accepting connections.

    Any ideas?

    Reply
    • Paddy Berger

       /  April 29, 2020

      Also to add, this wont happen to both sites at the same time, so we can still failover and work normally on the other vpn server if one seems to stop accepting connections.

      Reply
    • What VPN protocol are you using? And are the servers in each site behind a load balancer?

      Reply
      • Paddy Berger

         /  April 30, 2020

        I am using IKEv2 for both device and user tunnel. Setup is domain name to azure traffic manager to either domain name site, which then sends the connection traffic to citrix NetScaler and then to the vpn server. Same setup for both sites.

      • The issue has to do with the way your load balancer is configured. It is most likely performing NAT, which causes a problem for IKEv2. Best way to resolve it is to configure the NetScaler to pass the client’s original IP address to the VPN server. Details here: https://directaccess.richardhicks.com/2020/04/13/always-on-vpn-ikev2-load-balancing-and-nat/.

        If for some reason you can’t make this change, consider implementing the registry entry in the above referenced post.

  8. My solution was this:
    https://support.microsoft.com/en-us/help/926179/how-to-configure-an-l2tp-ipsec-server-behind-a-nat-t-device-in-windows

    Windows 10 Client
    Windows 2019 Server for RRAS on private IP (single-NIC)
    Firewall: PFsense

    Reply
  9. Gustav

     /  May 13, 2020

    Hello Mr Hicks and thank you for this much well-needed blog.

    My organization is having some problems with AOV and event ID 20227 error code 809. We have ~70 locations spread around the country with different ISP’s but identical Cisco network devices. AOV works for every site except one..

    When running Network Monitor capture we can see that requests from this site is reaching the RAS, three IKE_SA_INIT with Flags = Initiator but there’s no Flags = Responder coming from the RAS back to the client as we can see with all other connection requests from other sites.

    Client hardware/OS (Windows 10 1909) is identical on all sites. RAS running Windows Server 2019.

    EnableServerFragmentation registry key on RAS (although we’re not seeing IKEV2_FRAGMENTATION_SUPPORTED in packets using

    Microsoft Network Monitor 3.4, neither on successfull or failed connection attempts)

    UDP port 500/4500 should be open everywhere

    Tried AssumeUDPEncapsulationContextOnSendRule (not needed on all other working clients/sites)

    Xbox Live Networking Services is not existing in Services on clients

    Do you have any idea why our RAS isn’t sending any IKE_SA_INIT with Flags = Responder to one of our 70 sites?

    Reply
    • As long as the server is running Windows Server 2019 and the registry key is in place it should work. If you aren’t seeing the server respond with IKEV2_FRAGMENTATION_SUPPORTED I’d assume the registry key is misconfigured or missing entirely, or the server is not Windows Server 2019.

      Reply
      • Gustav

         /  May 14, 2020

        Thanks for answering Richard!

        RAS is running Windows Server 2019 version 1809 (OS Build 17763.107).

        Registry key is triple checked:
        HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RemoteAccess\Parameters\IKEV2\EnableServerFragmentation
        DWORD = 1

        We’ve checked alot of IKE_SA_INIT packets (both successful and the ones resulting in 809) and there’s no “IKEV2_FRAGMENTATION_SUPPORTED” when checking with Microsoft Network Monitor 3.4. Which program do you use?

        But the fact that we have 69 working sites with a total of around 600 devices tells me IKEV2 Fragmentation actually works. What are the odds that only one of 70 ISP’s block IP fragments?

        Is it possible to see some log or something why RAS just seems to drop the Initiator packets that it’s receiving from this specific site?

      • IKEv2 is support in Windows Server 1803 and later, so you should be good there. Quite unusual that you won’t see the server respond with IKE fragmentation support indicated in the initial handshake though. I don’t have an answer for you why that’s happening. I use Wireshark, but Network Monitor should work as well. Are you taking the trace from the client or the server? I’d suggest doing both at the same time and comparing. If it is fragmentation-related you’ll see the server respond but the client won’t see it.

  1. Always On VPN IKEv2 Load Balancing Issue with Kemp LoadMaster | Richard M. Hicks Consulting, Inc.
  2. Kemp Loadmaster Config for Windows Always on VPN with IKEv2 – Deviousweb

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: