Как подключится к VPN L2TP серверу (Mikrotik) за NAT если все порты открыты?
Всем доброго!
Есть у меня Mikrotik Cloud Hosted Router, но к сожелению он за NAT. Все порты проброшены на mikrotik. На Mikrotik настроен L2TP/IpSec сервер, и вот интересно, что с mac OS и IOS подключения проходит на ура, а вот с Windows проблемы, не подключатся ни в какую 🙁
В процесе подключения с Винды, вижу на mikrotik, что все же ipsec подключается (в пирах) но потом соединения разрывается, вот лог:
ISAKMP-SA established 172.21.xx[4500]-clientIP[4500] spi:a841776. purging ISAKMP-SA 172.21.xx[4500]clientIP[4500] spi=a841776. ISAKMP-SA deleted 172.21.xx[4500]-clientIP[4500] spi:a841776 rekey:1
В windows получаю ошибку 809, нагуглил что это проблема связана с тем что сервер VPN находится за NAT и должно это личися правкой реестра HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PolicyAgent , а именно добавлениям туда параметра AssumeUDPEncapsulationContextOnSendRule со значениям 1 или 2, но все без результатно 🙁
Подскажите пожалуйста, как можно победить эту проблему
- Вопрос задан более трёх лет назад
- 7503 просмотра
3 комментария
Простой 3 комментария
Isakmp sa deleted mikrotik как решить проблему
Обнаружена блокировка рекламы: Наш сайт существует благодаря показу онлайн-рекламы нашим посетителям. Пожалуйста, подумайте о поддержке нас, отключив блокировщик рекламы на нашем веб-сайте.
Клиенты L2TP + IPSec отключают друг друга
Раздел для тех, кто начинает знакомиться с MikroTik
Правила форума
Как правильно оформить вопрос.
Прежде чем начать настройку роутера, представьте, как это работает. Попробуйте почитать статьи об устройстве интернет-сетей. Убедитесь, что всё, что Вы задумали выполнимо вообще и на данном оборудовании в частности.
Не нужно изначально строить Наполеоновских планов. Попробуйте настроить простейшую конфигурацию, а усложнения добавлять в случае успеха постепенно.
Пожалуйста, не игнорируйте правила русского языка. Отсутствие знаков препинания и неграмотность автора топика для многих гуру достаточный повод проигнорировать топик вообще.
1. Назовите технологию подключения (динамический DHCP, L2TP, PPTP или что-то иное)
2. Изучите темку «Действия до настройки роутера».
viewtopic.php?f=15&t=2083
3. Настройте согласно выбранного Вами мануала
4. Дочитайте мануал до конца и без пропусков, в 70% случаев люди просто не до конца читают статью и пропускают важные моменты.
5. Если не получается, в Winbox открываем терминал и вбиваем там /export hide-sensitive. Результат в топик под кат, интимные подробности типа личных IP изменить на другие, пароль забить звездочками.
6. Нарисуйте Вашу сеть, рисунок (схему) сюда. На словах может быть одно, в действительности другое.
4 сообщения • Страница 1 из 1
eldar Сообщения: 5 Зарегистрирован: 15 ноя 2019, 10:34
Добрый день.
Всегда настраивал на Mikrotik L2TP + IPSec примерно по одним и тем же инструкциям из интернета и недавно обнаружил такую особенность: если два клиента находятся за NAT на одном внешнем IP они отключают друг друга при подключении. Т.е. первый клиент подключается, спокойно работает. Стоит второму клиенту подключиться и у первого виснет соединение.
В логах в этот момент:
08:17:48 l2tp,ppp,info : authenticated 08:17:49 l2tp,ppp,info : connected 08:28:47 ipsec,info respond new phase 1 (Identity Protection): IP1[500]IP2[500] 08:28:47 ipsec,info ISAKMP-SA established IP1[4500]-IP2[1024] spi:7a0efeffc201e0d6:15eb41def26c3399 08:28:49 ipsec,info purging ISAKMP-SA IP1[4500]IP2[1024] spi=7a0efeffc201e0d6:15eb41def26c3399. 08:28:49 ipsec,info ISAKMP-SA deleted IP1[4500]-IP2[1024] spi:7a0efeffc201e0d6:15eb41def26c3399 rekey:1 08:28:52 ipsec,info respond new phase 1 (Identity Protection): IP1[500]IP2[500] 08:28:52 ipsec,info ISAKMP-SA established IP1[4500]-IP2[1024] spi:4bd8c2d865706f5b:1b860fd467a5917a 08:28:53 l2tp,info first L2TP UDP packet received from IP2 08:28:53 l2tp,ppp,info,account user02 logged in, 192.168.100.236 08:28:53 l2tp,ppp,info : authenticated 08:28:53 l2tp,ppp,info : connected 08:30:09 l2tp,ppp,info : terminating. - hungup 08:30:09 l2tp,ppp,info,account user01 logged out, 740 264859 647868 2552 3202 08:30:09 l2tp,ppp,info : disconnected
Гугл выдал вот такую статью https://forum.mikrotik.com/viewtopic.php?t=115592, суть которой сводится к тому чтобы использовать другое решение. В моем случае это не желательно, т.к. грозит перенастройкой нескольких десятков пользователей и роутеров.
Кто нибудь может мне помочь решить эту проблему?
Конфиг одного роутера (2011UiAS):
> ip address print
Flags: X — disabled, I — invalid, D — dynamic
# ADDRESS NETWORK INTERFACE
0 192.168.100.2/24 192.168.100.0 bridge
> ip pool print
# NAME RANGES
0 office-pool 192.168.100.101-192.168.100.200
1 vpn-pool 192.168.100.200-192.168.100.250
> ppp profile print
Flags: * — default
0 * name=»default» use-mpls=default use-compression=default use-encryption=default only-one=default change-tcp-mss=yes use-upnp=default address-list=»» on-up=»» on-down=»»
1 name=»l2tp» local-address=192.168.100.2 remote-address=vpn-pool use-mpls=default use-compression=default use-encryption=default only-one=default change-tcp-mss=yes use-upnp=default address-list=»» dns-server=192.168.100.1,192.168.100.8 wins-server=192.168.100.1,192.168.100.8 on-up=»» on-down=»»
> ppp secret print
Flags: X — disabled
# NAME SERVICE CALLER-ID PASSWORD PROFILE REMOTE-ADDRESS
0 user01 l2tp password l2tp
1 user02 l2tp password l2tp
/ip ipsec peer> print
Flags: X — disabled, D — dynamic, R — responder
0 DR name=»peer3″ passive=yes profile=default exchange-mode=main send-initial-contact=yes
1 R ;;; This entry is unreachable
name=»peer1″ passive=yes profile=default exchange-mode=main send-initial-contact=yes
/ip ipsec> proposal print
Flags: X — disabled, * — default
0 * name=»default» auth-algorithms=sha1 enc-algorithms=aes-256-cbc,aes-256-ctr,3des lifetime=30m pfs-group=modp1024
> interface l2tp-server server print
enabled: yes
max-mtu: 1450
max-mru: 1450
mrru: disabled
authentication: mschap2
keepalive-timeout: 30
max-sessions: unlimited
default-profile: l2tp
use-ipsec: yes
ipsec-secret: SECRET
caller-id-type: ip-address
one-session-per-host: no
allow-fast-path: no
Mikrotik L2TP/IPSEC и Windows клиент в чем проблема?
Какой день уже бьюсь над проблемой подключения к VPN из под windows. С MacOS, Andriod все прекрасно подключается.
В интернете толком никакой информации не нашел, что прям точно есть какая-то проблема, у всех все прекрасно работает. Пробовал подключиться с разных компьютером под управлением Windows 10, 8.
Версия RouterOS 6.47.1.
В логах такой результат при попытке подключиться из под windows:
respond new phase 1 (Identity Protection): [500][500]
ISAKMP-SA established [4500]-[4500] spe
это все дело висит секунд 30 и потом
purging ISAKMP-SA established [4500]-[4500] spe
ISAKMP-SA deleted [4500]-[4500] spe
- Вопрос задан более трёх лет назад
- 2843 просмотра
1 комментарий
Простой 1 комментарий
Isakmp sa deleted mikrotik как решить проблему
Sat Mar 23, 2019 6:13 pm
First I don’t have access at the moment to the remote side..and secondly Fritzbox doesn’t offer any advanced settings. only source/dest prefix, dest address and local/remote id.
Can’t even connect remotely anymore to it with a ios/macos vpn client anymore as before with an older fritzbox running os < 7.x.
I can set the phase 1 lifetime to 30 seconds. as soon I click apply, lifetime is not set anymore.
Member Candidate
Topic Author
Posts: 115 Joined: Sun Mar 03, 2019 6:23 pm
Re: Endless ISAKMP-SA established/ISAKMP-SA deleted
Mon Mar 25, 2019 11:01 am
Okay..have access now to the remote fritzbox. there I see in the logs only this:
IKE-Error 0x203D «phase 1 sa removed during negotiation»
And on the RouterOS side always the «no address or pool specified». still don’t know what this refers to.
Forum Veteran
Posts: 906 Joined: Thu Dec 11, 2014 8:53 am
Re: Endless ISAKMP-SA established/ISAKMP-SA deleted
Mon Mar 25, 2019 11:09 am
Sounds like one of the sides has mode-config enabled. Please post full configuration and full ipsec debug logs.
Member Candidate
Topic Author
Posts: 115 Joined: Sun Mar 03, 2019 6:23 pm
Re: Endless ISAKMP-SA established/ISAKMP-SA deleted
Mon Mar 25, 2019 11:19 am
This is the config on the routeros side (on fritzbox side there isn’t anything I can change):
/ip ipsec profile add dh-group=modp1024 dpd-interval=30s enc-algorithm=aes-256 name=Wuerenlos /ip ipsec peer add address=83.150.26.215/32 exchange-mode=aggressive local-address=x.x.90.159 name=Wuerenlos profile=Wuerenlos /ip ipsec proposal set [ find default=yes ] disabled=yes add enc-algorithms=aes-256-cbc,aes-256-ctr,aes-256-gcm lifetime=40m name=Wuerenlingen /ip ipsec identity add generate-policy=port-strict mode-config=request-only my-id=fqdn:zzzz.ddns.net peer=Wuerenlos remote-id=key-id:@MyID secret=\ mikrotikroutervpn /ip ipsec policy add dst-address=192.168.178.0/24 proposal=Wuerenlingen sa-dst-address=y.y.26.215 sa-src-address=x.x.90.159 src-address=10.0.0.0/16 \ tunnel=yes
Member Candidate
Topic Author
Posts: 115 Joined: Sun Mar 03, 2019 6:23 pm
Re: Endless ISAKMP-SA established/ deleted (RouterOS FritzOS 7.01)
Mon Mar 25, 2019 11:37 am
Took a while for me to get the logs (o;
10:35:39 ipsec,info respond new phase 1 (Aggressive): x.x.90.159[500]y.y.26.215[500] 10:35:39 ipsec received Vendor ID: draft-ietf-ipsra-isakmp-xauth-06.txt 10:35:39 ipsec received Vendor ID: DPD 10:35:39 ipsec received Vendor ID: RFC 3947 10:35:39 ipsec received Vendor ID: draft-ietf-ipsec-nat-t-ike-02\n 10:35:39 ipsec received Vendor ID: draft-ietf-ipsec-nat-t-ike-03 10:35:39 ipsec y.y.26.215 Selected NAT-T version: RFC 3947 10:35:39 ipsec Adding remote and local NAT-D payloads. 10:35:39 ipsec y.y.26.215 Hashing y.y.26.215[500] with algo #2 10:35:39 ipsec x.x.90.159 Hashing x.x.90.159[500] with algo #2 10:35:39 ipsec Adding xauth VID payload. 10:35:39 ipsec sent phase1 packet x.x.90.159[500]y.y.26.215[500] ba1d9974f8d9957a:297c79ac4fa3b1fc 10:35:39 ipsec x.x.90.159 Hashing x.x.90.159[500] with algo #2 10:35:39 ipsec NAT-D payload #0 verified 10:35:39 ipsec y.y.26.215 Hashing y.y.26.215[500] with algo #2 10:35:39 ipsec NAT-D payload #1 verified 10:35:39 ipsec y.y.26.215 ignore INITIAL-CONTACT notification, because it is only accepted after phase1. 10:35:39 ipsec NAT not detected 10:35:39 ipsec,info ISAKMP-SA established x.x.90.159[500]-y.y.26.215[500] spi:ba1d9974f8d9957a:297c79ac4fa3b1fc 10:35:39 ipsec Configuration exchange type mode config REQUEST 10:35:39 ipsec No address or pool specified! 10:35:39 ipsec,info ISAKMP-SA deleted x.x.90.159[500]-y.y.26.215[500] spi:ba1d9974f8d9957a:297c79ac4fa3b1fc rekey:1 10:35:42 ipsec,info respond new phase 1 (Aggressive): x.x.90.159[500]y.y.26.215[500] 10:35:42 ipsec received Vendor ID: draft-ietf-ipsra-isakmp-xauth-06.txt 10:35:42 ipsec received Vendor ID: DPD 10:35:42 ipsec received Vendor ID: RFC 3947 10:35:42 ipsec received Vendor ID: draft-ietf-ipsec-nat-t-ike-02\n 10:35:42 ipsec received Vendor ID: draft-ietf-ipsec-nat-t-ike-03 10:35:42 ipsec y.y.26.215 Selected NAT-T version: RFC 3947 10:35:42 ipsec Adding remote and local NAT-D payloads. 10:35:42 ipsec y.y.26.215 Hashing y.y.26.215[500] with algo #2 10:35:42 ipsec x.x.90.159 Hashing x.x.90.159[500] with algo #2 10:35:42 ipsec Adding xauth VID payload. 10:35:42 ipsec sent phase1 packet x.x.90.159[500]y.y.26.215[500] 286e22107955defe:1cb5e8eb24c33742 10:35:42 ipsec x.x.90.159 Hashing x.x.90.159[500] with algo #2 10:35:42 ipsec NAT-D payload #0 verified 10:35:42 ipsec y.y.26.215 Hashing y.y.26.215[500] with algo #2 10:35:42 ipsec NAT-D payload #1 verified 10:35:42 ipsec y.y.26.215 ignore INITIAL-CONTACT notification, because it is only accepted after phase1. 10:35:42 ipsec NAT not detected 10:35:42 ipsec,info ISAKMP-SA established x.x.90.159[500]-y.y.26.215[500] spi:286e22107955defe:1cb5e8eb24c33742 10:35:42 ipsec Configuration exchange type mode config REQUEST 10:35:42 ipsec No address or pool specified! 10:35:42 ipsec,info ISAKMP-SA deleted x.x.90.159[500]-y.y.26.215[500] spi:286e22107955defe:1cb5e8eb24c33742 rekey:1