воскресенье, 13 апреля 2014 г.

win7 win2008 l2tp forwarding

Порты, которые нужно пробросить на роутере (источник http://aerovisionit.co.uk/pptp-and-l2tp-port-forwarding/)

L2TP traffic – UDP 1701
Internet Key Exchange (IKE) – UDP 500
IPSec Network Address Translation (NAT-T) – UDP 4500

И самая главная фигня, которую уже 2 раз забываю и из-за этого тратю кучу времени
Windows Vista, Windows 7 and the Windows Server 2008 operating system do not support NAT-T security associations to servers that are located behind a NAT Device by default (it’s not recommended) - то есть нужно еще править реестр на всех участниках соединения, которые стоят за нат (используем согласно выше приведенного источника ссылку http://support.microsoft.com/kb/926179)

для winxp sp2
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\IPSec
для win7 win2008r2 (в моем случае)
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PolicyAgent

On the Edit menu, point to New, and then click DWORD (32-bit) Value.
Type AssumeUDPEncapsulationContextOnSendRule, and then press ENTER.
Right-click AssumeUDPEncapsulationContextOnSendRule, and then click Modify.
In the Value Data box, type one of the following values:
0 - A value of 0 (zero) configures Windows so that it cannot establish security associations with servers that are located behind NAT devices. This is the default value.
1 - A value of 1 configures Windows so that it can establish security associations with servers that are located behind NAT devices.
2 - A value of 2 configures Windows so that it can establish security associations when both the server and the Windows Vista-based or Windows Server 2008-based VPN client computer are behind NAT devices.

Я использовал 2 поскольку у меня и сервер и мой пк за nat (и там и там отличный роутер мikrotik)

На всякий случай приведу конфигурацию mikrotik для форвардинга l2tp трафика

add chain=customer dst-port=500,1701,4500 in-interface=internet protocol=udp
(у меня chain=customer поскольку add action=jump chain=forward in-interface=internet jump-target=customer, то есть у меня идет джам с форварда на эту таблицу, у вас скорее этого не будет и нада делать chain=forward; также in-interface=internet укажите свой интерфейс у меня PPPoE и назван internet)
add action=netmap chain=dstnat dst-port=500 protocol=udp to-addresses=192.168.10.2 to-ports=500
add action=netmap chain=dstnat dst-port=1701 protocol=udp to-addresses=192.168.10.2 to-ports=1701
add action=netmap chain=dstnat dst-port=4500 protocol=udp to-addresses=192.168.10.2 to-ports=4500

(где 192.168.10.2 - адрес win2008r2 сервера)

Самое главное как я написал не забывайте за ключи реестра.


Комментариев нет:

Отправить комментарий