Article ID: 816514 - Last Review: December 3, 2007 - Revision: 6.4 How To Configure IPSec Tunneling in Windows Server 2003
For a Microsoft Windows 2000 version of this article, see 252735
(http://support.microsoft.com/kb/252735/EN-US/
)
.
IN THIS TASK
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 Windows Server 2003 is for interoperability with non-Microsoft
routers or gateways that do not support Layer 2 Tunneling Protocol (L2TP)/IPSec
or PPTP virtual private network (VPN) tunneling technology. back to the top Windows Server 2003 supports IPSec tunneling for situations
where both tunnel endpoints have static IP addresses. This is primarily useful
in gateway-to-gateway implementations. However, it may also work for specialized
network security scenarios between a gateway or router and a server. (For example, a
Windows Server 2003 router that routes traffic from its external interface to an
internal Windows Server 2003-based computer that secures the internal path by
establishing an IPSec tunnel to the internal server that provides services to the
external clients). Windows Server 2003 IPSec tunneling is not supported for client remote access VPN use because the Internet Engineering Task Force (IETF) IPSec Requests for Comments (RFCs) do not currently provide a remote access solution in the Internet Key Exchange (IKE) protocol for client-to-gateway connections. IETF RFC 2661, Layer Two Tunneling Protocol "L2TP," was specifically developed by Cisco, Microsoft, and others to provide client remote access VPN connections. In Windows Server 2003, 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 Server 2003 IPSec tunneling also does not support protocol-specific 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 that you use only address information in the specification of a filter for a tunnel rule. For more information about how the IPSec and IKE protocols work, see the Microsoft Windows Server 2003 Resource Kit. This article describes how to configure an IPSec tunnel on a Windows Server 2003 gateway. Because the IPSec tunnel secures only traffic that is specified in the IPSec filters that you configure, this article also describes how to configure filters in the Routing and Remote Access service to prevent traffic outside the tunnel from being received or forwarded. This article uses the following scenario to make it easy to follow the configuration steps: Collapse this table
NetA is the network ID of the Windows Server 2003 gateway internal network. WIN2003intIP is the IP address that is assigned to the Windows Server 2003 gateway internal network adapter. WIN2003extIP is the IP address that is assigned to the Windows Server 2003 gateway external network adapter. 3rdExtIP is the IP address that is assigned to the non-Microsoft gateway external network adapter. 3rdIntIP is the IP address that is assigned to the non-Microsoft gateway internal network adapter. NetB is the network ID of the non-Microsoft gateway internal network. The goal is for the Windows Server 2003 gateway and the non-Microsoft gateway to establish an IPSec tunnel when traffic from NetA must be routed to NetB or when traffic from NetB must be routed to NetA so traffic is routed over a secure session. If you want to configure an IPSec policy, you must build two filters: one filter to match packets going from NetA to NetB (tunnel 1), and one filter to match packets going from NetB to NetA (tunnel 2). You must configure a filter action to specify how the tunnel is secured (a tunnel is represented by a rule, so two rules are created). back to the top Create IPSec PolicyTypically, a Windows Server 2003 gateway is not a member of a domain, so a local IPSec policy is created. If the Windows Server 2003 gateway is a member of a domain that has IPSec policy applied to all members of the domain by default, this prevents the Windows Server 2003 gateway from having a local IPSec policy. In this case, you can create an organizational unit in Active Directory, make the Windows Server 2003 gateway a member of this organizational unit, and assign the IPSec policy to the Group Policy object (GPO) of the organizational unit. For more information, see the "Creating, modifying, and assigning IPSec policies" section of Windows Server 2003 online Help.
back to the top Build a Filter List from NetA to NetB
Build a Filter List from NetB to NetA
Configure a Rule for a NetA-to-NetB Tunnel
Configure a Rule for a NetB-to-NetA Tunnel
Assign Your New IPSec Policy to Your Windows Server 2003 GatewayIn the IP Security Policies on Local Computer 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 (Routing and Remote Access 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 Server 2003 Support Tools. To install the Support Tools, locate the
Support\Tools folder on your Windows Server 2003 CD-ROM, right-click the Suptools.msi file, and then click Install. After installation, you may have to run the
netdiag command from the %SystemRoot%\Program Files\Support
Tools folder (where %SystemRoot% is the drive where Windows Server 2003 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: InboundConfigure Routing and Remote Access FilteringIf you want to prevent traffic that does not have a source or destination address that matches NetA or NetB, create an output filter for the external interface in the Routing and Remote Access MMC so that the filter drops all traffic except packets from NetA to NetB. Also create an input filter so the filter drops all traffic except packets from NetB to NetA. You also have to allow traffic to and from WIN2003extIP and 3rdExtIP to allow IKE negotiation when the tunnel is being created. Routing and Remote Access filtering is performed over IPSec. You do not have to specifically allow the IPSec protocol because it never reaches the IP packet filter layer. The following example is a very simple representation of the Windows Server 2003 TCP/IP architecture:Application layer Transport layer (TCP|UDP|ICMP|RAW) ---- Network layer start ---- IP Packet Filter (where NAT/Routing and Remote Access filtering is done) IPSec (where IPSec filters are implemented) Fragmentation/Reassembly ---- Network layer end ------ NDIS Interface Datalink layer Physical layer
Configure Static Routes in Routing and Remote AccessThe Windows Server 2003 gateway must have a route in its route table for NetB. To configure this route, add a static route in the Routing and Remote Access MMC. If the Windows Server 2003 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:
Test 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, verify that the ICMP traffic was sent in encrypted format from gateway to gateway. You can use the following tools to do this.back to the top Enable Auditing for Logon Events and Object AccessThis logs events in the security log. This tells you if IKE security association negotiation was tried and if it was successful or not.
IP Security MonitorThe IP Security Monitor console shows IPSec statistics and active security associations (SA). After you try to establish the tunnel by 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). 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/EN-US/
)
"Soft Associations" Between IPSec-Enabled and Non-IPSec-Enabled Computers Note In Microsoft Windows XP and the Windows Server 2003 family, IP Security Monitor is implemented as a Microsoft Management Console (MMC) console. To add the IP Security Monitor snap-in, follow these steps:
Network MonitorYou can use Network Monitor to capture traffic going through the WIN2003extIP interface while you try to ping the computer. If you can see ICMP packets in the capture file that have source and destination IP addresses that correspond to the IP addresses of the computer that you are pinging from and the computer you are trying to ping, then IPSec is not protecting the traffic. If you do not see this ICMP traffic but do see ISAKMP and ESP packets instead, IPSec is protecting the traffic. If you are using only the Authentication Header (AH) IPSec protocol, you will see the ISAKMP traffic followed by the ICMP packets. ISAKMP packets are the actual IKE negotiation occurring, and ESP packets are the payload data encrypted by the IPSec protocol.To install Network Monitor, follow these steps:
Actual Test
REFERENCES For more information about the Routing and Remote Access
service, see Windows Server 2003 online Help. To view the Windows Server 2003 Resource Kit and other technical documentation, visit the following Microsoft Web site: http://www.microsoft.com/windowsserver2003/default.mspx
(http://www.microsoft.com/windowsserver2003/default.mspx)
For IETF standards information, visit the following sites:
APPLIES TO
| Article Translations
|
Back to the top
