{"id":1944,"date":"2014-01-16T10:36:25","date_gmt":"2014-01-16T10:36:25","guid":{"rendered":"http:\/\/mccltd.net\/blog\/?p=1944"},"modified":"2015-03-09T12:50:45","modified_gmt":"2015-03-09T12:50:45","slug":"1944","status":"publish","type":"post","link":"http:\/\/darenmatthews.com\/blog\/?p=1944","title":{"rendered":"Understanding IPSec VPN"},"content":{"rendered":"<p>IPSec involves many component technologies and encryption methods. Yet IPSec&#8217;s operation can be broken down into five main steps. The five steps are summarised as follows:<\/p>\n<table border=\"0\" width=\"100%\" cellspacing=\"2\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td width=\"10\"><\/td>\n<td valign=\"top\" width=\"15\"><b>Step 1<\/b><\/td>\n<td valign=\"top\" width=\"90%\"><b>Interesting traffic initiates the IPSec process<\/b>\u2014Traffic is deemed interesting when the IPSec security policy configured in the IPSec peers starts the IKE process.<\/td>\n<\/tr>\n<tr>\n<td width=\"10\"><\/td>\n<td valign=\"top\" width=\"15\"><b>Step 2<\/b><\/td>\n<td valign=\"top\" width=\"90%\"><b>IKE phase one<\/b>\u2014IKE authenticates IPSec peers and negotiates IKE SAs during this phase, setting up a secure channel for negotiating IPSec SAs in phase two.<\/td>\n<\/tr>\n<tr>\n<td width=\"10\"><\/td>\n<td valign=\"top\" width=\"15\"><b>Step 3<\/b><\/td>\n<td valign=\"top\" width=\"90%\"><b>IKE phase two<\/b>\u2014IKE negotiates IPSec SA parameters and sets up matching IPSec SAs in the peers.<\/td>\n<\/tr>\n<tr>\n<td width=\"10\"><\/td>\n<td valign=\"top\" width=\"15\"><b>Step 4<\/b><\/td>\n<td valign=\"top\" width=\"90%\"><b>Data transfer<\/b>\u2014Data is transferred between IPSec peers based on the IPSec parameters and keys stored in the SA database.<\/td>\n<\/tr>\n<tr>\n<td width=\"10\"><\/td>\n<td valign=\"top\" width=\"15\"><b>Step 5<\/b><\/td>\n<td valign=\"top\" width=\"90%\"><b>IPSec tunnel termination<\/b>\u2014IPSec SAs terminate through deletion or by timing out.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>A crypto map<\/b>\u2014is a Cisco IOS software configuration entity that performs two primary functions. First, it selects data flows that need security processing. Second, it defines the policy for these flows and the crypto peer that traffic needs to go to. A crypto map is applied to an interface. The concept of a crypto map was introduced in classic crypto but was expanded for IPsec.\u00a0 This aide-memoir pulls together items from Cisco.com to provide a useful recipe and refresher.<!--more--><\/p>\n<p><strong>STEP 1 (configure Interfaces):<\/strong><br \/>\nhostname(config)#interface ethernet0<br \/>\nhostname(config-if)#ip address 10.10.4.100 255.255.0.0<br \/>\nhostname(config-if)#no shutdown<\/p>\n<p><strong>STEP 2 (configure ISAKMP)<\/strong> &#8211; The negotiation protocol that allows hosts to agree IPSec security associations):<br \/>\nEach ISAKMP negotiation is divided into two sections called Phase1 and Phase 2.<br \/>\n&#8211; <strong>Phase 1 creates the first tunnel, which protects later ISAKMP negotiation messages<\/strong>.<br \/>\n&#8211; <strong>Phase 2 creates the tunnel that protects data travelling across the secure connection<\/strong>.<\/p>\n<p><strong>IKE PHASE ONE:<\/strong><br \/>\nThe basic purpose of IKE phase one is to authenticate the IPSec peers and to set up a secure channel between the peers to enable IKE exchanges. IKE phase one performs the following functions:<\/p>\n<ul>\n<li>&#8211; Authenticates and protects the identities of the IPSec peers<\/li>\n<li>&#8211; Negotiates a matching IKE SA policy between peers to protect the IKE exchange<\/li>\n<li>&#8211; Performs an authenticated Diffie-Hellman exchange with the end result of having matching shared secret keys<\/li>\n<li>&#8211; Sets up a secure tunnel to negotiate IKE phase two parameters<\/li>\n<\/ul>\n<p>IKE phase one occurs in two modes:<\/p>\n<ul>\n<li>&#8211; Main mode<\/li>\n<li>&#8211; Aggressive mode<\/li>\n<\/ul>\n<p id=\"jN2428E\" class=\"Para1\" align=\"left\">Phase\u00a01 can take place in either Main or Aggressive mode.<\/p>\n<p id=\"jN24293\" class=\"Para1\" align=\"left\"><strong><span class=\"ExampleInline\">Main mode<\/span><\/strong>\u2014The initiator and recipient send three two-way exchanges (six messages total) to accomplish the following services:<\/p>\n<ul>\n<li>First exchange (messages 1 and 2\u2014Propose and accept the encryption and authentication algorithms.<\/li>\n<li>Second exchange (messages 3 and 4\u2014Execute a Diffie-Hellman exchange, and the initiator and recipient each provide a pseudo-random number.<\/li>\n<li>Third exchange (messages 5 and 6)\u2014Send and verify their identities.<\/li>\n<\/ul>\n<p id=\"jN242C7\" class=\"Para1\" align=\"left\">The information transmitted in the third exchange of messages is protected by the encryption algorithm established in the first two exchanges. Thus, the participants&#8217; identities are not transmitted in the clear.<\/p>\n<p id=\"jN242CC\" class=\"Para1\" align=\"left\"><strong><span class=\"ExampleInline\">Aggressive Mode<\/span><\/strong>\u2014The initiator and recipient accomplish the same objectives, but in only two exchanges, with a total of three messages:<\/p>\n<ul>\n<li>First message\u2014The initiator proposes the SA, initiates a Diffie-Hellman exchange, and sends a pseudo-random number and its IKE identity.<\/li>\n<li>Second message\u2014The recipient accepts the SA; authenticates the initiator; and sends a pseudo-random number, its IKE identity, and, if using certificates, the recipient&#8217;s certificate.<\/li>\n<li>Third message\u2014The initiator authenticates the recipient, confirms the exchange, and, if using certificates, sends the initiator&#8217;s certificate.<\/li>\n<\/ul>\n<p id=\"jN24300\" class=\"Para1\" align=\"left\">Because the participants&#8217; identities are exchanged in the clear (in the first two messages), Aggressive mode does not provide identity protection.<\/p>\n<p class=\"Para1\" align=\"left\"><span style=\"text-decoration: underline;\"><strong>MAIN MODE AND AGGRESSIVE MODE:<\/strong><\/span><\/p>\n<p><a href=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/IKE-MM-and-AM.gif\"><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1965\" src=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/IKE-MM-and-AM.gif\" alt=\"IKE-MM-and-AM\" width=\"400\" height=\"232\" \/><\/a><\/p>\n<p><strong>Main Mode<\/strong><br \/>\nIKE MM has three two-way exchanges between the initiator and receiver:<\/p>\n<ul>\n<li>&#8211; <strong>First exchange<\/strong>\u2014The algorithms and hashes used to secure the IKE communications are agreed upon in matching IKE SAs in each peer:<a href=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/IKE-phase-1-transform-sets.jpg\"><img loading=\"lazy\" class=\"aligncenter size-full wp-image-2009\" src=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/IKE-phase-1-transform-sets.jpg\" alt=\"IKE-phase-1-transform-sets\" width=\"601\" height=\"375\" srcset=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/IKE-phase-1-transform-sets.jpg 601w, http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/IKE-phase-1-transform-sets-300x187.jpg 300w\" sizes=\"(max-width: 601px) 100vw, 601px\" \/><\/a><\/li>\n<li>&#8211;<strong> Second exchange<\/strong>\u2014This exchange uses a Diffie-Hellman exchange to generate shared secret keying material used to generate shared secret keys and to pass nonces, which are random numbers sent to the other party, signed, and returned to prove their identity:<\/li>\n<li>&#8211; <strong>Third exchange<\/strong>\u2014This exchange verifies the other side&#8217;s identity. The identity value is the IPSec peer&#8217;s IP address in encrypted form. The main outcome of main mode is matching IKE SAs between peers to provide a protected pipe for subsequent protected ISAKMP exchanges between the IKE peers. The IKE SA specifies values for the IKE exchange: the authentication method used, the encryption and hash algorithms, the Diffie-Hellman group used, the lifetime of the IKE SA in seconds or kilobytes, and the shared secret key values for the encryption algorithms. The IKE SA in each peer is bidirectional.<a href=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/IKE-phase-1.jpg\"><img loading=\"lazy\" class=\"aligncenter size-full wp-image-2008\" src=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/IKE-phase-1.jpg\" alt=\"IKE-phase-1\" width=\"546\" height=\"227\" srcset=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/IKE-phase-1.jpg 546w, http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/IKE-phase-1-300x124.jpg 300w\" sizes=\"(max-width: 546px) 100vw, 546px\" \/><\/a><\/li>\n<\/ul>\n<p><strong>Aggressive Mode<\/strong>:<br \/>\nIn the aggressive mode, fewer exchanges are done and with fewer packets. In the first exchange, almost everything is squeezed into the proposed IKE SA values, the Diffie-Hellman public key, a nonce that the other party signs, and an identity packet, which can be used to verify the initiator&#8217;s identity through a third party. The receiver sends everything back that is needed to complete the exchange. The only thing left is for the initiator to confirm the exchange. The weakness of using the aggressive mode is that both sides have exchanged information before there is a secure channel. Therefore, it is possible to sniff the wire and discover who formed the new SA. However, aggressive mode is faster than main mode.<\/p>\n<p><strong>IKE PHASE TWO<\/strong>:<br \/>\nThe purpose of IKE phase two is to negotiate IPSec SAs to set up the IPSec tunnel. IKE phase two performs the following functions:<\/p>\n<ul>\n<li>&#8211; Negotiates IPSec SA parameters protected by an existing IKE SA<\/li>\n<li>&#8211; Establishes IPSec security associations<\/li>\n<li>&#8211; Periodically renegotiates IPSec SAs to ensure security<\/li>\n<li>&#8211; Optionally performs an additional Diffie-Hellman exchange<\/li>\n<\/ul>\n<p><a href=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/IKE-phase-2.jpg\"><img loading=\"lazy\" class=\"aligncenter size-full wp-image-2012\" src=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/IKE-phase-2.jpg\" alt=\"IKE-phase-2\" width=\"535\" height=\"154\" srcset=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/IKE-phase-2.jpg 535w, http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/IKE-phase-2-300x86.jpg 300w\" sizes=\"(max-width: 535px) 100vw, 535px\" \/><\/a><a href=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/IKE-phase-2-transform-sets.jpg\"><img loading=\"lazy\" class=\"aligncenter size-full wp-image-2013\" src=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/IKE-phase-2-transform-sets.jpg\" alt=\"IKE-phase-2-transform-sets\" width=\"527\" height=\"370\" srcset=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/IKE-phase-2-transform-sets.jpg 527w, http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/IKE-phase-2-transform-sets-300x210.jpg 300w\" sizes=\"(max-width: 527px) 100vw, 527px\" \/><\/a><a href=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/sa.jpg\"><img loading=\"lazy\" class=\"aligncenter size-full wp-image-2011\" src=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/sa.jpg\" alt=\"sa\" width=\"648\" height=\"403\" srcset=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/sa.jpg 648w, http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/sa-300x186.jpg 300w\" sizes=\"(max-width: 648px) 100vw, 648px\" \/><\/a><\/p>\n<p>IKE phase 2 has one mode, called quick mode. Quick mode occurs after IKE has established the secure tunnel in phase one. It negotiates a shared IPSec policy, derives shared secret keying material used for the IPSec security algorithms, and establishes IPSec SAs. Quick mode exchanges nonces that provide replay protection. The nonces are used to generate new shared secret key material and prevent replay attacks from generating bogus SAs.<\/p>\n<p>Quick mode is also used to renegotiate a new IPSec SA when the IPSec SA lifetime expires. Base quick mode is used to refresh the keying material used to create the shared secret key based on the keying material derived from the Diffie-Hellman exchange in phase one.<br \/>\nPerfect Forward Secrecy<\/p>\n<p>If perfect forward secrecy (PFS) is specified in the IPSec policy, a new Diffie-Hellman exchange is performed with each quick mode, providing keying material that has greater entropy (key material life) and thereby greater resistance to cryptographic attacks. Each Diffie-Hellman exchange requires large exponentiations, thereby increasing CPU use and exacting a performance cost.<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Configuring Cisco ASA ISAKMP Policies:<\/strong><\/span><\/p>\n<p>To configure ISAKMP policies, in global configuration mode use the isakmp policy command with its various arguments. The syntax for ISAKMP policy commands is as follows: isakmp policy priority attribute_name [attribute_value | integer].<\/p>\n<p>Set the policy to define:<br \/>\nhostname(config)#isakmp policy 1 authentication pre-share\u00a0 &lt;=== authentication method (to ensure identity of peers)<br \/>\nhostname(config)#isakmp policy 1 encryption 3des\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;=== encryption method (to ensure privacy)<br \/>\nhostname(config)#isakmp policy 1 hash sha\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;=== Hashed Message Authentication Codes method to ensure identity of peer and message integrity<br \/>\nhostname(config)#isakmp policy 1 group 2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;=== A Diffie-Hellman group (establish the strength of the encryption-key-determination algorithm)<br \/>\nhostname(config)#isakmp policy 1 lifetime 43200\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;=== A time limit for how long the ASA uses an encryption key before replacing it<br \/>\nhostname(config)#isakmp enable outside<\/p>\n<p><a href=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/AES-MD5-HMAC.png\"><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1960\" src=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/AES-MD5-HMAC.png\" alt=\"AES-MD5-HMAC\" width=\"482\" height=\"218\" srcset=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/AES-MD5-HMAC.png 482w, http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/AES-MD5-HMAC-300x135.png 300w\" sizes=\"(max-width: 482px) 100vw, 482px\" \/><\/a><\/p>\n<p><strong>STEP 3 (Create Transform Set):<\/strong><br \/>\nA transform set combines an encryption method and an authentication method. During the IPsec security association negotiation with ISAKMP, the peers agree to use a particular transform set to protect a particular data flow. The transform set must be the same for both peers.<\/p>\n<p>A transform set protects the data flows for the access list specified in the associated crypto map entry. You can create transform sets in the ASA configuration, and then specify a maximum of 11 of them in a crypto map or dynamic crypto map entry.<\/p>\n<p>Tunnel Mode is the usual way to implement IPsec between two ASAs that are connected over an untrusted network, such as the public Internet. Tunnel mode is the default and requires no configuration.<\/p>\n<p><a href=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/AH-transport-and-tunnel.png\"><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1951\" src=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/AH-transport-and-tunnel.png\" alt=\"AH-transport-and-tunnel\" width=\"548\" height=\"502\" srcset=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/AH-transport-and-tunnel.png 855w, http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/AH-transport-and-tunnel-300x275.png 300w\" sizes=\"(max-width: 548px) 100vw, 548px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/IPSec-AH-Transport-Mode.gif\"><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1953\" src=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/IPSec-AH-Transport-Mode.gif\" alt=\"IPSec-AH-Transport-Mode\" width=\"593\" height=\"522\" \/><\/a><a href=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/IPSec-AH-Tunnel-Mode.gif\"><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1955\" src=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/IPSec-AH-Tunnel-Mode.gif\" alt=\"IPSec-AH-Tunnel-Mode\" width=\"593\" height=\"667\" \/><\/a><\/p>\n<p><strong>ENCRYPTION:<\/strong><br \/>\nEncapsulating Security Payload<\/p>\n<p><a href=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/encapsulating-security-payload.png\"><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1945\" src=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/encapsulating-security-payload.png\" alt=\"encapsulating-security-payload\" width=\"718\" height=\"288\" srcset=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/encapsulating-security-payload.png 992w, http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2014\/01\/encapsulating-security-payload-300x120.png 300w\" sizes=\"(max-width: 718px) 100vw, 718px\" \/><\/a><br \/>\nEncapsulating Security Payload (ESP) is a member of the IPsec protocol suite. In IPsec it provides origin authenticity, integrity and confidentiality protection of packets. ESP also supports encryption-only and authentication-only configurations, but using encryption without authentication is strongly discouraged because it is insecure.[15][16][17] Unlike Authentication Header (AH), ESP in transport mode does not provide integrity and authentication for the entire IP packet. However, in Tunnel Mode, where the entire original IP packet is encapsulated with a new packet header added, ESP protection is afforded to the whole inner IP packet (including the inner header) while the outer header (including any outer IPv4 options or IPv6 extension headers) remains unprotected. ESP operates directly on top of IP, using IP protocol number 50.<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Valid Encryption Methods:<\/strong><\/span><br \/>\nesp-des<br \/>\nesp-3des (default)<br \/>\nesp-aes (128-bit encryption)<br \/>\nesp-aes-192<br \/>\nesp-aes-256<br \/>\nesp-null<\/p>\n<p><strong>AUTHENTICATION:<\/strong><br \/>\nIn cryptography, a keyed-hash message authentication code (HMAC) is a specific construction for calculating a message authentication code (MAC) involving a cryptographic hash function in combination with a secret cryptographic key. As with any MAC, it may be used to simultaneously verify both the data integrity and the authentication of a message. Any cryptographic hash function, such as MD5 or SHA-1, may be used in the calculation of an HMAC; the resulting MAC algorithm is termed HMAC-MD5 or HMAC-SHA1<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Valid Authentication Methods:<\/strong><\/span><br \/>\nesp-md5-hmac (Hash-based message authentication code)<br \/>\nesp-sha-hmac<\/p>\n<p>hostname(config)#crypto ipsec transform set FirstSet esp-3des esp-md5-hmac<\/p>\n<p><strong>STEP 4 (Create an ACL):<\/strong><br \/>\nNOTE: An ACL for VPN traffic uses the translated address. These are IP Addresses Used for Access Lists When You Use NAT:<\/p>\n<p>For the following features, you should always use the real IP address in the access list when you use NAT, even if the address as seen on an interface is the mapped address:<br \/>\n\u2022 access-group command<br \/>\n\u2022 Modular Policy Framework match access-list command<br \/>\n\u2022 Botnet Traffic Filter dynamic-filter enable classify-list command<br \/>\n\u2022 AAA aaa &#8230; match commands<br \/>\n\u2022 WCCP wccp redirect-list group-list command<\/p>\n<p>The following features use access lists, but these access lists use the mapped values as seen on an interface:<br \/>\n\u2022 IPsec access lists<br \/>\n\u2022 capture command access lists<br \/>\n\u2022 Per-user access lists<br \/>\n\u2022 Routing protocols<br \/>\n\u2022 All other features&#8230;<\/p>\n<p>hostname(config)#access-list l2l_list extended permit ip 192.168.0.0 255.255.0.0 150.150.0.0 255.255.0.0<\/p>\n<p><strong>STEP 5 (Create a Tunnel Group):<\/strong><br \/>\nA tunnel group is a set of records that contain tunnel connection policies. You configure a tunnel group to identify AAA servers, specify connection parameters, and define a default group policy. The security appliance stores tunnel groups internally. There are two default tunnel groups in the Cisco ASA security appliance: DefaultRAGroup, which is the default IPsec remote-access tunnel group, and DefaultL2Lgroup, which is the default IPsec LAN-to-LAN tunnel group. You may modify them but you cannot delete them.<\/p>\n<p>You can also create one or more new tunnel groups to suit your environment. The security appliance uses these groups to configure default tunnel parameters for remote access and LAN-to -LAN tunnel groups when there is no specific tunnel group identified during tunnel negotiation.<\/p>\n<p>To establish a basic LAN-to-LAN connection, you must set two attributes for a tunnel group:<br \/>\n\u2022 Set the connection type to IPsec LAN-to-LAN.<br \/>\n\u2022 Configure an authentication method, in the following example, preshared key<\/p>\n<p>To set the connection type to IPsec LAN-to-LAN, enter the tunnel-group command. The syntax is tunnel-group name type type, where name is the name you assign to the tunnel group, and type is the type of tunnel. The tunnel types as you enter them in the CLI are:<br \/>\n\u2022 ipsec-ra (IPsec remote access)<br \/>\n\u2022 ipsec-l2l (IPsec LAN to LAN)<\/p>\n<p>hostname(config)#tunnel-group 10.10.4.108 type ipsec-l2l<br \/>\nhostname(config)#tunnel-group 10.10.4.108 ipsec-attributes<br \/>\nhostname(config-ipsec)#pre-shared-key 44kkaol59636jnfx<\/p>\n<p><strong>STEP 6 (Create a Crypto Map):<\/strong><br \/>\nCrypto map entries pull together the various elements of IPsec security associations, including the following:<\/p>\n<ul>\n<li>&#8211; Which traffic IPsec should protect,<\/li>\n<li>&#8211; which you define in an access list.<\/li>\n<li>&#8211; Where to send IPsec-protected traffic, by identifying the peer.<\/li>\n<li>&#8211; What IPsec security applies to this traffic, which a transform set specifies.<\/li>\n<li>&#8211; The local address for IPsec traffic, which you identify by applying the crypto map to an interface.<\/li>\n<\/ul>\n<p>For IPsec to succeed, both peers must have crypto map entries with compatible configurations. For two crypto map entries to be compatible, they must, at a minimum, meet the following criteria:<br \/>\n&#8211; The crypto map entries must contain compatible crypto access lists (for example, mirror image access lists). If the responding peer uses dynamic crypto maps, the entries in the security appliance crypto access list must be \u201cpermitted\u201d by the peer\u2019s crypto access list.<\/p>\n<ul>\n<li>&#8211; The crypto map entries each must identify the other peer (unless the responding peer is using adynamic crypto map).<\/li>\n<li>&#8211; The crypto map entries must have at least one transform set in common.<\/li>\n<\/ul>\n<p>If you create more than one crypto map entry for a given interface, use the sequence number (seq-num) of each entry to rank it: the lower the seq-num, the higher the priority. At the interface that has the crypto map set, the security appliance evaluates traffic against the entries of higher priority maps first. Create multiple crypto map entries for a given interface if either of the following conditions exist:<\/p>\n<ul>\n<li>&#8211; Different peers handle different data flows.<\/li>\n<li>&#8211; You want to apply different IPsec security to different types of traffic (to the same or separate peers), for example, if you want traffic between one set of subnets to be authenticated, and traffic between another set of subnets to be both authenticated and encrypted. In this case, define the different types of traffic in two separate access lists, and create a separate crypto map entry for each crypto access list.<\/li>\n<\/ul>\n<p>To create a crypto map and apply it to the outside interface in global configuration mode, enter several of the crypto map commands. These commands use a variety of arguments, but the syntax for all of them begin with crypto map map-name-seq-num<br \/>\n&#8211; In the following example the map-name is abcmap, the sequence number is 1.<\/p>\n<p>hostname(config)#crypto map abcmap 1 match address l2l_list\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;==== (To assign an access list to a crypto map entry)<br \/>\nhostname(config)#crypto map abcmap 1 set peer 10.10.4.108\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;==== (To identify the peer (s) for the IPsec connection)<br \/>\nhostname(config)#crypto map abcmap 1 set transform-set FirstSet\u00a0\u00a0 &lt;==== (To specify a transform set for a crypto map entry)<\/p>\n<p><strong>STEP 7 (Apply Crypto Map to Interface):<\/strong><br \/>\nYou must apply a crypto map set to each interface through which IPsec traffic travels. The security appliance supports IPsec on all interfaces. Applying the crypto map set to an interface instructs the security appliance to evaluate all interface traffic against the cryptomap set and to use the specified<br \/>\npolicy during connection or security association negotiations. Binding a crypto map to an interface also initializes the runtime data structures, such as the security association database and the security policy database.<\/p>\n<p>hostname(config)#crypto map abcmap interface outside<br \/>\nhostname(config)#write memory<\/p>\n<p><strong>SYSOPT SETTINGS:<\/strong><\/p>\n<p>One further item to verify are the sysopt settings (Cisco ASA):<\/p>\n<p>The commands\u00a0<b>sysopt connection permit-ipsec<\/b>\u00a0and\u00a0<b>sysopt connection permit-vpn<\/b>\u00a0allow packets from an IPsec tunnel and their payloads to bypass interface ACLs on the security appliance. IPsec tunnels that are terminated on the security appliance are likely to fail if one of these commands is not enabled.<br \/>\nIn Security Appliance Software Version 7.0 and earlier, the relevant sysopt command for this situation is\u00a0<b>sysopt connection permit-ipsec<\/b>.<br \/>\nIn Security Appliance Software Version 7.1(1) and later, the relevant sysopt command for this situation is\u00a0<b>sysopt connection permit-vpn<\/b>.<br \/>\nIn PIX 6.x, this functionality is\u00a0<b>disabled<\/b>\u00a0by default. With PIX\/ASA 7.0(1) and later, this functionality is\u00a0<b>enabled<\/b>\u00a0by default. Use these show commands to determine if the relevant\u00a0<b>sysopt<\/b>\u00a0command is enabled on your device:<br \/>\nCisco PIX 6.x<\/p>\n<pre>asa# <b>show sysopt<\/b>\r\nno sysopt connection timewait\r\nsysopt connection tcpmss 1380\r\nsysopt connection tcpmss minimum 0\r\nno sysopt nodnsalias inbound\r\nno sysopt nodnsalias outbound\r\nno sysopt radius ignore-secret\r\nno sysopt uauth allow-http-cache\r\n<b>no sysopt connection permit-ipsec<\/b><\/pre>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<h2>Crypto Lingo (Vocabulary)<\/h2>\n<p>You need to know these terms in order to understand IPsec, and to read the rest of this document. When you see acronyms in other portions of this document, refer to this page for definitions.<\/p>\n<p><b>Advanced Encryption Standard (AES)<\/b>\u2014AES was finalized as a Federal Information Processing Standard (FIPS)-approved cryptographic algorithm to be used in order to protect electronic data transmission (FIPS PUB 197). AES is based on the Rijndael algorithm, which specifies how to use keys with a length of 128, 192, or 256 bits to encrypt blocks with a length of 128, 192, or 256 bits. All nine combinations of key length and block length are possible.<\/p>\n<p><b>Authentication Header (AH)<\/b>\u2014This is a security protocol that provides authentication and optional replay-detection services. AH is embedded in the data to be protected, for example, a full IP datagram. AH can be used either by itself or with Encryption Service Payload (ESP). Refer to the <a href=\"http:\/\/www.ietf.org\/rfc\/rfc2402.txt?number=2402\" target=\"_blank\">RFC 2402<\/a> <img loading=\"lazy\" src=\"http:\/\/www.cisco.com\/swa\/i\/icon_popup_short.gif\" alt=\"leavingcisco.com\" width=\"19\" height=\"9\" \/>.<\/p>\n<p><b>Authentication<\/b>\u2014This is one of the functions of the IPsec framework. Authentication establishes the integrity of datastream and ensures that it is not tampered with in transit. It also provides confirmation about datastream origin.<\/p>\n<p><b>Certification Authority (CA)<\/b>\u2014This is a third-party entity with the responsibility to issue and revoke certificates. Each device that has its own certificate and public key of the CA can authenticate every other device within a given CA domain. This term also applies to server software that provides these services.<\/p>\n<p><b>Certificate<\/b>\u2014A cryptographically signed object that contains an identity and a public key associated with this identity.<\/p>\n<p><b>Classic crypto<\/b>\u2014This is Cisco proprietary encryption mechanism used in Cisco IOS Software Release 11.2. Classic crypto is available in Cisco IOS Software Release 11.3. But, IPsec is not retrofitted to Cisco IOS Software Release 11.2. You can also see the name classic crypto referred to as Encryption Express or Cisco Encryption Technology (CET) in the marketing literature.<\/p>\n<p><b>Certificate Revocation List (CRL)<\/b>\u2014This is a digitally signed message that lists all of the current but revoked certificates listed by a given CA. This is analogous to a book of stolen charge card numbers that allow stores to reject bad credit cards.<\/p>\n<p><b>Crypto map<\/b>\u2014This is a Cisco IOS software configuration entity that performs two primary functions. First, it selects data flows that need security processing. Second, it defines the policy for these flows and the crypto peer that traffic needs to go to.<\/p>\n<p>A crypto map is applied to an interface. The concept of a crypto map was introduced in classic crypto but was expanded for IPsec.<\/p>\n<p><b>Data integrity<\/b>\u2014This is data integrity mechanisms, through the use of secret-key based or public-key based algorithms, that allow the recipient of a piece of protected data in order to verify that the data has not been modified in transit.<\/p>\n<p><b>Data confidentiality<\/b>\u2014This is the method where protected data is manipulated so that no attacker can read it. This is commonly provided by data encryption and keys that are only available to the parties involved in the communication.<\/p>\n<p><b>Data origin authentication<\/b>\u2014This is a security service where the receiver can verify that protected data might have originated only from the sender. This service requires a data integrity service plus a key distribution mechanism, where a secret key is shared only between the sender and receiver.<\/p>\n<p><b>Data Encryption Standard (DES)<\/b>\u2014The DES was published in 1977 by the National Bureau of Standards and is a secret key encryption scheme based on the Lucifer algorithm from IBM. The contrast of DES is public-key. Cisco uses DES in classic crypto (40-bit and 56-bit key lengths), IPsec crypto (56-bit key), and on the PIX Firewall (56-bit key).<\/p>\n<p><b>Diffie-Hellman<\/b>\u2014This is a method of the establishment of a shared key over an insecure medium. Diffie-Hellman is a component of Oakley, which is defined in this definition list.<\/p>\n<p><b>DSS<\/b>\u2014A digital signature algorithm designed by The US National Institute of Standards and Technology (NIST) based on public key cryptography. DSS does not do user datagram encryption. DSS is a component in classic crypto, as well as the Redcreek IPsec card, but not in IPsec implemented in Cisco IOS software.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>IPSec involves many component technologies and encryption methods. Yet IPSec&#8217;s operation can be broken down into five main steps. The five steps are summarised as follows: Step 1 Interesting traffic initiates the IPSec process\u2014Traffic is deemed interesting when the IPSec security policy configured in the IPSec peers starts the IKE process. Step 2 IKE phase [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[83,13,71],"tags":[36],"_links":{"self":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1944"}],"collection":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1944"}],"version-history":[{"count":15,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1944\/revisions"}],"predecessor-version":[{"id":2171,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1944\/revisions\/2171"}],"wp:attachment":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1944"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1944"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1944"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}