Ошибка 809 l2tp ipsec

Hello

RRS feed

  • Remove From My Forums
  • Question

  • Hello

    I have a firewall which also act as a VPN server, it works fine til last week a windows update, it suddenly failed to connect my VPN and has an error code 809

    but my android and other PC running windows 7’s connection on same VPN are working normally,

    I edit regedit prodile to add a policy to let VPN work behind NAT, shutdown windows firewall and antivirus software and still no go, 

    but another VPN use PPTP works well, anyone has any idea? many thanks.   

All replies

  • Hi
    alotofjeff,

    >>I edit regedit prodile to add a policy to let VPN work behind NAT

    Please try to recreate a new connect and reset the following regedit.

    1.Using Registry Editor, create a new DWORD value called «AssumeUDPEncapsulationContextOnSendRule» under «HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesPolicyAgent» and set it to «2»

    2.Click Start, Settings

      Choose the «Network and Internet» category

      Click the «VPN» button in the left hand menu

      Click «Add a VPN connection» and use the following:

    • VPN provider: Windows (built-in)
    • Connection Name: anything you like, this is what’s displayed in the UI
    • Server name or address: the external hostname of your VPN
    • VPN type: L2TP/IPsec
    • Type of sign-in info: Username and password
    • Username/Password/Remember me: these are optional, set as required
    • Click «Save»

      Click «Change adapter options»

      Right click the connection you just created, and click Properties

      Under the Security tab, click «Advanced Settings»

      Select «use pre-shared key» and enter the PSK, click OK

      Set «Data encryption» to «maximum strength»

      Under Authentication, select «Allow these protocols» and tick ONLY the PAP box

    At this point, if you made the registry change you will need to reboot your computer.

    3.In addition, please disable the service of Xbox Live Networking Services
    to check if the problem still occurs.

    Best Regards,

    Candy


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact
    tnmff@microsoft.com.

    • Edited by

      Tuesday, July 18, 2017 2:08 AM

  •  Set «Data encryption» to «maximum strength»

    still got error code 809

    1.Using Registry Editor, create a new DWORD value called «AssumeUDPEncapsulationContextOnSendRule»
    under «HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesPolicyAgent» and set it to «2»

    I did it in the first place, doesn’t work

    other settings are all the same as my original workable setting.

  • Hello,

    I have done all the steps above too and still cannot connect. I am attempting to connect via Pre-Shared Key.

    Any other suggestions?

Всем привет! Сегодня мы будем разбирать, из-за чего возникает 809 ошибка при подключении к интернету (или VPN) и как её исправить. Данная проблема проявляется, когда компьютер не может связаться с конечным сервером через VPN тоннель L2TP подключения. Очень часто подобную ошибку замечают клиенты провайдера Билайн. Но также данный казус может возникать при подключении к частным или рабочим VPN серверам.

На самом деле косяк этой проблемы в операционной системе Windows. Дело в том, что VPN-клиент, который подключается к туннелю, не поддерживает L2TP/IPSec через NAT. И тут проблема кроется в IPSec при использовании шифрования ESP, а, насколько мы помним, ESP не поддерживает PAT, который и работает с адресацией через NAT.

NAT – это перевод внешних адресов во внутренние и наоборот. То есть при подключении к VPN-серверу клиент не может получить свой адрес, и получается дисконект. Но может быть проблема в закрытых портах или работе некоторых программ в винде. Далее я расскажу, как решить эту проблему.

Содержание

  1. ШАГ 1: Открытие портов
  2. ШАГ 2: Создания правила реестра
  3. ШАГ 3: Изменения параметров шифрования
  4. ШАГ 4: Отключение Xbox Live
  5. Ничего не помогло?
  6. Задать вопрос автору статьи

ШАГ 1: Открытие портов

В первую очередь, нам нужно открыть порты на брандмауэре, так как он может блокировать их. Смотрите, Билайн использует два типа VPN: L2TP и PPTP. PPTP используется реже,  да и ошибка при нем данная не возникает. Для L2TP мы будем открывать несколько портов: 1701, 500, 1460 и 4500.

Ок, какие порты нам нужны, мы решили. Но какой протокол? – обычно используется UDP. Но если проблема останется, то создадим подобные правила и для TCP-протокола.

  1. Перейдите в «Панель управления». В Windows 10 данный раздел можно найти в поисковой строке.

VPN ошибка 809 у Билайна: 4 способа решить проблему

  1. Переходим в раздел брандмауэра.

VPN ошибка 809 у Билайна: 4 способа решить проблему

  1. Открываем доп. параметры.

VPN ошибка 809 у Билайна: 4 способа решить проблему

  1. Кликаем ПКМ по входящим правилам и создаем одно.

VPN ошибка 809 у Билайна: 4 способа решить проблему

  1. «Для порта».

VPN ошибка 809 у Билайна: 4 способа решить проблему

  1. К сожалению, тут нельзя сразу выбрать два протокола. Сначала выделаем UDP. Ниже выделяем нижнюю галочку и вписываем порты: 1701, 500, 1460, 4500 (для L2TP). Если у вас PPTP, то указываем следующие порты: 1723, 1460, 4500.

VPN ошибка 809 у Билайна: 4 способа решить проблему

  1. Разрешаем подключение.

VPN ошибка 809 у Билайна: 4 способа решить проблему

  1. Тут оставляем все сети.

VPN ошибка 809 у Билайна: 4 способа решить проблему

  1. Обязательно введите понятное название, чтобы в случае чего можно было быстро найти и удалить правило. В описании лучше указать номера портов и тип протокола

VPN ошибка 809 у Билайна: 4 способа решить проблему

  1. А теперь проделываем те же самые действия, но только для исходящего подключения.

VPN ошибка 809 у Билайна: 4 способа решить проблему

Если данный вариант не дал результата, то пробуем создать два аналогичных правила для входящего и исходящего подключения, но уже для TCP протокола. Если проблема осталась, то значит основа ошибки лежит именно в протоколе NAT-T –  то есть или клиент находится за NAT, или сервер.

ШАГ 2: Создания правила реестра

В IPSec используется также ESP 50 протокол. Проблема в том, что данные пакеты не поддерживаются в Windows. Но мы можем обернуть эти пакеты по 4500 порту UDP. Тогда подключение должно появиться – это можно сделать через команду в реестре.

  1. Чтобы открыть редактор реестра, вам нужно найти на клавиатуре две кнопки (может иметь значок Windows) и английскую буковку R. Нажимаем на них одновременно и вписываем команду:

regedit

VPN ошибка 809 у Билайна: 4 способа решить проблему

  1. Если вы не можете найти эти кнопки, то просто введите ту же команду в поиске.

VPN ошибка 809 у Билайна: 4 способа решить проблему

  1. Теперь нужно открыть основной каталог «HKEY_LOCAL_MACHINE» и найти там раздел «SYSTEM». Далее переходим в «CurrentControlSet» и в ней ищем «Services». В самом конце просто нажмите по подразделу «PolicyAgent», чтобы вы увидели все параметры. Нажимаем на свободное поле справа правой кнопкой мыши, выбираем «Создать» – «Параметр DWORD (32 бита)».

VPN ошибка 809 у Билайна: 4 способа решить проблему

  1. Называем параметр как:

AssumeUDPEncapsulationContextOnSendRule

VPN ошибка 809 у Билайна: 4 способа решить проблему

  1. Даем значение «2».
  2. Жмем «ОК».
  3. Перезагружаем компьютер и проверяем подключение.

ШАГ 3: Изменения параметров шифрования

Есть такой глюк, что если вы уже где-то подключались с данного аккаунта к выделенному серверу, то на винде подключиться больше нельзя. Причем на других операционных системах (Linux, iOS или Android) такое не наблюдается. Данная проблема уже достаточно старая, и в Microsoft её никак не допилят. Но можно сделать это вручную. Опять идем в реестр по пути: HKEY_LOCAL_MACHINE – SYSTEM – CurrentControlSet – Servicesтеперь находим папку «RasMan» и открываем «Parameters».

Создаем два правила DWORD:

VPN ошибка 809 у Билайна: 4 способа решить проблему

  • AllowL2TPWeakCrypto – значение один (1).
  • ProhibitIPSec – значение ноль (0).

Перезагружаемся, чтобы изменения вступили в силу. Если это не поможет, то откройте параметр «AllowL2TPWeakCrypto» и установите значение 0, чтобы выключить шифрование вообще. Опять перезагружаемся.

ШАГ 4: Отключение Xbox Live

На самом деле мы выполнили почти все, что нужно. Теперь подключение должно работать, но могут быть проблемы из-за одной службы, которая мешает подключению к серверу. Попробуем её выключить:

Через кнопки и R запускаем команду:

services.msc

Раздел «Службы» также можно запустить и через поиск.

VPN ошибка 809 у Билайна: 4 способа решить проблему

Находим «Сетевую службу Xbox Live», заходим в неё и отключаем. Перезагружаем ОС.

VPN ошибка 809 у Билайна: 4 способа решить проблему

Ничего не помогло?

В таком случае делаем комплекс мер:

  • В первую очередь обновите операционную систему. Как я уже и говорил, данная проблема чаще всего возникает на винде, поэтому обновление может решить проблему.
    • Windows 10: «Пуск» – «Параметры» – «Обновление и безопасность» – «Центр обновления Windows».
    • Windows 7: «Пуск» – «Панель управления» – «Центр обновления Windows» – кнопка «Установить обновления».
  • Если вы ранее устанавливали какие-то программы, которые работают с VPN или виртуальными сетевыми картами, то попробуйте выключить их в реестре или вообще удалить.
  • Почистите компьютер от мусора – об этом очень подробно написано тут.
  • Если проблема появилась внезапно, то можно попробовать выполнить «Восстановление системы» – через поиск или в «Панели управления» находим раздел «Восстановления» и запускаем «Восстановление системы». При этом выбираем самую раннюю точку.

Если ничего не помогает, то уже можно звонить провайдеру, возможно, проблема связана с удаленным сервером.

 Windows OS Hub / Windows 10 / Configuring L2TP/IPSec VPN Connection Behind a NAT, VPN Error Code 809

Due to disabling PPTP VPN support in iOS, one of my clients decided to reconfigure the VPN server running Windows Server 2012 R2 from PPTP to L2TP/IPSec. Internal VPN clients from inside LAN connect to the VPN server without any problems, however external Windows clients get the error 809 when trying to establish the connection with the L2TP VPN server:

Can’t connect to L2TP-IPsec-VPN-Server.hostname

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.

Can’t connect to L2TP-IPsec-VPN-Server

In other Windows versions, the connection errors 800, 794 or 809 may indicate the same problem.

It is worth to note that the VPN server is behind a NAT, and the router is configured to forward L2TP ports:

  • UDP 1701 — Layer 2 Forwarding Protocol (L2F) & Layer 2 Tunneling Protocol (L2TP)
  • UDP 500
  • UDP 4500 NAT-T – IPSec Network Address Translator Traversal
  • Protocol 50 ESP

These ports are also open in the Windows Firewall rules for VPN connection. Those, the classic configuration is used. The built-in Windows VPN client is used for connection.

If you connect to the same VPN server via PPTP, the connection is successfully established.

VPN Error 809 for L2TP/IPSec on Windows behind NAT

As it turned out, the problem is already known and described in the article https://support.microsoft.com/en-us/kb/926179. The Windows built-in VPN client doesn’t support by default L2TP/IPsec connections through NAT. This is because IPsec uses ESP (Encapsulating Security Payload) to encrypt packets, and ESP doesn’t support PAT (Port Address Translation). If you want to use IPSec for communication, Microsoft recommends using public IP addresses on the VPN server.

But there is also a workaround. You can fix this drawback by enabling support for the NAT-T protocol, which allows you to encapsulate ESP 50 packets in UDP packets on port 4500. NAT-T is enabled by default in almost all operating systems (iOS, Android, Linux) except Windows.

If the L2TP/IPsec VPN server is behind a NAT device, in order to connect external clients through NAT correctly, you have to make some changes to the registry both on the server and client side to allow UDP packet encapsulation for L2TP and NAT-T support in IPsec.

  • Open the Registry Editor (regedit.exe) and go to the following registry key:
    • Windows 10/8.1/Vista  and Windows Server 2016/2012R2/2008R2 — HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesPolicyAgent
    • Windows XP/Windows Server 2003 — HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesIPSec
  • Create a DWORD parameter with the name AssumeUDPEncapsulationContextOnSendRule and the value 2;AssumeUDPEncapsulationContextOnSendRule registry key

    Note. Possible AssumeUDPEncapsulationContextOnSendRule values are:

    • 0 – (a default value) suggests that the server is connected to the Internet without NAT;
    • 1 – the VPN server is behind a NAT device ;
    • 2 — both VPN server and client are behind a NAT.
  • Just restart your computer and make sure that the VPN tunnel is established successfully

[alert] If both Windows VPN server and client are behind NAT, you need to change this setting on both devices.

Also, you can use a PowerShell cmdlet to make changes to the registry:

Set-ItemProperty -Path "HKLM:SYSTEMCurrentControlSetServicesPolicyAgent" -Name "AssumeUDPEncapsulationContextOnSendRule" -Type DWORD -Value 2 –Force;

After enabling NAT-T support, you will be able to successfully connect to the VPN server from the client through NAT (including double NAT).

In some cases, for VPN to work properly, you need to enable an additional firewall rule for TCP 1701 (in some L2TP implementations, this port is used in conjunction with UDP 1701).

NAT-T didn’t work correctly in earlier Windows 10 builds, for example, 10240, 1511, 1607. If you have an older Windows version, we recommend you to upgrade the Windows 10 build.

Multiple L2TP VPN Connections from the same LAN

There is another interesting VPN bug. If your local network has several Windows computers, you cannot establish more than one simultaneous connection to an external L2TP/IPSec VPN server. If you try to connect to the same VPN server from another computer (with an active VPN tunnel from different device), error code 809 or 789 will appear:

Error 789: The L2TP connection attempt failed because the security layer encountered a processing error during initial negotiations with the remove computer.

Interestingly, this problem only occurs on Windows devices. On Linux/MacOS/Android devices on the same local network, there are no such problems. You can easily connect to the VPN L2TP server from multiple devices at the same time.

According to TechNet, the issue is related to incorrect implementation of the L2TP/IPSec client on Windows (not fixed for many years).

To fix this bug, you need to change two registry parameters in the HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesRasManParameters registry key and restart your computer:

  • AllowL2TPWeakCrypto – change to 00000001 (allows weak encryption algorithms, for L2TP/IPSec the MD5 and DES algorithms are used);
  • ProhibitIPSec – change to 00000000 (enables IPsec encryption, which is often disabled by some VPN clients or system tools).

AllowL2TPWeakCrypto and ProhibitIpSec for l2tp ipsec vpn connection behind a NAT on Windows

Run the following command to change apply these registry changes:

reg add "HKEY_LOCAL_MACHINESystemCurrentControlSetServicesRasmanParameters" /v AllowL2TPWeakCrypto /t REG_DWORD /d 1 /f
reg add "HKEY_LOCAL_MACHINESystemCurrentControlSetServicesRasmanParameters" /v ProhibitIpSec /t REG_DWORD /d 0 /f

This enables support for concurrent L2TP/IPSec VPN connections on Windows through a shared public IP address (works on all versions from Windows XP to Windows 10).

Понравилась статья? Поделить с друзьями:
  • Ошибка 809 ikev2 windows 7
  • Ошибка 8c150009 на xbox 360
  • Ошибка 8080 что это
  • Ошибка 8993 на скании абс
  • Ошибка 80711008 на ps3