This module describes how to configure basic IPsec VPNs. IPsec is a framework of open standards developed by the IETF. It provides security for the transmission of sensitive information over unprotected networks such as the Internet. IPsec acts at the network layer, protecting and authenticating IP packets between participating IPsec devices (“peers”), such as Cisco routers.
Note | Security threats, as well as the cryptographic technologies to help protect against them, are constantly changing. For more information about the latest Cisco cryptographic recommendations, see the Next Generation Encryption (NGE) white paper. |
Finding Feature Information
Your software release may not support all the features documented in this module. For the latest caveats and feature information, see Bug Search Tool and the release notes for your platform and software release. To find information about the features documented in this module, and to see a list of the releases in which each feature is supported, see the feature information table.
Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/go/cfn. An account on Cisco.com is not required.
Prerequisites for Configuring Security for VPNs with IPsec
IKE Configuration
You must configure Internet Key Exchange (IKE) as described in the module Configuring Internet Key Exchange for IPsec VPNs.
Note | If you decide not to use IKE, you must still disable it as described in the module Configuring Internet Key Exchange for IPsec VPNs. |
Ensure Access Lists Are Compatible with IPsec
IKE uses UDP port 500. The IPsec encapsulating security payload (ESP) and authentication header (AH) protocols use protocol numbers 50 and 51, respectively. Ensure that your access lists are configured so that traffic from protocol 50, 51, and UDP port 500 are not blocked at interfaces used by IPsec. In some cases, you might need to add a statement to your access lists to explicitly permit this traffic.
Restrictions for Configuring Security for VPNs with IPsec
Cisco IPsec Policy Map MIB
The MIB OID objects are displayed only when an IPsec session is up.
Discontiguous Access Control Lists
Crypto maps using access control lists (ACLs) that have discontiguous masks are not supported.
IPv4 Packets with IP Options Set
The following platforms do not support encrypting IPv4 packets with IP options set:
Cisco ASR1001 and ASR1000 routers with ESP-5, ESP-10, ESP-20, and ESP-40.
Physical Interface and Crypto Map
A crypto map on a physical interface is not supported, if the physical interface is the source interface of a tunnel protection interface.
NAT Configuration
If you use Network Address Translation (NAT), you should configure static NAT so that IPsec works properly. In general, NAT should occur before the router performs IPsec encapsulation; in other words, IPsec should work with global addresses.
Unicast IP Datagram Application Only
IPsec can be applied to unicast IP datagrams only. Because the IPsec Working Group has not yet addressed the issue of group key distribution, IPsec does not currently work with multicasts or broadcast IP datagrams.
IPv6 BFD with ISM
IPv6 BFD with ISM is not supported on ISRG2 routers.
Unsupported Interface Types
-
Crypto VPNs are not supported on the bridge domain interfaces (BDI).
-
Crypto maps are not supported on tunnel interface and port-channel interface.
-
Crypto maps are not supported on tunnel interface of MFR.
Information About Configuring Security for VPNs with IPsec
Supported Standards
Cisco implements the following standards with this feature:
-
IPsec—IPsec is a framework of open standards that provides data confidentiality, data integrity, and data authentication between participating peers. IPsec provides these security services at the IP layer; IPsec uses IKE to handle negotiation of protocols and algorithms based on the local policy, and generate the encryption and authentication keys to be used by IPsec. IPsec can be used to protect one or more data flows between a pair of hosts, between a pair of security gateways, or between a security gateway and a host.
NoteThe term IPsec is sometimes used to describe the entire protocol of IPsec data services and IKE security protocols, and is also sometimes used to describe only the data services.
-
IKE (IKEv1 and IKEv2)—A hybrid protocol that implements Oakley and SKEME key exchanges inside the Internet Security Association and Key Management Protocol (ISAKMP) framework. While IKE is used with other protocols, its initial implementation is with the IPsec protocol. IKE provides authentication of IPsec peers, negotiates IPsec security associations, and establishes IPsec keys.
The component technologies implemented for IPsec include:
Note | Cisco no longer recommends using DES, 3DES, MD5 (including HMAC variant), and Diffie-Hellman (DH) groups 1, 2 and 5; instead, you should use AES, SHA and DH Groups 14 or higher. For more information about the latest Cisco cryptographic recommendations, see the Next Generation Encryption (NGE) white paper. |
-
AES—Advanced Encryption Standard. A cryptographic algorithm that protects sensitive, unclassified information. AES is a privacy transform for IPsec and IKE and has been developed to replace DES. AES is designed to be more secure than DES. AES offers a larger key size, while ensuring that the only known approach to decrypt a message is for an intruder to try every possible key. AES has a variable key length—the algorithm can specify a 128-bit key (the default), a 192-bit key, or a 256-bit key.
-
DES—Data Encryption Standard. An algorithm that is used to encrypt packet data. Cisco software implements the mandatory 56-bit DES-CBC with Explicit IV. Cipher Block Chaining (CBC) requires an initialization vector (IV) to start encryption. The IV is explicitly given in the IPsec packet. For backwards compatibility, Cisco IOS IPsec also implements the RFC 1829 version of ESP DES-CBC.
Cisco IOS also implements Triple DES (168-bit) encryption, depending on the software versions available for a specific platform. Cisco no longer recommends Triple DES (3DES).
Note | Cisco IOS images with strong encryption (including, but not limited to 56-bit data encryption feature sets) are subject to United States government export controls, and have a limited distribution. Images to be installed outside the United States require an export license. Customer orders might be denied or subject to delay due to United States government regulations. Contact your sales representative or distributor for more information, or send an e-mail to export@cisco.com. |
-
SHA-2 and SHA-1 family (HMAC variant)—Secure Hash Algorithm (SHA) 1 and 2. Both SHA-1 and SHA-2 are hash algorithms used to authenticate packet data and verify the integrity verification mechanisms for the IKE protocol. HMAC is a variant that provides an additional level of hashing. SHA-2 family adds the SHA-256 bit hash algorithm and SHA-384 bit hash algorithm. This functionality is part of the Suite-B requirements that comprises four user interface suites of cryptographic algorithms for use with IKE and IPSec that are described in RFC 4869. Each suite consists of an encryption algorithm, a digital signature algorithm, a key agreement algorithm, and a hash or message digest algorithm. See the Configuring Security for VPNs with IPsec feature module for more detailed information about Cisco IOS Suite-B support. SHA-2 for ISAKMP is supported in Cisco IOS XE 15.3(3)S and later.
-
Diffie-Hellman—A public-key cryptography protocol that allows two parties to establish a shared secret over an unsecure communications channel. Diffie-Hellman is used within IKE to establish session keys. It supports 768-bit (the default), 1024-bit, 1536-bit, 2048-bit, 3072-bit, and 4096-bit DH groups. It also supports a 2048-bit DH group with a 256-bit subgroup, and 256-bit and 384-bit elliptic curve DH (ECDH). Cisco recommends using 2048-bit or larger DH key exchange, or ECDH key exchange.
-
MD5 (Hash-based Message Authentication Code (HMAC) variant)—Message digest algorithm 5 (MD5) is a hash algorithm. HMAC is a keyed hash variant used to authenticate data.
IPsec as implemented in Cisco software supports the following additional standards:
-
AH—Authentication Header. A security protocol, which provides data authentication and optional anti-replay services. AH is embedded in the data to be protected (a full IP datagram).
-
ESP—Encapsulating Security Payload. A security protocol, which provides data privacy services and optional data authentication, and anti-replay services. ESP encapsulates the data to be protected.
Supported Encapsulation
IPsec works with the following serial encapsulations: Frame Relay, High-Level Data-Links Control (HDLC), and PPP.
IPsec also works with Generic Routing Encapsulation (GRE) and IPinIP Layer 3, Data Link Switching+ (DLSw+), and Source Route Bridging (SRB) tunneling protocols; however, multipoint tunnels are not supported. Other Layer 3 tunneling protocols may not be supported for use with IPsec.
IPsec Functionality Overview
IPsec provides the following network security services. (In general, the local security policy dictates the use of one or more of these services.)
-
Data confidentiality—The IPsec sender can encrypt packets before transmitting them across a network.
-
Data integrity—The IPsec receiver can authenticate packets sent by the IPsec sender to ensure that the data has not been altered during transmission.
-
Data origin authentication—The IPsec receiver can authenticate the source of the sent IPsec packets. This service is dependent upon the data integrity service.
-
Anti-replay—The IPsec receiver can detect and reject replayed packets.
IPsec provides secure tunnels between two peers, such as two routers. You define which packets are considered sensitive and should be sent through these secure tunnels, and you define the parameters that should be used to protect these sensitive packets by specifying the characteristics of these tunnels. When the IPsec peer recognizes a sensitive packet, the peer sets up the appropriate secure tunnel and sends the packet through the tunnel to the remote peer. (The use of the term tunnel in this chapter does not refer to using IPsec in tunnel mode.)
More accurately, these tunnels are sets of security associations (SAs) that are established between two IPsec peers. The SAs define the protocols and algorithms to be applied to sensitive packets and specify the keying material to be used by the two peers. SAs are unidirectional and are established per security protocol (AH or ESP).
Multiple IPsec tunnels can exist between two peers to secure different data streams, with each tunnel using a separate set of SAs. For example, some data streams only need to be authenticated, while other data streams must both be encrypted and authenticated.
IKEv1 Transform Sets
An Internet Key Exchange version 1 (IKEv1) transform set represents a certain combination of security protocols and algorithms. During the IPsec SA negotiation, the peers agree to use a particular transform set for protecting a particular data flow.
IKEv2 Transform Sets
encryption aes-cbc-128 3desintegrity sha1 md5group 5 2
Although the crypto ikev2 proposal command is similar to the crypto isakmp policy priority command, the IKEv2 proposal differs as follows:
-
An IKEv2 proposal allows configuration of one or more transforms for each transform type.
-
An IKEv2 proposal does not have any associated priority.
Note | To use IKEv2 proposals in negotiation, they must be attached to IKEv2 policies. If a proposal is not configured, then the default IKEv2 proposal is used with the default IKEv2 policy. |
Transform Sets: A Combination of Security Protocols and Algorithms
About Transform Sets
Note | Cisco no longer recommends using ah-md5-hmac, esp-md5-hmac, esp-des or esp-3des. Instead, you should use ah-sha-hmac, esp-sha-hmac or esp-aes. For more information about the latest Cisco cryptographic recommendations, see the Next Generation Encryption (NGE) white paper. |
A transform set represents a certain combination of security protocols and algorithms. During the IPsec SA negotiation, the peers agree to use a particular transform set for protecting a particular data flow.
During IPsec security association negotiations with IKE, peers search for an identical transform set for both peers. When such a transform set is found, it is selected and applied to the protected traffic as part of both peers’ IPsec SAs. (With manually established SAs, there is no negotiation with the peer, so both sides must specify the same transform set.)
Note | You cannot specify AH and ESP algorithms on the same transform set in Cisco IOS XE releases. |
Transform Type | Transform | Description | ||
---|---|---|---|---|
AH Transform (Pick only one.) | ah-md5-hmac | AH with the MD5 (Message Digest 5) (an HMAC variant) authentication algorithm. (No longer recommended). | ||
ah-sha-hmac | AH with the SHA (Secure Hash Algorithm) (an HMAC variant) authentication algorithm. A transform set combination of AH and ESP is not supported in Cisco IOS XE releases. | |||
ESP Encryption Transform (Pick only one.) | esp-aes | ESP with the 128-bit Advanced Encryption Standard (AES) encryption algorithm. | ||
esp-gcm esp-gmac | The esp-gcm and esp-gmac transforms are ESPs with either a 128-bit or a 256-bit encryption algorithm. The default for either of these transforms is 128 bits. Both esp-gcm and esp-gmac transforms cannot be configured together with any other ESP transform within the same crypto IPsec transform set using the crypto ipsec transform-set command. The esp-gcm and esp-gmac combinations are not supported on the Cisco ASR 1001 routers with the following ESPs:
| |||
esp-aes 192 | ESP with the 192-bit AES encryption algorithm. | |||
esp-aes 256 | ESP with the 256-bit AES encryption algorithm. | |||
esp-des |
| |||
esp-3des | ESP with the 168-bit DES encryption algorithm (3DES or Triple DES). (No longer recommended). | |||
esp-null | Null encryption algorithm. | |||
ESP Authentication Transform (Pick only one.) | esp-md5-hmac | ESP with the MD5 (HMAC variant) authentication algorithm. (No longer recommended). | ||
esp-sha-hmac | ESP with the SHA (HMAC variant) authentication algorithm. |
Note | Security threats, as well as the cryptographic technologies to help protect against them, are constantly changing. For more information about the latest Cisco cryptographic recommendations, see the Next Generation Encryption (NGE) white paper. |
Cisco IOS Suite-B Support for IKE and IPsec Cryptographic Algorithms
Suite-B adds support for four user interface suites of cryptographic algorithms for use with IKE and IPSec that are described in RFC 4869. Each suite consists of an encryption algorithm, a digital signature algorithm, a key agreement algorithm, and a hash or message digest algorithm.
-
Cisco ASR1001
-
ESP-5
-
ESP-10
-
ESP-20
-
ESP-40
Suite-B has the following cryptographic algorithms:
-
Suite-B-GCM-128-Provides ESP integrity protection, confidentiality, and IPsec encryption algorithms that use the 128-bit AES using Galois and Counter Mode (AES-GCM) described in RFC 4106. This suite should be used when ESP integrity protection and encryption are both needed.
-
Suite-B-GCM-256-Provides ESP integrity protection and confidentiality using 256-bit AES-GCM described in RFC 4106. This suite should be used when ESP integrity protection and encryption are both needed.
-
Suite-B-GMAC-128-Provides ESP integrity protection using 128-bit AES- Galois Message Authentication Code (GMAC) described in RFC 4543, but does not provide confidentiality. This suite should be used only when there is no need for ESP encryption.
-
Suite-B-GMAC-256-Provides ESP integrity protection using 256-bit AES-GMAC described in RFC 4543, but does not provide confidentiality. This suite should be used only when there is no need for ESP encryption.
IPSec encryption algorithms use AES-GCM when encryption is required and AES-GMAC for message integrity without encryption.
IKE negotiation uses AES Cipher Block Chaining (CBC) mode to provide encryption and Secure Hash Algorithm (SHA)-2 family containing the SHA-256 and SHA-384 hash algorithms, as defined in RFC 4634, to provide the hash functionality. Diffie-Hellman using Elliptic Curves (ECP), as defined in RFC 4753, is used for key exchange and the Elliptic Curve Digital Signature Algorithm (ECDSA), as defined in RFC 4754, to provide authentication.
Suite-B Requirements
Suite-B imposes the following software crypto engine requirements for IKE and IPsec:
-
HMAC-SHA256 and HMAC-SHA384 are used as pseudorandom functions; the integrity check within the IKE protocol is used. Optionally, HMAC-SHA512 can be used.
-
Elliptic curve groups 19 (256-bit ECP curve) and 20 (384-bit ECP curve) are used as the Diffie-Hellman group in IKE. Optionally, group 21 (521-bit ECP curve) can be used.
-
The Elliptic Curve Digital Signature Algorithm (ECDSA) algorithm (256-bit and 384-bit curves) is used for the signature operation within X.509 certificates.
-
GCM (16 byte ICV) and GMAC is used for ESP (128-bit and 256-bit keys). Optionally, 192-bit keys can be used.
-
Public Key Infrastructure (PKI) support for validation of X.509 certificates using ECDSA signatures must be used.
-
PKI support for generating certificate requests using ECDSA signatures and for importing the issued certificates into IOS must be used.
-
IKEV2 support for allowing the ECDSA signature (ECDSA-sig) as authentication method must be used.
Where to Find Suite-B Configuration Information
Suite-B configuration support is described in the following documents:
-
For more information on SHA-2 family (HMAC variant) and Elliptic Curve (EC) key pair configuration, see the Configuring Internet Key Exchange for IPsec VPNs feature module.
-
For more information on configuring a transform for an integrity algorithm type, see the “Configuring the IKEv2 Proposal” section in the Configuring Internet Key Exchange Version 2 (IKEv2) and FlexVPN Site-to-Site feature module.
-
For more information on configuring the ECDSA-sig to be the authentication method for IKEv2, see the “Configuring IKEv2 Profile (Basic)” section in the Configuring Internet Key Exchange Version 2 (IKEv2) and FlexVPN Site-to-Site feature module.
-
For more information on configuring elliptic curve Diffie-Hellman (ECDH) support for IPsec SA negotiation, see the Configuring Internet Key Exchange for IPsec VPNs and Configuring Internet Key Exchange Version 2 and FlexVPN feature modules.
For more information on the Suite-B support for certificate enrollment for a PKI, see the Configuring Certificate Enrollment for a PKI feature module.
How to Configure IPsec VPNs
Creating Crypto Access Lists
SUMMARY STEPS
- enable
- configure terminal
- Do one of the following:
- access-list access-list-number {deny | permit } protocol source source-wildcard destination destination-wildcard [log ]
- ip access-list extended name
DETAILED STEPS
Command or Action | Purpose | |||
---|---|---|---|---|
Step1 | enable Example: | Enables privileged EXEC mode.
| ||
Step2 | configure terminal Example:
| Enters global configuration mode. | ||
Step3 | Do one of the following:
Example: Example: | Specifies conditions to determine which IP packets are protected.
| ||
Step4 | Repeat Step 3 for each crypto access list you want to create. | — |
What to Do Next
After at least one crypto access list is created, a transform set needs to be defined as described in the “Configuring Transform Sets for IKEv1 and IKEv2 Proposals” section.
Next the crypto access lists need to be associated to particular interfaces when you configure and apply crypto map sets to the interfaces. (Follow the instructions in the “Creating Crypto Map Sets” and “Applying Crypto Map Sets to Interfaces” sections).
Configuring Transform Sets for IKEv1 and IKEv2 Proposals
Perform this task to define a transform set that is to be used by the IPsec peers during IPsec security association negotiations with IKEv1 and IKEv2 proposals.
Restrictions
If you are specifying SEAL encryption, note the following restrictions:
-
Your router and the other peer must not have a hardware IPsec encryption.
-
Your router and the other peer must support IPsec.
-
Your router and the other peer must support the k9 subsystem.
-
SEAL encryption is available only on Cisco equipment. Therefore, interoperability is not possible.
-
Unlike IKEv1, the authentication method and SA lifetime are not negotiable in IKEv2, and because of this, these parameters cannot be configured under the IKEv2 proposal.
Configuring Transform Sets for IKEv1
SUMMARY STEPS
- enable
- configure terminal
- crypto ipsec transform-set transform-set-name transform1 [transform2 [transform3]]
- mode [tunnel | transport ]
- end
- clear crypto sa [peer {ip-address | peer-name} | sa map map-name | sa entry destination-address protocol spi]
- show crypto ipsec transform-set [tag transform-set-name]
DETAILED STEPS
Command or Action | Purpose | |
---|---|---|
Step1 | enable Example: | Enables privileged EXEC mode.
|
Step2 | configure terminal Example: | Enters global configuration mode. |
Step3 | crypto ipsec transform-set transform-set-name transform1 [transform2 [transform3]] Example: | Defines a transform set and enters crypto transform configuration mode.
|
Step4 | mode [tunnel | transport ] Example: | (Optional) Changes the mode associated with the transform set.
|
Step5 | end Example: | Exits crypto transform configuration mode and enters privileged EXEC mode. |
Step6 | clear crypto sa [peer {ip-address | peer-name} | sa map map-name | sa entry destination-address protocol spi] Example: | (Optional) Clears existing IPsec security associations so that any changes to a transform set takes effect on subsequently established security associations. Manually established SAs are reestablished immediately.
|
Step7 | show crypto ipsec transform-set [tag transform-set-name] Example: | (Optional) Displays the configured transform sets. |
What to Do Next
After you have defined a transform set, you should create a crypto map as specified in theCreating Crypto Map Sets section.
Configuring Transform Sets for IKEv2
SUMMARY STEPS
- enable
- configure terminal
- crypto ikev2 proposal proposal-name
- encryption transform1 [transform2] ...
- integrity transform1 [transform2] ...
- group transform1 [transform2] ...
- end
- show crypto ikev2 proposal
DETAILED STEPS
Command or Action | Purpose | |
---|---|---|
Step1 | enable Example: | Enables privileged EXEC mode.
|
Step2 | configure terminal Example: | Enters global configuration mode. |
Step3 | crypto ikev2 proposal proposal-name Example: | Specifies the name of the proposal and enters crypto IKEv2 proposal configuration mode.
|
Step4 | encryption transform1 [transform2] ... Example: | (Optional) Specifies one or more transforms of the following encryption type:
|
Step5 | integrity transform1 [transform2] ... Example: | (Optional) Specifies one or more transforms of the following integrity type:
|
Step6 | group transform1 [transform2] ... Example: | (Optional) Specifies one or more transforms of the possible DH group type:
|
Step7 | end Example: | Exits crypto IKEv2 proposal configuration mode and returns to privileged EXEC mode. |
Step8 | show crypto ikev2 proposal Example: | (Optional) Displays the parameters for each IKEv2 proposal. |
Transform Sets for IKEv2 Examples
The following examples show how to configure a proposal:
IKEv2 Proposal with One Transform for Each Transform Type
Device(config)# crypto ikev2 proposal proposal-1Device(config-ikev2-proposal)# encryption aes-cbc-128Device(config-ikev2-proposal)# integrity sha1Device(config-ikev2-proposal)# group 14
IKEv2 Proposal with Multiple Transforms for Each Transform Type
crypto ikev2 proposal proposal-2encryption aes-cbc-128 aes-cbc-192integrity sha1 sha256group 14 15
For a list of transform combinations, see Configuring Security for VPNs with IPsec. IKEv2 Proposals on the Initiator and Responder
The proposal of the initiator is as follows:
Device(config)# crypto ikev2 proposal proposal-1Device(config-ikev2-proposal)# encryption aes-cbc-128 aes-cbc-196Device(config-ikev2-proposal)# integrity sha1 sha256Device(config-ikev2-proposal)# group 14 16
The proposal of the responder is as follows:
Device(config)# crypto ikev2 proposal proposal-2Device(config-ikev2-proposal)# encryption aes-cbc-196 aes-cbc-128Device(config-ikev2-proposal)# integrity sha256 sha1Device(config-ikev2-proposal)# group 16 14
In the scenario, the initiator’s choice of algorithms is preferred and the selected algorithms are as follows:
encryption aes-cbc-128integrity sha1 group 14
What to Do Next
After you have defined a transform set, you should create a crypto map as specified in the Creating Crypto Map Sets section.
Creating Crypto Map Sets
Creating Static Crypto Maps
When IKE is used to establish SAs, the IPsec peers can negotiate the settings they use for the new security associations. This means that you can specify lists (such as lists of acceptable transforms) within the crypto map entry.
Perform this task to create crypto map entries that use IKE to establish SAs. To create IPv6 crypto map entries, you must use the ipv6 keyword with the crypto map command. For IPv4 crypto maps, use the crypto map command without the ipv6 keyword.
Note | Security threats, as well as the cryptographic technologies to help protect against them, are constantly changing. For more information about the latest Cisco cryptographic recommendations, see the Next Generation Encryption (NGE) white paper. |
SUMMARY STEPS
- enable
- configure terminal
- crypto map [ipv6 ] map-name seq-num [ipsec-isakmp ]
- match address access-list-id
- set peer {hostname | ip-address}
- crypto ipsec security-association dummy {pps rate | seconds seconds}
- set transform-set transform-set-name1 [transform-set-name2...transform-set-name6]
- set security-association lifetime {seconds seconds | kilobytes kilobytes | kilobytes disable }
- set security-association level per-host
- set pfs [group1 | group14 | group15 | group16 | group19 | group2 | group20 | group24 | group5 ]
- end
- show crypto map [interface interface | tag map-name]
DETAILED STEPS
Command or Action | Purpose | |||
---|---|---|---|---|
Step1 | enable Example: | Enables privileged EXEC mode.
| ||
Step2 | configure terminal Example: | Enters global configuration mode. | ||
Step3 | crypto map [ipv6 ] map-name seq-num [ipsec-isakmp ] Example: | Creates or modifies a crypto map entry, and enters crypto map configuration mode.
| ||
Step4 | match address access-list-id Example: | Names an extended access list.
| ||
Step5 | set peer {hostname | ip-address} Example: | Specifies a remote IPsec peer—the peer to which IPsec protected traffic can be forwarded.
| ||
Step6 | crypto ipsec security-association dummy {pps rate | seconds seconds} Example:
| Enables generating dummy packets. These dummy packets are generated for all flows created in the crypto map. | ||
Step7 | set transform-set transform-set-name1 [transform-set-name2...transform-set-name6] Example: | Specifies the transform sets that are allowed for this crypto map entry.
| ||
Step8 | set security-association lifetime {seconds seconds | kilobytes kilobytes | kilobytes disable } Example: | (Optional) Specifies a SA lifetime for the crypto map entry.
| ||
Step9 | set security-association level per-host Example: | (Optional) Specifies that separate SAs should be established for each source and destination host pair.
| ||
Step10 | set pfs [group1 | group14 | group15 | group16 | group19 | group2 | group20 | group24 | group5 ] Example: | (Optional) Specifies that IPsec either should ask for password forward secrecy (PFS) when requesting new SAs for this crypto map entry or should demand PFS in requests received from the IPsec peer.
| ||
Step11 | end Example: | Exits crypto map configuration mode and returns to privileged EXEC mode. | ||
Step12 | show crypto map [interface interface | tag map-name] Example: | Displays your crypto map configuration. |
Troubleshooting Tips
Certain configuration changes take effect only when negotiating subsequent SAs. If you want the new settings to take immediate effect, you must clear the existing SAs so that they are reestablished with the changed configuration. If the router is actively processing IPsec traffic, clear only the portion of the SA database that would be affected by the configuration changes (that is, clear only the SAs established by a given crypto map set). Clearing the full SA database should be reserved for large-scale changes, or when the router is processing very little other IPsec traffic.
To clear IPsec SAs, use the clear crypto sa command with appropriate parameters. (Omitting all parameters clears out the full SA database, which clears active security sessions.)
What to Do Next
After you have successfully created a static crypto map, you must apply the crypto map set to each interface through which IPsec traffic flows. To complete this task, see the “Applying Crypto Map Sets to Interfaces” section.
Creating Dynamic Crypto Maps
Dynamic crypto map entries specify crypto access lists that limit traffic for which IPsec SAs can be established. A dynamic crypto map entry that does not specify an access list is ignored during traffic filtering. A dynamic crypto map entry with an empty access list causes traffic to be dropped. If there is only one dynamic crypto map entry in the crypto map set, it must specify the acceptable transform sets.
Perform this task to create dynamic crypto map entries that use IKE to establish the SAs.
Note | IPv6 addresses are not supported on dynamic crypto maps. |
Note | Security threats, as well as the cryptographic technologies to help protect against them, are constantly changing. For more information about the latest Cisco cryptographic recommendations, see the Next Generation Encryption (NGE) white paper. |
SUMMARY STEPS
- enable
- configure terminal
- crypto dynamic-map dynamic-map-name dynamic-seq-num
- set transform-set transform-set-name1 [transform-set-name2...transform-set-name6]
- match address access-list-id
- set peer {hostname | ip-address}
- set security-association lifetime {seconds seconds | kilobytes kilobytes | kilobytes disable }
- set pfs [group1 | group14 | group15 | group16 | group19 | group2 | group20 | group24 | group5 ]
- exit
- exit
- show crypto dynamic-map [tag map-name]
- configure terminal
- crypto map map-name seq-num ipsec-isakmp dynamic dynamic-map-name [discover ]
- exit
DETAILED STEPS
Command or Action | Purpose | |||
---|---|---|---|---|
Step1 | enable Example: | Enables privileged EXEC mode.
| ||
Step2 | configure terminal Example: | Enters global configuration mode. | ||
Step3 | crypto dynamic-map dynamic-map-name dynamic-seq-num Example: | Creates a dynamic crypto map entry and enters crypto map configuration mode. | ||
Step4 | set transform-set transform-set-name1 [transform-set-name2...transform-set-name6] Example: | Specifies the transform sets allowed for the crypto map entry.
| ||
Step5 | match address access-list-id Example: | (Optional) Specifies the list number or name of an extended access list.
| ||
Step6 | set peer {hostname | ip-address} Example: | (Optional) Specifies a remote IPsec peer. Repeat this step for multiple remote peers.
| ||
Step7 | set security-association lifetime {seconds seconds | kilobytes kilobytes | kilobytes disable } Example: | (Optional) Overrides (for a particular crypto map entry) the global lifetime value, which is used when negotiating IP Security SAs.
| ||
Step8 | set pfs [group1 | group14 | group15 | group16 | group19 | group2 | group20 | group24 | group5 ] Example: | (Optional) Specifies that IPsec should ask for PFS when requesting new security associations for this crypto map entry or should demand PFS in requests received from the IPsec peer.
| ||
Step9 | exit Example: | Exits crypto map configuration mode and returns to global configuration mode. | ||
Step10 | exit Example: | Exits global configuration mode. | ||
Step11 | show crypto dynamic-map [tag map-name] Example: | (Optional) Displays information about dynamic crypto maps. | ||
Step12 | configure terminal Example: | Enters global configuration mode. | ||
Step13 | crypto map map-name seq-num ipsec-isakmp dynamic dynamic-map-name [discover ] Example: | (Optional) Adds a dynamic crypto map to a crypto map set.
| ||
Step14 | exit Example: | Exits global configuration mode. |
Troubleshooting Tips
Certain configuration changes take effect only when negotiating subsequent SAs. If you want the new settings to take immediate effect, you must clear the existing SAs so that they are reestablished with the changed configuration. If the router is actively processing IPsec traffic, clear only the portion of the SA database that would be affected by the configuration changes (that is, clear only the SAs established by a given crypto map set). Clearing the entire SA database must be reserved for large-scale changes, or when the router is processing minimal IPsec traffic.
To clear IPsec SAs, use the clear crypto sa command with appropriate parameters. (Omitting all parameters clears the full SA database, which clears active security sessions.)
What to Do Next
After you have successfully created a crypto map set, you must apply the crypto map set to each interface through which IPsec traffic flows. To complete this task, see the “Applying Crypto Map Sets to Interfaces” section.
Creating Crypto Map Entries to Establish Manual SAs
Perform this task to create crypto map entries to establish manual SAs (that is, when IKE is not used to establish the SAs). To create IPv6 crypto maps entries, you must use the ipv6 keyword with the crypto map command. For IPv4 crypto maps, use the crypto map command without the ipv6 keyword.
SUMMARY STEPS
- enable
- configure terminal
- crypto map [ipv6 ] map-name seq-num [ipsec-manual ]
- match address access-list-id
- set peer {hostname | ip-address}
- set transform-set transform-set-name
- Do one of the following:
- set session-key inbound ah spi hex-key-string
- set session-key outbound ah spi hex-key-string
- set session-key inbound esp spi cipher hex-key-string [authenticator hex-key-string]
- set session-key outbound esp spi cipher hex-key-string [authenticator hex-key-string]
DETAILED STEPS
Command or Action | Purpose | |||
---|---|---|---|---|
Step1 | enable Example: | Enables privileged EXEC mode.
| ||
Step2 | configure terminal Example: | Enters global configuration mode. | ||
Step3 | crypto map [ipv6 ] map-name seq-num [ipsec-manual ] Example: | Specifies the crypto map entry to be created or modified and enters crypto map configuration mode.
| ||
Step4 | match address access-list-id Example: | Names an IPsec access list that determines which traffic should be protected by IPsec and which traffic should not be protected by IPsec in the context of this crypto map entry.
| ||
Step5 | set peer {hostname | ip-address} Example: | Specifies the remote IPsec peer. This is the peer to which IPsec protected traffic should be forwarded.
| ||
Step6 | set transform-set transform-set-name Example: | Specifies which transform set should be used.
| ||
Step7 | Do one of the following:
Example: Example: | Sets the AH security parameter indexes (SPIs) and keys to apply to inbound and outbound protected traffic if the specified transform set includes the AH protocol.
| ||
Step8 | Do one of the following:
Example: Example: | Sets the Encapsulating Security Payload (ESP) Security Parameter Indexes (SPI) and keys to apply to inbound and outbound protected traffic if the specified transform set includes the ESP protocol. Or Specifies the cipher keys if the transform set includes an ESP cipher algorithm. Specifies the authenticator keys if the transform set includes an ESP authenticator algorithm.
| ||
Step9 | exit Example: | Exits crypto map configuration mode and returns to global configuration mode. | ||
Step10 | exit Example: | Exits global configuration mode. | ||
Step11 | show crypto map [interface interface | tag map-name] Example: | Displays your crypto map configuration. |
Troubleshooting Tips
For manually established SAs, you must clear and reinitialize the SAs for the changes to take effect. To clear IPsec SAs, use the clear crypto sa command with appropriate parameters. (Omitting all parameters clears the entire SA database, which clears active security sessions.)
What to Do Next
After you have successfully created a crypto map set, you must apply the crypto map set to each interface through which IPsec traffic flows. To complete this task, see the “Applying Crypto Map Sets to Interfaces” section.
Applying Crypto Map Sets to Interfaces
You must apply a crypto map set to each interface through which IPsec traffic flows. Applying the crypto map set to an interface instructs the device to evaluate the interface’s traffic against the crypto map set and to use the specified policy during connection or security association negotiation on behalf of traffic to be protected by the crypto map.
Perform this task to apply a crypto map to an interface.
SUMMARY STEPS
- enable
- configure terminal
- interface type/ number
- crypto map map-name
- exit
- crypto map map-name local-address interface-id
- exit
- show crypto map [interface interface]
DETAILED STEPS
Command or Action | Purpose | |
---|---|---|
Step1 | enable Example: | Enables privileged EXEC mode.
|
Step2 | configure terminal Example: | Enters global configuration mode. |
Step3 | interface type/ number Example: | Configures an interface and enters interface configuration mode. |
Step4 | crypto map map-name Example: | Applies a crypto map set to an interface. |
Step5 | exit Example: | Exits interface configuration mode and returns to global configuration mode. |
Step6 | crypto map map-name local-address interface-id Example: | (Optional) Permits redundant interfaces to share the same crypto map using the same local identity. |
Step7 | exit Example: | (Optional) Exits global configuration mode. |
Step8 | show crypto map [interface interface] Example: | (Optional) Displays your crypto map configuration |
Configuration Examples for IPsec VPN
Example: Configuring AES-Based Static Crypto Map
This example shows how a static crypto map is configured and how an AES is defined as the encryption method:
crypto isakmp policy 10 encryption aes 256 authentication pre-share group 14 lifetime 180crypto isakmp key cisco123 address 10.0.110.1!!crypto ipsec transform-set aesset esp-aes 256 esp-sha-hmac mode transport!crypto map aesmap 10 ipsec-isakmp set peer 10.0.110.1 set transform-set aesset match address 120!!!voice call carrier capacity active!!mta receive maximum-recipients 0!!interface FastEthernet0/0 ip address 10.0.110.2 255.255.255.0 ip nat outside no ip route-cache no ip mroute-cache duplex auto speed auto crypto map aesmap!interface Serial0/0 no ip address shutdown!interface FastEthernet0/1 ip address 10.0.110.1 255.255.255.0 ip nat inside no ip route-cache no ip mroute-cache duplex auto speed auto!ip nat inside source list 110 interface FastEthernet0/0 overloadip classlessip route 0.0.0.0 0.0.0.0 10.5.1.1ip route 10.0.110.0 255.255.255.0 FastEthernet0/0ip route 172.18.124.0 255.255.255.0 10.5.1.1ip route 172.18.125.3 255.255.255.255 10.5.1.1ip http server!!access-list 110 deny ip 10.0.110.0 0.0.0.255 10.0.110.0 0.0.0.255access-list 110 permit ip 10.0.110.0 0.0.0.255 anyaccess-list 120 permit ip 10.0.110.0 0.0.0.255 10.0.110.0 0.0.0.255!
Additional References for Configuring Security for VPNs with IPsec
Related Documents
Related Topic | Document Title |
---|---|
Cisco IOS commands | Cisco IOS Master Commands List, All Releases |
IKE, IPsec, and PKI configuration commands |
|
IKE configuration | Configuring Internet Key Exchange for IPsec VPNs |
Suite-B SHA-2 family (HMAC variant) and Elliptic Curve (EC) key pair configuration | Configuring Internet Key Exchange for IPsec VPNs |
Suite-B Integrity algorithm type transform configuration | Configuring Internet Key Exchange Version 2 (IKEv2) |
Suite-B Elliptic Curve Digital Signature Algorithm (ECDSA) signature (ECDSA-sig) authentication method configuration for IKEv2 | Configuring Internet Key Exchange Version 2 (IKEv2) |
Suite-B Elliptic curve Diffie-Hellman (ECDH) support for IPsec SA negotiation |
|
Suite-B support for certificate enrollment for a PKI | Configuring Certificate Enrollment for a PKI |
Set Up VPN between Cisco ASR 100 Series and Google Cloud Platform | Set Up VPN between Cisco ASR 100 Series and Google Cloud Platform |
Recommended cryptographic algorithms | Next Generation Encryption |
Standards
Standards | Title |
---|---|
None | — |
MIBs
MIBs | MIBs Link |
---|---|
| To locate and download MIBs for selected platforms, Cisco IOS software releases, and feature sets, use Cisco MIB Locator found at the following URL: http://www.cisco.com/go/mibs |
RFCs
RFCs | Title |
---|---|
RFC 2401 | Security Architecture for the Internet Protocol |
RFC 2402 | IP Authentication Header |
RFC 2403 | The Use of HMAC-MD5-96 within ESP and AH |
RFC 2404 | The Use of HMAC-SHA-1-96 within ESP and AH |
RFC 2405 | The ESP DES-CBC Cipher Algorithm With Explicit IV |
RFC 2406 | IP Encapsulating Security Payload (ESP) |
RFC 2407 | The Internet IP Security Domain of Interpretation for ISAKMP |
RFC 2408 | Internet Security Association and Key Management Protocol (ISAKMP) |
Technical Assistance
Description | Link |
---|---|
The Cisco Support and Documentation website provides online resources to download documentation, software, and tools. Use these resources to install and configure the software and to troubleshoot and resolve technical issues with Cisco products and technologies. Access to most tools on the Cisco Support and Documentation website requires a Cisco.com user ID and password. | http://www.cisco.com/cisco/web/support/index.html |
Feature Information for Configuring Security for VPNs with IPsec
The following table provides release information about the feature or features described in this module. This table lists only the software release that introduced support for a given feature in a given software release train. Unless noted otherwise, subsequent releases of that software release train also support that feature.
Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/go/cfn. An account on Cisco.com is not required. Feature Name | Software Releases | Feature Information |
---|---|---|
Advanced Encryption Standard | Cisco IOS XE Release 2.1 | This feature adds support for the new encryption standard AES, which is a privacy transform for IPsec and IKE and has been developed to replace DES. The following commands were modified by this feature: crypto ipsec transform-set , encryption (IKE policy) , show crypto ipsec transform-set , show crypto isakmp policy . |
IKE Shared Secret Using AAA Server | Cisco IOS XE Release 2.1 | The IKE Shared Secret Using AAA Server feature enables key lookup from a AAA server. In Cisco IOS XE Release 2.1, this feature was implemented on Cisco ASR 1000 Series Aggregation Services Routers. |
Suite-B Support in IOS SW Crypto | Cisco IOS XE Release 3.7S | Suite-B adds support for four user interface suites of cryptographic algorithms for use with IKE and IPSec that are described in RFC 4869. Each suite consists of an encryption algorithm, a digital signature algorithm, a key agreement algorithm, and a hash or message digest algorithm. The following command was modified by this feature: crypto ipsec transform-set . |
Glossary
anti-replay —Security service where the receiver can reject old or duplicate packets to protect itself against replay attacks. IPsec provides this optional service by use of a sequence number combined with the use of data authentication. Cisco IOS XE IPsec provides this service whenever it provides the data authentication service, except for manually established SAs (that is, SAs established by configuration and not by IKE).
data authentication —Verification of the integrity and origin of the data. Data authentication can refer either to integrity alone or to both of these concepts (although data origin authentication is dependent upon data integrity).
data confidentiality —Security service in which the protected data cannot be observed.
data flow —Grouping of traffic, identified by a combination of source address or mask, destination address or mask, IP next protocol field, and source and destination ports, where the protocol and port fields can have the values of any . IPsec protection is applied to data flows.
IKE —Internet Key Exchange. IKE establishes a shared security policy and authenticates keys for services (such as IPSec) that require keys. Before any IPSec traffic can be passed, each router/firewall/host must verify the identity of its peer. This can be done by manually entering preshared keys into both hosts or by a CA service.
IPsec —IP Security. A framework of open standards that provides data confidentiality, data integrity, and data authentication between participating peers. IPSec provides these security services at the IP layer. IPSec uses IKE to handle the negotiation of protocols and algorithms based on local policy and to generate the encryption and authentication keys to be used by IPSec. IPSec can protect one or more data flows between a pair of hosts, between a pair of security gateways, or between a security gateway and a host.
peer —In the context of this module, a “peer” is a router or other device that participates in IPsec.
PFS —perfect forward secrecy. Cryptographic characteristic associated with a derived shared secret value. With PFS, if one key is compromised, previous and subsequent keys are not compromised, because subsequent keys are not derived from previous keys.
SA —security association. Description of how two or more entities use security services in the context of a particular security protocol (AH or ESP) to communicate securely on behalf of a particular data flow. The transform and the shared secret keys are used for protecting the traffic.
SPI —security parameter index. A number which, together with a destination IP address and security protocol, uniquely identifies a particular security association. Without IKE, the SPI is manually specified for each security association.
transform —List of operations performed on a dataflow to provide data authentication, data confidentiality, and data compression. For example, one transform is the ESP protocol with the HMAC-MD5 authentication algorithm; another transform is the AH protocol with the 56-bit DES encryption algorithm and the ESP protocol with the HMAC-SHA authentication algorithm.
tunnel —In the context of this module, “tunnel” is a secure communication path between two peers, such as two routers. It does not refer to using IPsec in tunnel mode.