Article ID: 252735 - Last Review: November 14, 2007 - Revision: 7.5 How to Configure IPSec Tunneling in Windows 2000This article was previously published under Q252735 On This PageSUMMARY You can use IP Security (IPSec) in tunnel mode to
encapsulate Internet Protocol (IP) packets and optionally encrypt them. The
primary reason for using IPSec tunnel mode (sometimes referred to as "pure
IPSec tunnel") in Microsoft Windows 2000 is for interoperability with
third-party routers or gateways that do not support Layer 2 Tunneling Protocol
(L2TP)/IPSec or PPTP Virtual Private Networking (VPN) tunneling technology.
MORE INFORMATION Windows 2000 supports IPSec tunneling for situations where
both tunnel endpoints have static IP addresses. This is primarily useful in
gateway-to-gateway implementations, but may also work for specialized network
security scenarios between a gateway/router and a server (like a Windows 2000
router routing traffic from its external interface to an internal Windows
2000-based computer securing the internal path by establishing an IPSec tunnel
to the internal server providing services to the external clients). Windows 2000 IPSec tunneling is not supported for client remote access VPN use because the IETF IPSec RFCs do not currently provide a remote access solution in the Internet Key Exchange (IKE) protocol for client-to-gateway connections. The IETF RFC 2661 for Layer 2 Tunneling Protocol (L2TP) was specifically developed by Cisco, Microsoft, and others for the purpose of providing client remote access VPN connections. In Windows 2000, client remote access VPN connections are protected using an automatically generated IPSec policy that uses IPSec transport mode (not tunnel mode) when the L2TP tunnel type is selected. Windows 2000 IPSec tunneling also does not support protocol and port-specific tunnels. While the Microsoft Management Console (MMC) IPSec Policy snap-in is very general and allows you to associate any type of filter with a tunnel, make sure you use only address information in the specification of a filter for a tunnel rule. Details on how the IPSec and IKE protocols work can be found in the Microsoft Windows 2000 Resource Kit and in the Windows 2000 IPSec end-to-end walkthrough. Information about where you can find these documents is included at the end of this article. This article explains how to configure an IPSec tunnel on a Windows 2000 gateway. Because the IPSec tunnel secures only traffic specified in the IPSec filters you configure, this article also describes how to configure filters in Routing and Remote Access Service (RRAS) to prevent traffic outside the tunnel from being received or forwarded. This article outlines the following scenario to make it easy to follow the configuration steps:
NetA - Windows 2000 gateway --- Internet --- third-party gateway - NetB
W2KintIP W2KextIP 3rdExtIP 3rdIntIP
NetA is the network ID of the Windows 2000 gateway internal network. The goal is for the Windows 2000 gateway and the third-party
gateway to establish an IPSec tunnel when traffic from NetA needs to be routed
to NetB or when traffic from NetB needs to be routed to NetA so traffic is
routed over a secure session. W2KintIP is the IP address assigned to the Windows 2000 gateway internal network adapter. W2KextIP is the IP address assigned to the Windows 2000 gateway external network adapter. 3rdExtIP is the IP address assigned to the third-party gateway external network adapter. 3rdIntIP is the IP address assigned to the third-party gateway internal network adapter. NetB is the network ID of the third-party gateway internal network. You need to configure an IPSec policy. You must build two filters; one to match packets going from NetA to NetB (tunnel 1), and one to match packets going from NetB to NetA (tunnel 2). You need to configure a filter action to specify how the tunnel should be secured (a tunnel is represented by a rule, so two rules are created). How to Create IPSec PolicyTypically, a Windows 2000 gateway is not a member of a domain, so a local IPSec policy is created. If the Windows 2000 gateway is a member of a domain that has IPSec policy applied to all members of the domain by default, this prevents the Windows 2000 gateway from having a local IPSec policy. In this case, you can create an Organizational Unit (OU) in Active Directory, make the Windows 2000 gateway a member of this OU, and assign the IPSec policy to the Group Policy Object (GPO) of the OU. For more information, refer to the "Assigning IPSec Policy" section of Windows 2000 online help.
How to Build a Filter List from NetA to NetB
How to Build a Filter List from NetB to NetA
How to Configure a Rule for a NetA-to-NetB Tunnel
How to Configure a Rule for a NetB-to-NetA Tunnel
How to Assign Your New IPSec Policy to Your Windows 2000 GatewayIn the IP Security Policies on Local Machine MMC snap-in, right-click your new policy, and then click Assign. A green arrow appears in the folder icon next to your policy.After your policy is assigned, you have two additional active filters (RRAS automatically creates IPSec filters for L2TP traffic). To see the active filters, type the following command at a command prompt: netdiag /test:ipsec /debug You can optionally redirect the output of this command to a text
file so you can view it with a text editor (such as Notepad) by typing the
following command: netdiag /test:ipsec /debug > filename.txt The netdiag command is available after you install the Microsoft Windows 2000
Resource Kit, which you can install from your Windows 2000 CD-ROM. To install
the kit, locate the Support\Tools folder, and then double-click the Setup.exe
file. After installation, you may need to run the netdiag command from the %SystemRoot%\Program Files\Support Tools folder
(where %SystemRoot% is the drive where Windows 2000 is installed). The tunnel filters look similar to the following example:
Local IPSec Policy Active: 'IPSec tunnel with {tunnel endpoint}' IP Security Policy Path: SOFTWARE\Policies\Microsoft\Windows\IPSec\Policy\Local\ipsecPolicy{-longnumber-} There are two filters From NetA to NetB Filter ID: {-long number-} Policy ID: {-long number-} IPSEC_POLICY PolicyId = {-long number-} Flags: 0x0 Tunnel Addr: 0.0.0.0 PHASE 2 OFFERS Count = 1 Offer #0: ESP[ DES MD5 HMAC] Rekey: 0 seconds / 0 bytes. AUTHENTICATION INFO Count = 1 Method = Preshared key: -actual key- Src Addr: NetA Src Mask: -subnet mask- Dest Addr: NetB Dest Mask: -subnet mask- Tunnel Addr: 3rdExtIP Src Port: 0 Dest Port: 0 Protocol: 0 TunnelFilter: Yes Flags : Outbound From NetB to NetA Filter ID: {-long number-} Policy ID: {-long number-} IPSEC_POLICY PolicyId = {-long number-} Flags: 0x0 Tunnel Addr: 0.0.0.0 PHASE 2 OFFERS Count = 1 Offer #0: ESP[ DES MD5 HMAC] Rekey: 0 seconds / 0 bytes. AUTHENTICATION INFO Count = 1 Method = Preshared key: -actual key- Src Addr: NetB Src Mask: -subnet mask- Dest Addr: NetA Dest Mask: -subnet mask- Tunnel Addr: W2KextIP Src Port: 0 Dest Port: 0 Protocol: 0 TunnelFilter: Yes Flags: Inbound How to Configure RRAS FilteringIf you want to prevent traffic that does not have a source or destination address matching NetA or NetB, create an output filter for the external interface in the RRAS MMC so it drops all traffic except packets from NetA to NetB, and an input filter so it drops all traffic except packets from NetB to NetA. You also need to allow traffic to/from W2KextIP and 3rdExtIP to allow IKE negotiation when the tunnel is being created. RRAS filtering is performed above IPSec, you do not have to allow the IPSec protocol because it never reaches the IP packet filter layer. The following example is a very simple representation of the Windows 2000 TCP/IP architecture:
Application layer To configure the filters in RRAS, load the RRAS MMC and use the
following steps:
Transport layer (TCP|UDP|ICMP|RAW) ---- Network layer start ---- IP Packet Filter (where NAT/RRAS filtering is done) IPSec (where IPSec filters are implemented) Fragmentation/Reassembly ---- Network layer end ------ NDIS Interface Datalink layer Physical layer
How to Configure Static Routes in RRASThe Windows 2000 gateway needs to have a route in its route table for NetB, which you can configure by adding a static route in the RRAS MMC. If the Windows 2000 gateway is multihomed with two or more network adapters on the same external network (or two or more networks that can reach the destination tunnel IP 3rdExtIP), the potential exists for the following:
Testing Your IPSec TunnelYou can initiate the tunnel by pinging from a computer on NetA to a computer on NetB (or from NetB to NetA). If you created the filters correctly and assigned the correct policy, the two gateways establish an IPSec tunnel so they can send the ICMP traffic from the ping command in encrypted format.Even if the ping command works, you should verify that the ICMP traffic was sent in encrypted format from gateway to gateway. You can use the following tools to accomplish this. Enable Auditing for Logon Events and Object AccessThis logs events in the security log informing you if IKE security association negotiation was attempted, and if was successful or not.
IP Security MonitorThis tool shows IPSec statistics and active SAs. After you attempt to establish the tunnel using the ping command, you can see if an SA was created (if the tunnel creation is successful, an SA is displayed). If the ping command is successful but there is no SA, the ICMP traffic was not protected by IPSec. If you see a "soft association" that did not previously exist, then IPSec agreed to allow this traffic to go on the clear (without encryption).To load IP Security Monitor, click Start, click Run, and then type ipsecmon. Network MonitorYou can use Network Monitor to capture traffic going through the W2KextIP interface while you attempt to ping the computer. If you can see ICMP packets in the capture with source and destination IP addresses corresponding to the IP address of the computer from which you are pinging and the computer you are trying to ping, then IPSec is not protecting the traffic. If you do not see this ICMP traffic but see ISAKMP and ESP packets instead, IPSec is protecting traffic. If you are using just the Authentication Header (AH) IPSec protocol, you will see the ISAKMP traffic followed by the ICMP packets. ISAKMP packets are the actual IKE negotiation taking place, and ESP packets are the payload data encrypted by the IPSec protocol.You can install Network Monitor from your Windows 2000 Server CD-ROM. It is not available on the Windows 2000 Professional CD-ROM, but you can install the tool on a computer running Windows 2000 Professional if you have Microsoft Systems Management Server (SMS). For additional information about installing Network Monitor in Windows 2000, click the following article number to view the article in the Microsoft Knowledge Base: 243270
(http://support.microsoft.com/kb/243270/
)
How to install Network Monitor in Windows 2000
Actual Test
314764
(http://support.microsoft.com/kb/314764/
)
Using Internet Protocol Security with Network Address Translation and Internet Security Acceleration Server
For more information about RRAS, see Windows 2000
Help. To access Help online, visit the following Microsoft Web site: http://technet.microsoft.com/en-us/windowsserver/2000/bb735359.aspx
(http://technet.microsoft.com/en-us/windowsserver/2000/bb735359.aspx)
You can find the Windows 2000 Resource Kit, walkthroughs, and
other technical documentation at the following Microsoft Web site: http://technet.microsoft.com/en-us/windowsserver/2000/default.aspx
(http://technet.microsoft.com/en-us/windowsserver/2000/default.aspx)
For additional information about soft associations, click
the following article number to view the article in the Microsoft Knowledge
Base: 234580
(http://support.microsoft.com/kb/234580/
)
'Soft associations' between IPSec-enabled and non-IPSec-enabled computers
For IETF standards information, refer to the
appropriate Web sites:
| Article Translations
|
Back to the top
