How to configure ipsec tunneling in window
The Information in this Article Applies TO:
Microsoft Windows 2000 Advanced Server Microsoft Windows 2000 Datacenter Server Microsoft Windows 2000 Server
Summary
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 2000 is for interoperability with Third-Party Routers or Gateway That Do Not Support Layer 2 Tunneling Protocol (L2TP) / IPsec Or PPTP Virtual Private Networking (VPN) Tunnely 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 USI ng an automatically generated IPSec policy that uses IPSec 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 transport -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 include 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.
W2kintip is the ip address assigned to the window adapter.
W2kextip is the ip address assigned to the window.
3rdextip is the ip address assigned to the third-party gateway external network adapter.
3rdintip is the ip address assigned to the third-partgy gateway interface.
Netb is the network id of the third-partgy gateway interface.
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.
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 create).
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.Use the MMC to work on the IP Security Policy Management snap-in (a quick way to load this is to click Start, click Run, and then type secpol.msc). Right-click IP Security Policies on Local Machine, and then click Create IP Security Policy. Click Next, and then type a name for your policy (for example, IPSec Tunnel With third-partgy gateway) .note: you can also type more informatio N in The Description Box. Click To Clear The Activate The Default Response Rule Check Box, and The Click Next. Click Finish (Keep The Edit Check Box SELECTED).
Note: The IPsec Policy Is Created with Default Settings for the Ike Main Mode (Phase 1) on The
General Tab, IN
Key Exchange. The IPSec tunnel consists of two rules, each of which specifies a tunnel endpoint. Because there are two tunnel endpoints, there are two rules. The filters in each rule must represent the source and destination IP addresses in IP packets that are sent To this rule's tunnel endpoint.
How to build a filter list from neta to netb
In the new policy properties, click to clear the Use Add Wizard check box, and then click Add to create a new rule. On the IP Filter List tab, click Add. Type an appropriate name for the filter list, click to clear the Use Add Wizard check box, and then click Add. in the Source address area, click A specific IP Subnet, and then fill in the IP address and Subnet mask boxes to reflect NetA. in the Destination address area, click A specific IP Subnet, and fill in the IP Address and Subnet mask boxes to reflect NetB. Click to clear the Mirrored check box. On the Protocol tab, make sure the protocol type is set to Any, because IPSec tunnels do not support protocol-specific or port-specific filters . If you want to type a description for your filter, click the Description tab. It is generally a good idea to give the filter the same name you used for the filter list. The filter name is displayed in the IPSec monitor when the tunnel is Active. Click Ok, and The Click Close.how To Build A Filte R list from netb to neta
On the IP Filter List tab, click Add. Type an appropriate name for the filter list, click to clear the Use Add Wizard check box, and then click Add. In the Source address area, click A specific IP Subnet, and then fill in the IP address and Subnet mask boxes to reflect NetB. in the Destination address area, click A specific IP Subnet, and fill in the IP address and Subnet mask boxes to reflect NetA. Click to clear the Mirrored check box. If you want to type A Description for your filter, Click The Description Tab. Click OK, And The Click Close.
How to configure a rule for a Neta-to-Netb Tunnel
On the IP Filter List tab, click the filter list you created. On the Tunnel Setting tab, click The tunnel endpoint is specified by this IP Address box, and then type 3rdextip (where 3rdextip is the IP address assigned to the third-party gateway external network adapter). On the Connection Type tab, click All network connections (or click LAN connections if W2KextIP is not an ISDN, PPP, or direct connect serial connection). On the Filter Action tab, click to clear the Use Add Wizard check box, and then click Add to create a new filter action because the default actions allow incoming traffic in the clear. Keep the Negotiate security option enabled, and click to clear the Accept unsecured communication, but always respond using IPSec check box. You must do this to ensure secure operation.NOTE: None of the check boxes at the bottom of the filter Action dialog box should be checked as an initial configuration for a filter action that applies to tunnel rules Only the Perfect Forward Secrec. y (PFS) check box is a valid setting for tunnels if the other end of the tunnel is also configured to use PFS. The other two check boxes are not valid for tunnel filter actions. Click Add, and keep the High (ESP) option selected (or you can select the Custom (for expert users) option if you want to define specific algorithms and session key lifetimes). Encapsulating Security Payload (ESP) is one of the two IPSec protocols. Click OK. On the General tab, type a name for the new filter action (for example, ipsec tunnel:
ESP DES / MD5), and then click OK. Select the filter action you just created. On the Authentication Methods tab, configure the authentication method you want (use preshared key for testing, otherwise, use certificates). Kerberos is technically possible if both ends of the tunnel are in trusted domains, and that trusted domain's IP address (IP address of a domain controller) is reachable on the network by both ends of the tunnel during IKE negotiation of the tunnel (before it is established). This is a Rare Case. Click Close.how to configure a Rule for a Netb-to-Neta Tunnel
In IPSec policy properties, click Add to create a new rule. On the IP Filter List tab, click the filter list you created (from NetB to NetA). On the Tunnel Setting tab, click The tunnel endpoint is specified by this IP Address box , and then type w2kextip (where w2kextip is the IP address assigned to the Windows 2000 gateway external network adapter). On the Connection Type tab, click All network connections (or click LAN connections if W2KextIP is not an ISDN, PPP, or direct connect serial connection). Any outbound traffic on the interface type that matches the filters attempts to be tunneled to the tunnel endpoint specified in the rule. Inbound traffic that matches the filters is discarded because it should be received secured by an IPSec tunnel. On the Filter Action tab, click the filter action you created. On the Authentication Methods tab, configure the same method used in the first rule (same method must be used in both rules). Click Close, make sure both rules you created are ena Bled in Your Policy, And The Click Close.
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 clickAssign. 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 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 is 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
TRANSPORT LAYER (TCP | UDP | ICMP | RAW)
---- NetWork Layer Start ----
IP Packet Filter (Where Nat / Rras Filtering IS DONE)
IPSec (Where ipsec filters areware
Fragmentation / ReassemblyMbly
---- NetWork Layer End --------
NDIS Interface
Datalink Layer
Physical Layer
To configure the filters in raas, load the ras mmc and use the following steps:
Expand your server tree under Routing and Remote Access, expand the IP Routing subtree, and then click General. Right-click W2KextIP, and then click Properties. Click Output Filters, and then click Add. Click to select the Source network and Destination network check boxes. in the Source network area, fill in the IP address and Subnet mask boxes to reflect NetA. in the Destination network area, fill in the IP address and Subnet mask boxes to reflect NetB. Keep the protocol set to Any, and then click OK. Click Add, and then click to select the Source network and Destination network check boxes. in the Source network area, fill in the IP address and Subnet mask boxes to reflect W2KextIP. in the Destination network area, fill in the IP address and Subnet mask boxes to reflect 3rdExtIP (for IKE negotiation use subnet mask of 255.255.255.255). Keep the protocol set to Any, and then click OK. Click to select the Drop all packets except those that meet the criteria below check box, and then c lick OK. Click Input Filters, click Add, and then click to select the Source network and Destination network check boxes. In the Source network area, fill in the IP address and Subnet mask boxes to reflect NetB. In the Destination network area, fill in the IP address and Subnet mask boxes to reflect NetA. Keep the protocol set to Any, and then click OK. Click Add, and then click to select the Source network and Destination network check boxes. in the Source network area, fill in the IP address and Subnet mask boxes to reflect 3rdExtIP. in the Destination network area, fill in the IP address and Subnet mask boxes to reflect W2KextIP (or IKE negotiation use subnet mask of 255.255.255.255). Keep the protocol set to Any, and then Click OK.
Click to select the Drop all packets except those that meet the criteria below check box, and then click OK twice.NOTE: If the RRAS server has more than one interface connected to the Internet, or if you have multiple IPSec tunnels, type RRAS exempt Filters for Each IPsec Tunnel (Each Source and Destination IP Subnet) for Every Internet Interface.
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:
Outbound tunnel traffic leaves on one interface, and the inbound tunnel traffic is received on a different interface. Even if you use IPSec offload network adapters, receiving on a different interface (than outbound tunnel traffic is sent on) does not allow the receiving network adapter to process the encryption in hardware, because only the outbound interface gets to offload the Security Association (SA). outbound tunnel traffic leaves on an interface that is different than the interface that has the tunnel endpoint IP address. The source IP of the tunneled packet is the source IP on the outbound interface. If this is not the source IP that is expected by the other end, the tunnel is not established (or packets are dropped by the remote endpoint if the tunnel has already been established) .To address the Issue of sending outbound tunnel Traffic on the Wrong Interface, Define a static route to bind traffic to netb to the appropriate External Interface:
In the RRAS MMC, expand your server tree, expand the IP Routing subtree, right-click Static Routes, and then click New Static Route. In the Interface area, click W2KextIP (if this is the interface you want to always use for outbound tunnel . traffic) Fill the Destination and Network Mask boxes to reflect NetB In the Gateway box, type 3rdextip Keep the Metric value set to its default (1), and then click OK.NOTE:.. to address the issue of receiving inbound tunnel traffic On The Wrong Interface, Do Not Advertise The Interface's IP Address Using A Routing Protocol and configure a filter in raas to drop packets to neta or
W2kextip as indeicated in "How to configure ras filtering" section of this article.
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 trafficient from the icmp
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 AUSSS Events in The Security Log Informing You '
Using the Group Policy MMC snap-in, expand Local Computer Policy, and go to Computer Configuration / Windows Settings / Security Settings / Local Policies / Audit Policy. Enable success and failure auditing for "Audit logon events" and "Audit object access."
NOTE:. If the Windows 2000 gateway is a member of a domain and if you are using a domain policy for auditing, the domain policy overwrites your local policy In this case, modify the domain policy.IP Security MonitorThis tool shows IPSec statistics and active Sas. After you attempt to establish the tunnel using
Ping Command, You Can See IF AN SA WAS CREATED (IF The Tunnel Create Is Successful, An SA Is Displayed). if The 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 ..........................
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 Article Number Below To View The Article In The Microsoft Knowledge Base:
Q243270 HOW To Install Network Monitor in Windows 2000
Actual test
Before you attempt to ping from a computer on one subnet to the other (NetA or NetB), type ipconfig at a command prompt. The network interfaces that are initialized in the TCP / IP stack are displayed. Run the IP Security Monitor tool. Load Network Monitor, click Capture / Network, and then click the W2KextIP interface (you can start a capture by clicking Capture / Start). Attempt to ping the computer. The first ICMP echo packets may timeout while the IPSec tunnel is being built. If the ping attempt is not successful, check the security and system logs. If the ping attempt is successful, stop the Network Monitor capture and see if the ICMP traffic went on the clear or if you just see the ISAKMP and IPSec protocol packets. Check IP Security Monitor to see if an SA was created using the NetA to NetB filter you created. Also check the security log. you should see Event ID 541 (IKE security association established). Type ipconfig at a command prompt again so you see that there is no Additional T CP / IP interface while the tunnel is up This is because IPSec is actually protecting the traffic going through the physical interface (W2KextIP) .If the remote gateway is also a Windows 2000 node, keep in mind the following information.:
The default gateway for clients in NetA should be W2KextIP;. The default gateway for clients in NetB should be 3rdIntIP An IPSec tunnel does not change the way traffic is routed in the Windows 2000 gateway (which is able to route packets because routing is enabled in RRAS; the actual LAN or WAN interface metrics are still used.For more information on RRAS, please see the Windows 2000 online help, which is also available on the following Microsoft Web site: http: //www.microsoft.com/windows2000/ TechInfo / Proddoc / Default.asp
You Can Find The Windows 2000 Resource Kit, Walkthroughs, AND Other Technical Documentation At the Following Microsoft Web Site:
http://www.microsoft.com/windows2000/techinfo/planning/
For Additional Information, Click The Article Number Below to View The Article In The Microsoft Knowledge Base:
Q234580 'Soft Associations' Between IPsec-enabled and non-ipsec-enabled Computes
For Ietf Standards Information, Refer to the appropriate Web Sites:
IPsec
http://www.ietf.org/html.charters/ipsec-charter.html
L2TP
Http://www.ietf.org/html.charters/pppext-charter.html
ftp://ftp.isi.edu/in-notes/rfc2661.txt
http://www.ieetf.org/html.charters/l2tpext-charter.html
The third-party contact information included in this article is provided to help you find the technical support you need. This contact information is subject to change without notice. Microsoft in no way guarantees the accuracy of this third-party contact information.