Windows 10 не подключается к vpn l2tp ipsec mikrotik

Добрый день..
  • Remove From My Forums
  • Вопрос

  • Добрый день..

    Да сообственно уже пробовал любой протокол — не конектится, значек соединения тупо крутиться и все

    После нажатия «Подключится» ничего не происходит, крутится колесо загрузки все время

    Сброс сети, а также перезагрузку VPN службы — пробовал, не помогло.. 

    Винду переустанавливать не охота, помогите плз..

    #IPCONFIG

    https://1drv.ms/f/s!AliMWVI8ouB0gcAimoIsyiCbno5kLA

Ответы

  • На клиенте проверьте наличие ключа в реестре:

    [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesPolicyAgent]
    "AssumeUDPEncapsulationContextOnSendRule"=dword:00000002
    • Помечено в качестве ответа

      20 июня 2019 г. 10:50

    • Снята пометка об ответе
      Valentyn Lytvynov
      12 июля 2019 г. 16:28
    • Помечено в качестве ответа
      Valentyn Lytvynov
      15 июля 2019 г. 6:16

  • Вообщем, после выхода обновления — решилось все само,

    Сборка — 18362.239

    Версия — 1903

    Спасибо SQx его ответ поначалу помог — PS
    Settings -> Network & Internet -> VPN

    Спасибо Anahaym его метод тоже работал, пару дней))) 

    На клиенте проверьте наличие ключа в реестре:

    [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesPolicyAgent]
    "AssumeUDPEncapsulationContextOnSendRule"=dword:00000002

    Всем Спасибо..

    Тема закрыта!

  • Здравствуйте,

    Уточните пожалуйста, а удается ли подключится через следующее?

    PS Settings -> Network & Internet -> VPN

    P.S. Проблему сами иногда воспроизвожу когда использую подключение через WiFi-интерфейс, помогает подключиться, через указанное выше меню.


    Avis de non-responsabilité:
    Mon opinion ne peut pas coïncider avec la position officielle de Microsoft.

    Bien cordialement, Andrei …

    MCP

    • Изменено
      SQxModerator
      16 июня 2019 г. 0:07
      updated
    • Помечено в качестве ответа
      Valentyn Lytvynov
      16 июня 2019 г. 8:02
    • Снята пометка об ответе
      Valentyn Lytvynov
      20 июня 2019 г. 2:11
    • Помечено в качестве ответа
      Dmitriy VereshchakMicrosoft contingent staff, Moderator
      15 июля 2019 г. 6:57

If you cannot connect to your L2TP/IPsec VPN server from Windows 10, continue reading below to solve the problem.

VPN connection errors can be caused by a variety of causes, but are usually due to incorrect settings of the VPN connection (e.g. incorrect server name/address, authentication method, username or password). So the first step to troubleshoot VPN connection problems, is to verify that all the VPN settings are correct.

This tutorial contains instructions to solve the following errors, while trying to connect to L2TP/IPsec VPN server in Windows 10 or Windows Server 2012/2016:

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

image

  • The L2TP connection attempt failed because the security layer encountered a processing error during the initial negotiations with the remote computer.

image

How to FIX: Can’t connect to VPN. L2TP connection between your computer and the VPN server could not be established on Windows 10.

Before continue to the instructions below, apply the following actions: *

* Important: If the problem started in January 2022, see the following article first:

  • Related Article: FIX: The L2TP connection attempt failed because the security layer encountered a processing error during initial negotiations with the remote computer.

1. Ensure that the Required L2TP/IPsec Ports are enabled on VPN Server’s side.

Login to the Router on VPN Server’s side, and forward the following UDP ports to VPN Server’s IP address: 1701, 50, 500 & 4500

2. Connect to VPN via another device or network.

Try connecting to L2TP VPN from another device (e.g. your mobile), or network (e.g. your Mobile’s phone network).

3. Delete and recreate the VPN connection.

Sometimes VPN connection problems, are resolved after removing and re-adding the VPN Connection.

If, after the above steps, you are still unable to connect to your l2tp/IPsec VPN server from your Windows 10 computer, apply the following modifications to the registry and the VPN connection.

STEP 1. ALLOW L2TP CONNECTIONS BEHIND NAT.

By default, Windows do not support L2TP/IPsec connections if the computer or the VPN server are located behind a NAT. To bypass this problem modify registry as follows:

1. Open Registry Editor. To do that:

1. Simultaneously press the Win image + R keys to open the run command box.
2. Type regedit and press Enter to open Registry Editor.

regedit

2. At the left pane, navigate to this key:

  • HKEY_LOCAL_MACHINESYSTEMCurrentControlSetSevicesPolicyAgent

3. Right click at an empty space at the right pane and select New –> DWORD (32 bit) Value.

image

4. For the new key name type: AssumeUDPEncapsulationContextOnSendRule and press Enter.

* Note: The value must be entered as shown above and with no space at the end.

5. Double click at AssumeUDPEncapsulationContextOnSendRule value, type 2 at Value data and click OK.

image

6. Close Registry Editor and reboot the machine.

Step 2. Modify Security Settings on VPN Connection.

1. Right-click at the Network icon on the taskbar and choose Open Network & Internet settings.

* Note: Alternatively, go to Start image > Settings image click Network and Internet.

vpn client setup windows 10

2. Select Ethernet on the left and then click Change adapter options on the right.

image

3. Right-click on the VPN connection and chose Properties.

image

4a. At Options tab, click PPP Settings.

image

4b. Check Enable LCP extensions and click OK.

image

4c. At Security tab, check the following and click OK.

  • Allow these protocols
  • Challenge Handshake Authentication Protocol (CHAP)
  • Microsoft CHAP Version 2 (MS-SHAP v2)

image

5. Try to connect to VPN. The connection should be established now without problems. *

ADDITIONAL HELP: If after applying the above steps you still have a problem, try the following:

1. Check that the following services are enabled (Startup type: Automatic)

    1. IKE and AuthIP IPsec Keying Modules
    2. IPsec Policy Agent

2. If you’re using a third-party firewall program, try to disable it or to completely uninstall it before connecting to VPN.

3. Try to reset the Windows Firewall settings to their default. To do that, go to Control Panel > Windows Defender Firewall and click Restore defaults.

image

4. Delete and recreate the VPN connection.

5. Reboot the router on VPN’s server side.

That’s it! Let me know if this guide has helped you by leaving your comment about your experience. Please like and share this guide to help others.

If this article was useful for you, please consider supporting us by making a donation. Even $1 can a make a huge difference for us in our effort to continue to help others while keeping this site free:

If you want to stay constantly protected from malware threats, existing and future ones, we recommend that you install Malwarebytes Anti-Malware PRO by clicking below (we
do earn a commision from sales generated from this link, but at no additional cost to you. We have experience with this software and we recommend it because it is helpful and useful):

Full household PC Protection — Protect up to 3 PCs with NEW Malwarebytes Anti-Malware Premium!

Столкнулись с интересной проблемой у одного из заказчиков после перенастройки VPN сервера Windows Server 2012 с PPTP на L2TP/ IPSec (из за отключения поддержки PPTP VPN в iOS). Изнутри корпоративной сети VPN клиенты без каких-либо проблем подключаются к VPN серверу, а вот внешние Windows клиенты при попытке установить соединение с L2TP VPN сервером, выдают такую ошибку:

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.

vpn ошибка при подключении за NAT

В других версиях Windows о наличии аналогичной проблемы могут свидетельствовать ошибки VPN подключения 800, 794 или 809.

Стоит отметить, что данный VPN сервер находится за NAT, а на маршрутизаторе настроен проброс портов, необходимых для работы L2TP:

  • 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

В правилах Windows Firewall VPN сервера эти порты также открыты. Т.е. используется классическая конфигурация. Для подключения используется встроенный VPN клиент Windows.

Если подключаться к этому же VPN серверу через PPTP, подключение успешно устанавливается.

VPN ошибка 809 для L2TP/IPSec в Windows за NAT

Как оказалось, проблема эта уже известна и описана в статье https://support.microsoft.com/en-us/kb/926179. По умолчанию встроенный VPN клиент Windows не поддерживает подключение к L2TP/IPsec через NAT. Дело в том, что IPsec использует протокол ESP (Encapsulating Security Payload) для шифрования пакетов, а протокол ESP не поддерживает PAT (Port Address Translation). Если вы хотите использовать IPSec для коммуникации, Microsoft рекомендует использовать белые IP адреса на VPN сервере.

Но есть и обходное решение. Можно исправить этот недостаток, включив поддержку протокола NATT, который позволяет инкапсулировать пакеты протокола ESP 50 в UDP пакеты по порту 4500. NAT-T включен по-умолчанию почти во всех операционных системах (iOS, Android, Linux), кроме Windows.

Если VPN сервер L2TP/IPsec находится за NAT, то для корректного подключения внешних клиентов через NAT необходимо на стороне Windows сервера и клиента внести изменение в реестр, разрешающее UDP инкапсуляцию пакетов для L2TP и поддержку (NAT-T) для IPsec.

  1. Откройте редактор реестра
    regedit.exe
    и перейдите в ветку:

    • Для Windows 10,8.1,7 и Windows Server 2016,2012R2,2008R2 — HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesPolicyAgent
    • Для Windows XP/Windows Server 2003 — HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesIPSec
  2. Создайте DWORD параметр с именем AssumeUDPEncapsulationContextOnSendRule и значением 2;
    AssumeUDPEncapsulationContextOnSendRule

    Примечание. Возможные значения параметра AssumeUDPEncapsulationContextOnSendRule:

    • 0 – (значение по-умолчанию), предполагается, что VPN сервер подключен к интернету без NAT;
    • 1 – VPN сервер находится за NAT;
    • 2 — и VPN сервер и клиент находятся за NAT.
  3. Осталось перезагрузить компьютер и убедиться, что VPN туннель успешно создается.

Если и Windows VPN сервер и клиент находятся за NAT, нужно изменить это параметре на обоих системах.

Можно использовать командлет PowerShell для внесения изменений в реестр:

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

После включения поддержки NAT-T, вы сможете успешно подключаться к VPN серверу с клиента через NAT (в том числе двойной NAT).

В некоторых случаях для корректной работы VPN необходимо открыть дополнительное правило в межсетевом экране для порта TCP 1701 (в некоторых реализациях L2TP этот порт используется совмести с UDP 1701).

NAT-T не корректно работал в ранних редакциях Windows 10, например, 10240, 1511, 1607. Если у вас старая версия, рекомендуем обновить билд Windows 10.

L2TP VPN не работает на некоторых Windows компьютерах в локальной сети

Есть еще один интересный баг. Если в вашей локальной сети несколько Windows компьютеров, вы не сможете установить более одного одновременного подключения к внешнему L2TP/IPSec VPN серверу. Если при наличии активного VPN туннеля с одного клиента, вы попытаетесь подключиться к тому же самому VPN серверу с другого компьютера, появится ошибка с кодом 809 или 789:

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

Что интересно, эта проблема наблюдется только с Windows-устройствами. На устройствах с Linux/MacOS/Android в этой же локальной сети таких проблем нет. Можно без проблем одновременно подключиться к VPN L2TP серверу с нескольких устройств.

По информации на TechNet проблема связана с некорректной реализацией клиента L2TP/IPSec клиента в Windows (не исправляется уже много лет).

Для исправления этого бага нужно изменить два параметра реестра в ветке HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesRasManParameters и перезагрузите компьютре:

  • AllowL2TPWeakCrypto – изменить на 00000001 (ослабляет уровень шифрования, для L2TP/IPSec используются алгоритмы MD5 и DES)
  • ProhibitIPSec – изменить на 00000000 (включает шифрование IPsec, которое часто отключается некоторыми VPN клиентами или утилитами)

Параметры реестра ProhibitIPSec AllowL2TPWeakCrypto для корректной работы VPN за NAT
Для изменения этих параметров реестра достаточно выполнить команды:
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

Это включает поддержку нескольких одновременных L2TP/IPSec-подключений в Windows через общий внешний IP адрес (работает на всех версиях, начиная с Windows XP и заканчивая Windows 10).

Понравилась статья? Поделить с друзьями:
  • Windows 10 не подключается к vpn l2tp ipsec 720
  • Windows 10 не подключается к nas по сети
  • Windows 10 не поддерживается на этом mac хотя диск windows 7
  • Windows 10 не пишет звук с микрофона
  • Windows 10 не пингуется по имени