понедельник, 18 мая 2009 г.

Настройка VPN сервера Windows 2003

Стандартная настройка VPN в Windows 2003 Server.
http://www.intr.ru/contentid-50.html
http://www.smart-soft.ru/?page=vpnser

Можно отметить несколько моментов.


Фича Win2003 PPTP VPN сервера в том, что под одним и тем же логином можно заходить параллельно одновременно с нескольких компов, клиенты будут получать разные IP из назначенного диапазона. Побороть можно специальными утилитками.

Для работы Win2003 PPTP VPN сервера нужно открыть наружу в роутере/фаерволе порт TCP:1723, для работы L2TP VPN - UDP:1701
Если используется протокол L2TP с безопасностью IPSec, необходимо разрешить протоколам IPSec ESP (50, протокол IP), NAT-T (UDP на порте 4500) и IPSec ISAKMP (UDP на порте 500) проходить через маршрутизатор.
Подробнее по портам http://support.microsoft.com/kb/832017/ru

Что выбрать: L2TP или PPTP?
Если провайдер не фильтрует GRE-пакеты, которые используются для транспортировки PPTP, то можно спокойно жить и радоваться. Если провайдер фильтрует IP GRE (протокол 47 - это название протокола типа TCP, UDP, ICMP, а не номер порта), иногда это делают сотовые операторы GPRS/EDGE, и в результате чего мы имеем жалобы от клиентов на ошибку 806, то стоит посмотреть в сторону L2TP, который в качестве транспорта использует UDP/TCP (порт UDP:1701).

Решение проблем с L2TP/IPsec:
http://support.microsoft.com/kb/314831/ru
http://support.microsoft.com/kb/257225/
Если клиент Windows XP SP2/SP3 находится за NAT - http://support.microsoft.com/kb/885407
To allow an IPsec NAT-T initiator to connect to a responder that is located behind a NAT, you must create and set the AssumeUDPEncapsulationContextOnSendRule registry value on the initiator.

Note Before you configure this registry value, we recommend that you contact your network administrator or read your corporate security policy.

To create and configure the AssumeUDPEncapsulationContextOnSendRule registry value, follow these steps:
  1. Click Start, click Run, type regedit, and then click OK.
  2. Locate and then click the following registry subkey:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\IPsec
  3. On the Edit menu, point to New, and then click DWORD Value.
  4. In the New Value #1 box, type AssumeUDPEncapsulationContextOnSendRule, and then press ENTER.

    Important This value name is case sensitive.
  5. Right-click AssumeUDPEncapsulationContextOnSendRule, and then click Modify.
  6. In the Value data box, type one of the following values:
    • 0 (default)
      A value of 0 (zero) configures Windows XP SP2 so that it cannot initiate IPsec-secured communications with responders that are located behind network address translators.
    • 1
      A value of 1 configures Windows XP SP2 so that it can initiate IPsec-secured communications with responders that are located behind network address translators.
    • 2
      A value of 2 configures Windows XP SP2 so that it can initiate IPsec-secured communications when both the initiators and the responders are behind network address translators.

      Note This is the behavior of IPsec NAT-T in Windows XP without service packs installed and in Windows XP SP1.
  7. Click OK, and then quit Registry Editor.
  8. Restart the computer.
After you configure AssumeUDPEncapsulationContextOnSendRule with a value of 1 or a value of 2, Windows XP SP2 can connect to a responder that is located behind a network address translator. This behavior applies to connections to a VPN server that is running Windows Server 2003.

Пишем простенький reg-файл (преименовываем например ipsec.txt в ipsec.reg) из 3 строк:
REGEDIT4
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\IPSec]
"AssumeUDPEncapsulationContextOnSendRule"=dword:00000002
И потом просто запускаем один раз на клиентских машинах.

Если Windows 2003 Server VPN находится за NAT - http://support.microsoft.com/kb/885348/
If you put a server behind a network address translator, you may experience connection problems because clients that connect to the server over the Internet require a public IP address. To reach servers that are located behind network address translators from the Internet, static mappings must be configured on the network address translator. For example, to reach a Windows Server 2003-based computer that is behind a network address translator from the Internet, configure the network address translator with the following static network address translator mappings:
  • Public IP address/UDP port 500 to the server's private IP address/UDP port 500.
  • Public IP address/UDP port 4500 to the server's private IP address/UDP port 4500.
These mappings are required so that all Internet Key Exchange (IKE) and IPSec NAT-T traffic that is sent to the public address of the network address translator is automatically translated and forwarded to the Windows Server 2003-based computer.

However, if you have a Windows Server 2003-based VPN server, we recommend that you assign a public IP address to the VPN server. By assigning a public IP address to the VPN server, you can avoid situations where IP traffic is either lost or accidentally forwarded to the incorrect location because of typical network address translator behavior.
Т е просто делаем порт форвардинг UDP 500, 1701, 4500 портов через роутер. ^)

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