![]()
|
|||
Mikrotik L2tp & Ipsec VPN Configuration Step by StepMikrotik L2tp & Ipsec VPN Configuration Step by Step Исходные данные: Локальная сеть: 10. 3. 0. 1/24 1) Включаем PPP > L2TP Server Устанавливаем птичку на Enabled 2) В IP > Pool создаем l2tp_pool1 для L2TP подключений
192. 168. 20. 5-192. 168. 20. 10
Пул можно сделать и больше.
3) Создаем VPN профиль в PPP > Profiles
Name: L2TP-profile Local Address: 10. 3. 0. 1 Remote Address: l2tp_pool1 DNS Server: 8. 8. 8. 8 8. 8. 4. 4
4) Создаем VPN пользователя в PPP > Secrets
Name: Имя пользователя Password: Пароль Service: l2tp Profile: L2TP-profile
5) Настраиваем IP > IPsec. Заходим во вкладку Peers
Name: l2tp_peer1 Address: 0. 0. 0. 0/0 (преобразуется в:: /0) Port: 500 Exchange Mode: IKE2
5. 1) Переходим во вкладку Identites
Peer: l2tp_peer1 Auth. Method: pre shared key Secret: Ваш секретный код (он-же IPsec Secret) Generate Policy: port override
5. 2) Переходим во вкладку Profiles и проверяем настройки default
Ставим птичку (если не стоит) на NAT Traversal 6) Заходим в New Terminal и выполняем (Заметка. ether1 в качестве In. Interface указываем тот что подключен к интернет): /ip firewall filter add action=accept chain=input in-interface= ether1 protocol=ipsec-esp \ comment=" Allow L2TP VPN (ipsec-esp)" add action=accept chain=input dst-port=500, 1701, 4500 in-interface= ether1 protocol=udp \ comment=" Allow L2TP VPN (500, 4500, 1701/udp)"
/ip firewall nat add action=masquerade chain=srcnat src-address=192. 168. 20. 0/24 out-interface= ether1 \ comment=" L2TP - LAN access for VPN connected users via L2TP"
Мой случай (если у Вас настроен Interface List, LAN=bridge1, WAN=pppoe-out1) /ip firewall filter add action=accept chain=input in-interface-list=WAN protocol=ipsec-esp \ comment=" Allow L2TP VPN (ipsec-esp)" add action=accept chain=input dst-port=500, 1701, 4500 in-interface-list=WAN protocol=udp \ comment=" Allow L2TP VPN (500, 4500, 1701/udp)"
/ip firewall nat add action=masquerade chain=srcnat src-address=192. 168. 20. 0/24 out-interface-list=WAN \ comment=" L2TP - LAN access for VPN connected users via L2TP"
Правила поднять над запрещающими:
7) Предварительно заходим IP > Addresses и копируем внешний IP адрес, предоставленный провайдером. В моем случае 172. 31. 21. 138
8) Создаем VPN подключение на PC.
9) Подключаемся!
|
|||
|