- Index
- Preface
- Overview of the VPN Services Port Adapter
- Overview of the IPsec Features
- Configuring VPNs in Crypto-Connect Mode
- Configuring VPNs in VRF Mode
- Configuring IPSec VPN Fragmentation and MTU
- Configuring Quality of Service
- Configuring IKE Features
- Configuring Enhanced IPsec Features
- Configuring PKI
- Configuring Advanced VPNs
- Configuring Duplicate Hardware and IPsec Failover
- Configuring Monitoring and Accounting
- Troubleshooting
- Overview of Enhanced IPsec Features
- Configuring Advanced Encryption Standard in a Transform Set
- Configuring Reverse Route Injection
- Configuring the IPsec Anti-Replay Window Size
- Configuring an IPsec Preferred Peer
- Configuring IPsec Security Association Idle Timers
- Configuring Distinguished Name-Based Crypto Maps
- Advanced Encryption Standard Configuration Example
- Reverse Route Injection Configuration Examples
- IPsec Anti-Replay Window Size Configuration Examples
- IPsec Preferred Peer Configuration Examples
- IPsec Security Association Idle Timer Configuration Examples
- Distinguished Name-Based Crypto Maps Configuration Example
- Platform ACL Configuration Example
- Deny Policy Enhancements for ACLs Configuration Example
- IPv6 IPsec Configuration Example
Configuring Enhanced IPsec Features
This chapter provides information about configuring enhanced IPsec features using the VSPA on the Catalyst 6500 Series switch. It includes the following sections:
•Overview of Enhanced IPsec Features
•Configuring Advanced Encryption Standard in a Transform Set
•Configuring Reverse Route Injection
•Configuring the IPsec Anti-Replay Window Size
•Configuring an IPsec Preferred Peer
•Configuring IPsec Security Association Idle Timers
•Configuring Distinguished Name-Based Crypto Maps
•Configuring Platform ACLs for Tunnel Interfaces
•Configuring Sequenced Crypto ACLs
•Understanding IPv6 IPsec Support in the VSPA
Note For detailed information on Cisco IOS IPsec cryptographic operations and policies, see the Cisco IOS Security Configuration Guide, Release 12.2 at this URL:
http://www.cisco.com/en/US/docs/ios/12_2/security/configuration/guide/fsecur_c.html
For more information about the commands used in this chapter, see the Cisco IOS Security Command Reference at this URL:
http://www.cisco.com/en/US/docs/ios/security/command/reference/sec_book.html
Also refer to the related Cisco IOS Release 12.2 software configuration guide, command reference, and master index publications. For more information about accessing these publications, see the "Related Documentation" section on page xvi.
Tip To ensure a successful configuration of your VPN using the VSPA, read all of the configuration summaries and guidelines before you perform any configuration tasks.
Overview of Enhanced IPsec Features
IPsec is a framework of open standards developed by the Internet Engineering Task Force (IETF). It provides security for 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.
This chapter describes the advanced IPsec features that can be used to improve scalability and performance of your IPsec VPN.
Configuring Advanced Encryption Standard in a Transform Set
The Advanced Encryption Standard (AES) is a privacy transform for IPsec and Internet Key Exchange (IKE) that has been developed to replace the Data Encryption Standard (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.
To configure the AES encryption algorithm within a transform set, perform this task beginning in global configuration mode:
|
|
|
---|---|---|
Router(config)# crypto ipsec transform-set transform-set-name transform1[transform2[transform3]] ... |
Specifies a transform set and IPsec security profiles and algorithms. |
transform-set-name specifies the name of the transform set.
transform1[transform2[transform3]] defines IPsec security protocols and algorithms. To configure AES, you must choose from the following AES Encapsulating Security Payload (ESP) encryption transforms:
•esp-aes specifies ESP with the 128-bit AES encryption algorithm.
•esp-aes 192 specifies ESP with the 192-bit AES encryption algorithm.
•esp-aes 256 specifies ESP with the 256-bit AES encryption algorithm.
For other accepted transform values, and more details on configuring transform sets, see the Cisco IOS Security Command Reference.
Verifying the AES Transform Set
To verify the configuration of the transform set, enter the show crypto ipsec transform-set command:
Router# show crypto ipsec transform-set
Transform set transform-1:{esp-256-aes esp-md5-hmac}
will negotiate = {Tunnel, }
For more complete configuration information about AES support, refer to this URL:
http://www.cisco.com/en/US/docs/ios/12_2t/12_2t13/feature/guide/ft_aes.html
For an AES configuration example, see the "Advanced Encryption Standard Configuration Example" section.
Configuring Reverse Route Injection
Reverse Route Injection (RRI) provides the ability for static routes to be automatically inserted into the routing process for those networks and hosts protected by a remote tunnel endpoint. These protected hosts and networks are known as remote proxy identities.
Each route is created on the basis of the remote proxy network and mask, with the next hop to this network being the remote tunnel endpoint. By using the remote Virtual Private Network (VPN) router as the next hop, the traffic is forced through the crypto process to be encrypted.
After the static route is created on the VPN router, this information is propagated to upstream devices, allowing them to determine the appropriate VPN router to which to send returning traffic in order to maintain IPsec state flows. Being able to determine the appropriate VPN router is particularly useful if multiple VPN routers are used at a site to provide load balancing or failover or if the remote VPN devices are not accessible via a default route. Routes are created in either the global routing table or the appropriate virtual routing and forwarding (VRF) table.
RRI is applied on a per-crypto map basis, whether this is via a static crypto map or a dynamic crypto map template. For both dynamic and static maps, routes are created only at the time of IPsec SA creation. Routes are removed when the SAs are deleted. The static keyword can be added to the reverse-route command if routes are created on the basis of the content of the crypto ACLs that are permanently attached to the static crypto map.
RRI Configuration Guidelines and Restrictions
Follow these guidelines and restrictions when configuring RRI:
•IP routing should be enabled and static routes should be redistributed if dynamic routing protocols are to be used to propagate RRI-generated static routes.
•You can specify an interface or address as the explicit next hop to the remote VPN device. This functionality allows the overriding of a default route to properly direct outgoing encrypted packets.
•You can add a route tag value to any routes that are created using RRI. This route tag allows redistribution of groups of routes using route maps, allowing you to be selective about which routes enter your global routing table.
•RRI can be configured on the same crypto map that is applied to multiple router interfaces.
•The reverse-route remote-peer [static] command creates two routes. One route is the standard remote proxy ID and the next hop is the remote VPN client tunnel address. The second route is the actual route to that remote tunnel endpoint and is used when a recursive lookup requires that the remote endpoint be reachable by the next hop. Creation of the second route for the actual next hop is important in the VRF case in which a default route must be overridden by a more explicit route.
To reduce the number of routes created and support some platforms that do not readily facilitate route recursion, the reverse-route {ip-address} [static] keyword can be used to create one route only.
•For devices using a VSPA, reverse route specifies the next hop to be the interface, subinterface, or virtual LAN (VLAN) with the crypto map applied to it.
Configuring RRI Under a Static Crypto Map
To configure RRI under a static crypto map, perform the following steps beginning in global configuration mode:
Configuring RRI Under a Dynamic Crypto Map
To configure RRI under a dynamic crypto map, perform the following steps beginning in global configuration mode:
For more complete configuration information for RRI, see the following URL:
http://www.cisco.com/en/US/docs/ios/12_3t/12_3t14/feature/guide/gt_rrie.html
For RRI configuration examples, see the "Reverse Route Injection Configuration Examples" section.
Configuring the IPsec Anti-Replay Window Size
Cisco IPsec authentication provides anti-replay protection against an attacker duplicating encrypted packets by assigning a unique sequence number to each encrypted packet. (Security association (SA) anti-replay is a security service in which the receiver can reject old or duplicate packets to protect itself against replay attacks.) The decryptor checks off the sequence numbers that it has seen before. The encryptor assigns sequence numbers in an increasing order. The decryptor remembers the value (X) of the highest sequence number that it has already seen. N is the window size of the decryptor. Any packet with a sequence number less than X minus N is discarded. Currently, N is set at 64.
At times, the 64-packet window size is not sufficient. For example, Cisco quality of service (QoS) gives priority to high-priority packets, which could cause some low-priority packets to be discarded even though they are not replayed packets. The IPsec anti-replay window size feature allows you to expand the window size so that sequence number information can be kept for more than 64 packets.
Expanding the IPsec Anti-Replay Window Size Globally
To expand the IPsec anti-replay window globally so that it affects all SAs that are created (except for those that are specifically overridden on a per-crypto map basis), perform this task beginning in global configuration mode:
Expanding the IPsec Anti-Replay Window at the Crypto Map Level
To expand the IPsec anti-replay window on a crypto map basis so that it affects those SAs that have been created using a specific crypto map or profile, perform this task beginning in global configuration mode:
Verifying the IPsec Anti-Replay Window Size Configuration at the Crypto Map Level
To verify that IPsec anti-replay window size is enabled at a crypto map, enter the show crypto map command for that particular map. If anti-replay window size is enabled, the display will indicate that it is enabled and indicate the configured window size. If anti-replay window size is disabled, the results will indicate that also.
The following example indicates that IPsec anti-replay window size is enabled:
Router# show crypto map tag TESTMAP
Crypto Map "TESTMAP" 10 ipsec-isakmp
WARNING: This crypto map is in an incomplete state!
(missing peer or access-list definitions)
No matching address list set.
Security association lifetime: 4608000 kilobytes/3600 seconds
PFS (Y/N): N
Transform sets={
}
Antireplay window size = 128
Interfaces using crypto map TESTMAP:
For more complete configuration information for IPsec anti-replay window size, refer to the following URL:
http://www.cisco.com/en/US/docs/ios/12_3t/12_3t14/feature/guide/gt_iarwe.html
For IPsec anti-replay window size configuration examples, see the "IPsec Anti-Replay Window Size Configuration Examples" section.
Note Anti-replay failures detected by the VSPA can be caused by reordering, requeueing, or fragmentation elsewhere in the network. As a defense against man-in-the-middle attacks, the VSPA will drop these packets. This is the expected behavior.
Disabling the IPsec Anti-Replay Checking
To disable the IPsec anti-replay checking, enter the crypto ipsec security-association replay disable command in global configuration mode as follows:
|
|
|
---|---|---|
Router(config)# crypto ipsec security-association replay disable |
Disables the IPsec anti-replay checking. |
To disable the IPsec anti-replay checking on a particular crypto map, enter the set security-association replay disable command in crypto map configuration mode as follows:
Configuring an IPsec Preferred Peer
The IP Security (IPsec) Preferred Peer feature allows you to control the circumstances by which multiple peers on a crypto map are tried in a failover scenario. If there is a default peer, the next time a connection is initiated, the connection is directed to the default peer instead of to the next peer in the peer list. If all connections to the current peer time out, the next time a connection is initiated, it is directed to the default peer.
This feature includes the following capabilities:
•Default peer configuration
If a connection timeout occurs, the connection to the current peer is closed. The set peer command allows you to configure the first peer as the default peer. If there is a default peer, the next time a connection is initiated, the connection is directed to the default peer instead of to the next peer in the peer list. If the default peer is unresponsive, the next peer in the peer list becomes the current peer and future connections through the crypto map try that peer.
This capability is useful when traffic on a physical link stops due to the failure of a remote peer. DPD indicates that the remote peer is unavailable, but that peer remains the current peer.
A default peer facilitates the failover to a preferred peer that was previously unavailable, but has returned to service. Users can give preference to certain peers in the event of a failover. This is useful if the original failure was due to a network connectivity problem rather than failure of the remote peer.
To configure a default peer, see the "Configuring a Default Peer" section.
•IPsec idle timer with default peer configuration
When a router running Cisco IOS software creates an IPsec security association (SA) for a peer, resources must be allocated to maintain the SA. The SA requires both memory and several managed timers. For idle peers, these resources are wasted. If enough resources are wasted by idle peers, the router could be prevented from creating new SAs with other peers.
IPsec SA idle timers increase the availability of resources by deleting SAs associated with idle peers. Because IPsec SA idle timers prevent the wasting of resources by idle peers, more resources are available to create new SAs when required. (If IPsec SA idle timers are not configured, only the global lifetimes for IPsec SAs are applied. SAs are maintained until the global timers expire, regardless of peer activity.)
When both an IPsec SA idle timer and a default peer are configured and all connections to the current peer time out, the next time a connection is initiated it is directed to the default peer configured in the set peer command. If a default peer is not configured and there is a connection timeout, the peer that timed out remains the current peer.
This enhancement helps facilitate a failover to a preferred peer that was previously unavailable but is in service now.
To configure an IPsec idle timer, see the "Configuring the IPsec Idle Timer with a Default Peer" section.
IPsec Preferred Peer Configuration Guidelines and Restrictions
When configuring an IPsec preferred peer, follow these guidelines and restrictions:
•When configuring a default peer, follow these guidelines and restrictions:
–Only one peer can be designated as the default peer in a crypto map.
–The default peer must be the first peer in the peer list.
Note The default peer feature must be used in conjunction with Dead Peer Detection (DPD). It is most effective on a remote site running DPD in periodic mode. DPD detects the failure of a device quickly and resets the peer list so that the default peer is tried for the next attempted connection.
•When configuring IPsec idle timer usage with a default peer, follow these guidelines and restrictions:
–The IPsec idle timer usage with a default peer feature works only on the crypto map for which it is configured. You cannot configure the capability globally for all crypto maps.
–If there is a global idle timer, the crypto map idle timer value must be different from the global value; otherwise, the idle timer is not added to the crypto map.
Configuring a Default Peer
To configure a default peer, perform this task beginning in global configuration mode:
Configuring the IPsec Idle Timer with a Default Peer
To configure the IPsec idle timer with a default peer, perform this task beginning in global configuration mode:
For complete configuration information for IPsec preferred peer, see this URL:
http://www.cisco.com/en/US/docs/ios/12_3t/12_3t14/feature/guide/gt_ipspp.html
For IPsec preferred peer configuration examples, see the "IPsec Preferred Peer Configuration Examples" section.
Configuring IPsec Security Association Idle Timers
When a switch running Cisco IOS software creates an IPsec SA for a peer, resources must be allocated to maintain the SA. The SA requires both memory and several managed timers. For idle peers, these resources are wasted. If enough resources are wasted by idle peers, the switch could be prevented from creating new SAs with other peers. The IPsec security association idle timers feature introduces a configurable idle timer to monitor SAs for activity, allowing SAs for idle peers to be deleted. The idle timers can be configured either globally, on a per-crypto map basis, or through an ISAKMP profile. The benefits of this feature include the following:
•Increased availability of resources
•Improved scalability of Cisco IOS IPsec deployments
IPsec Security Association Idle Timer Configuration Guidelines
When configuring idle timers on a per-crypto map basis, follow these guidelines:
•When the idle timer is configured globally, the idle timer configuration will be applied to all SAs.
•When the idle timer is configured for a crypto map, the idle timer configuration will be applied to all SAs under the specified crypto map.
Configuring the IPsec SA Idle Timer Globally
To configure the IPsec SA idle timer globally, enter the crypto ipsec security-association idle-time command in global configuration mode as follows:
Configuring the IPsec SA Idle Timer per Crypto Map
To configure the IPsec SA idle timer for a specified crypto map, use the set security-association idle-time command within a crypto map configuration:
For detailed information on configuring IPsec SA idle timers, refer to the following Cisco IOS documentation:
http://www.cisco.com/en/US/docs/ios/12_2t/12_2t15/feature/guide/ftsaidle.html
For IPsec SA idle timer configuration examples, see the "IPsec Security Association Idle Timer Configuration Examples" section.
Configuring Distinguished Name-Based Crypto Maps
The distinguished name-based crypto maps feature allows you to configure the switch to restrict access to selected encrypted interfaces for those peers with specific certificates, especially certificates with particular distinguished names (DNs).
Previously, if the switch accepted a certificate or a shared secret from the encrypting peer, Cisco IOS did not have a method of preventing the peer from communicating with any encrypted interface other than the restrictions on the IP address of the encrypting peer. This feature allows you to configure which crypto maps are usable to a peer based on the DN that a peer used to authenticate itself, which enables you to control which encrypted interfaces a peer with a specified DN can access. You can configure a DN-based crypto map that can be used only by peers that have been authenticated by a DN or one that can be used only by peers that have been authenticated by a hostname.
Distinguished Name-Based Crypto Map Configuration Guidelines and Restrictions
When configuring a DN-based crypto map, follow these guidelines and restrictions:
•If you restrict access to a large number of DNs, we recommend that you specify a few number of crypto maps referring to large identity sections instead of specifying a large number of crypto maps referring to small identity sections.
Configuring a DN-Based Crypto Map
To configure a DN-based crypto map that can be used only by peers that have been authenticated by a DN, or one that can be used only by peers that have been authenticated by a hostname, perform this task beginning in global configuration mode:
For complete configuration information for distinguished name-based crypto maps, refer to this URL:
http://www.cisco.com/en/US/docs/ios/12_2t/12_2t4/feature/guide/ftdnacl.html
For a distinguished name-based crypto map configuration example, see the "Distinguished Name-Based Crypto Maps Configuration Example" section.
Configuring Platform ACLs for Tunnel Interfaces
You can apply access control lists (ACLs) to tunnel interfaces.
Platform ACL on Tunnel Interfaces Configuration Guidelines and Restrictions
When configuring platform ACLs for a VSPA, follow these guidelines and note these restrictions:
•ACLs can be applied to the tunnel interface in any of these situations:
–GRE in crypto-connect mode, whether or not GRE is taken over by the VSPA
–GRE with tunnel protection, whether or not GRE is taken over by the VSPA
–Static VTI
–DMVPN, in either crypto-connect or VRF mode
•Permit and deny ACLs can be applied to GRE tunnel interfaces in either the inbound or outbound direction.
•In crypto-connect mode with GRE, when GRE is not taken over by the VSPA, apply the ACL to the interface VLAN to filter GRE-encapsulated packets, or to the tunnel interface to filter clear IP packets.
•In crypto-connect mode with GRE, when GRE is taken over by the VSPA, ACLs on the interface VLAN are not supported. Apply the ACL to the tunnel interface to filter clear IP packets.
•ACLs on tunnels are supported in blade-to-blade failover.
•ACLs will be applied to transit packets, but will not be applied to packets generated by the switch.
For a platform ACL configuration example, see the "Platform ACL Configuration Example" section.
Configuring Sequenced Crypto ACLs
Access control lists (ACLs) are made up of access control entries (ACEs). With sequenced ACLs, ACEs can be entered with a sequence number in front of the ACE and the ACEs are then processed by sequence number. Additionally, ACEs can be deleted one at a time by using the sequence number in the front of the ACE that you want to delete. The sequence numbers do not appear in the configuration but they can be displayed using the show access-list command.
Note If an ACE is removed or modified, the ACL is reconfigured on the module, which might result in the closing of existing sessions.
Configuring Deny Policy Enhancements for Crypto ACLs
Use the crypto ipsec ipv4-deny {jump | clear | drop} command set as follows:
•The jump keyword is not supported.
•The clear keyword allows a deny address range to be programmed in hardware. The deny addresses are then filtered out for encryption and decryption. If the VPN mode is crypto-connect, when a deny address is hit, the search is stopped and traffic is allowed to pass in the clear (unencrypted) state. If the VPN mode is VRF, the deny address matching traffic is dropped.
•The drop keyword causes traffic to be dropped when a deny address is hit.
The clear and drop keywords can be used to prevent repeated address ranges from being programmed in the hardware, resulting in more efficient TCAM space utilization.
Deny Policy Enhancements for ACLs Configuration Guidelines and Restrictions
When configuring the deny policy enhancements, follow these guidelines and restrictions:
•The crypto ipsec ipv4-deny {jump | clear | drop} command is a global command that is applied to a single VSPA. The specified keyword (jump, clear, or drop) is propagated to the ACE software of the VSPA. The default behavior is clear.
•When the clear keyword is used with VRF mode, deny address traffic is dropped rather than passed in the clear state. VRF mode does not pass traffic in the clear state.
•If you apply the specified keyword (jump, clear, or drop) when crypto maps are already configured on the VSPA, all existing IPsec sessions are temporarily removed and restarted, which impacts traffic on your network.
•The number of deny entries that can be specified in an ACL are dependent on the keyword specified:
–jump—Not supported.
–clear—Supports up to 1000 deny entries in an ACL.
–drop—Supports up to 1000 deny entries in an ACL.
For a deny policy enhancements configuration example, see the "Deny Policy Enhancements for ACLs Configuration Example" section.
Understanding IPv6 IPsec Support in the VSPA
The VSPA supports IPv6 encryption and decryption for configurations using a static virtual tunnel interface (sVTI) in VRF mode where all tunnel interfaces are terminated in the global context.
This section contains the following topics:
•IPv6 IPsec Configuration Guidelines and Restrictions
•Tunnel Source Address Selection
IPv6 IPsec Configuration Guidelines and Restrictions
When configuring IPsec for IPv6, follow these guidelines and note these restrictions:
•A tunnel must be either IPv4 or IPv6. If you assign both an IPv4 address and an IPv6 address to a tunnel, packets for the tunnel will be dropped.
•We recommend that you explicitly configure the tunnel source with an IPv6 address instead of an interface name to avoid ambiguity, because the tunnel source address will be used as your IKE local endpoint address. IKE supports only preshared key authentication, using the endpoint address as an ID.
•The VSPA supports a maximum IPv6 MTU of 9216. Packets that exceed the path MTU of the tunnel will be dropped and the VSPA will send a PMTU Packet Too Big message to the source host. IPv6 packets are fragmented only by the originating host.
•The number of IPv6 sVTI tunnels supported by the VSPA depends on the routing protocol used, as shown in the following table:
|
|
---|---|
Static |
1000 |
BGP |
500 |
EIGRP |
500 |
OSPFv3 |
200 |
RIPng |
200 |
•The following features are not supported by the VSPA for IPv6:
–Crypto connect mode
–IP VRF forwarding on IPv6 tunnel interfaces
–OSPFv3 with authentication (OSPFv3 through the tunnel is supported)
–Intermediate System-to-Intermediate System (IS-IS) routing protocol
–Multicast
–IPv4-in-IPv6, IPv6-in-IPv4
–AH encapsulation
–Path MTU discovery (PMTUD)
–Dead peer detection (DPD, PDPD)
–Extension headers on encrypted packets (extension headers on cleartext packets are supported)
–Crypto certificates
–MPLS
–HSRPv6
–Unless explicitly stated, platform features (such as QoS and ACL) applied to the tunnel interface are not supported
Tunnel Source Address Selection
IPv6 allows an interface to have multiple aggregatable global unicode (AGU) addresses and a link-local address. If a single global unicast address is configured on the tunnel interface, then that address will be used as the tunnel source address. If multiple global unicast addresses are configured, then the first address will be used. If no global unicast address is configured on the tunnel interface, then the link-local address will be used.
Configuring IPv6 IPsec
To configure IPsec for IPv6, perform this task:
For IPv6 IPsec configuration examples, see the "IPv6 IPsec Configuration Example" section.
Configuration Examples
This section provides examples of the following configurations:
•Advanced Encryption Standard Configuration Example
•Reverse Route Injection Configuration Examples
•IPsec Anti-Replay Window Size Configuration Examples
•IPsec Preferred Peer Configuration Examples
•IPsec Security Association Idle Timer Configuration Examples
•Distinguished Name-Based Crypto Maps Configuration Example
•Platform ACL Configuration Example
•Deny Policy Enhancements for ACLs Configuration Example
•IPv6 IPsec Configuration Example
Advanced Encryption Standard Configuration Example
The following example configures the Advanced Encryption Standard (AES) 256-bit key:
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
Reverse Route Injection Configuration Examples
The following examples show how to configure RRI:
•RRI Under a Static Crypto Map Configuration Example
•RRI Under a Dynamic Crypto Map Configuration Example
•RRI with Existing ACLs Configuration Example
•RRI for Two Routes Configuration Example
•RRI via a User-Defined Hop Configuration Example
RRI Under a Static Crypto Map Configuration Example
The following example shows how to configure RRI under a static crypto map. In this example, the RRI-created route has been tagged with a tag number. This tag number can then be used by a routing process to redistribute the tagged route via a route map:
Router(config)# crypto map mymap 1 ipsec-isakmp
Router(config-crypto-map)# reverse-route tag 5
RRI Under a Dynamic Crypto Map Configuration Example
The following example shows how to configure RRI under a dynamic crypto map:
Router(config)# crypto dynamic-map mymap 1
Router(config-crypto-map)# reverse-route remote peer 10.1.1.1
RRI with Existing ACLs Configuration Example
The following example shows how to configure RRI for a situation in which there are existing ACLs:
Router(config)# crypto map mymap 1 ipsec-isakmp
Router(config-crypto-map)# set peer 172.17.11.1
Router(config-crypto-map)# reverse-route static
Router(config-crypto-map)# set transform-set esp-3des-sha
Router(config-crypto-map)# match address 101
access-list 101 permit ip 192.168.1.0 0.0.0.255 172.17.11.0 0.0.0.255
RRI for Two Routes Configuration Example
The following example shows how to configure two routes, one for the remote endpoint and one for route recursion to the remote endpoint via the interface on which the crypto map is configured:
Router(config-crypto-map)# reverse-route remote-peer
RRI via a User-Defined Hop Configuration Example
The following example shows that one route has been created to the remote proxy via a user-defined next hop. This next hop should not require a recursive route lookup unless it will recurse to a default route.
Router(config-crypto-map)# reverse-route remote-peer 10.4.4.4
IPsec Anti-Replay Window Size Configuration Examples
The following examples show how to configure the IPsec anti-replay window size:
•IPsec Anti-Replay Window Global Configuration Example
•IPsec Anti-Replay Window per Crypto Map Configuration Example
IPsec Anti-Replay Window Global Configuration Example
The following example shows that the anti-replay window size has been set globally to 1024:
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname VPN-Gateway1
!
boot-start-marker
boot-end-marker
!
clock timezone EST 0
no aaa new-model
ip subnet-zero
!
ip audit po max-events 100
no ftp-server write-enable
!
crypto isakmp policy 10
authentication pre-share
crypto isakmp key cisco123
address 192.165.201.2
!
crypto ipsec security-association replay window-size 1024
!
crypto ipsec transform-set basic esp-des esp-md5-hmac
!
crypto map mymap 10 ipsec-isakmp
set peer 192.165.201.2
set transform-set basic
match address 101
!
interface Ethernet0/0
ip address 192.168.1.1 255.255.255.0
!
interface Serial1/0
ip address 192.165.200.2 255.255.255.252
serial restart-delay 0
crypto map mymap
!
ip classless
ip route 0.0.0.0 0.0.0.0 192.165.200.1
no ip http server
no ip http secure-server
!
access-list 101 permit ip 192.168.1.0 0.0.0.255 172.16.2.0 0.0.0.255
!access-list 101 remark Crypto ACL
!
control-plane
!
line con 0
line aux 0
line vty 0 4
end
IPsec Anti-Replay Window per Crypto Map Configuration Example
The following example shows that anti-replay checking is disabled for IPsec connections to 172.150.150.2, but enabled (and the default window size is 64) for IPsec connections to 172.150.150.3 and 172.150.150.4:
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname dr_whoovie
!
enable secret 5 $1$KxKv$cbqKsZtQTLJLGPN.tErFZ1
enable password ww
!
ip subnet-zero
cns event-service server
crypto isakmp policy 1
authentication pre-share
crypto isakmp key cisco170
address 172.150.150.2
crypto isakmp key cisco180
address 172.150.150.3
crypto isakmp key cisco190
address 172.150.150.4
crypto ipsec transform-set 170cisco esp-des esp-md5-hmac
crypto ipsec transform-set 180cisco esp-des esp-md5-hmac
crypto ipsec transform-set 190cisco esp-des esp-md5-hmac
crypto map ETH0 17 ipsec-isakmp
set peer 172.150.150.2
set security-association replay disable
set transform-set 170cisco
match address 170
crypto map ETH0 18 ipsec-isakmp
set peer 150.150.150.3
set transform-set 180cisco
match address 180
crypto map ETH0 19 ipsec-isakmp
set peer 150.150.150.4
set transform-set 190cisco
match address 190
!
interface Ethernet0
ip address 172.150.150.1 255.255.255.0
no ip directed-broadcast
no ip route-cache
no ip mroute-cache
no mop enabled
crypto map ETH0
!
interface Serial0
ip address 172.160.160.1 255.255.255.0
no ip directed-broadcast
no ip mroute-cache
no fair-queue
!
ip classless
ip route 172.170.170.0 255.255.255.0 172.150.150.2
ip route 172.180.180.0 255.255.255.0 172.150.150.3
ip route 172.190.190.0 255.255.255.0 172.150.150.4
no ip http server
!
access-list 170 permit ip 172.160.160.0 0.0.0.255 172.170.170.0 0.0.0.255
access-list 180 permit ip 172.160.160.0 0.0.0.255 172.180.180.0 0.0.0.255
access-list 190 permit ip 172.160.160.0 0.0.0.255 172.190.190.0 0.0.0.255
!
dialer-list 1 protocol ip permit
dialer-list 1 protocol ipx permit
!
line con 0
transport input none
line aux 0
line vty 0 4
password ww
login
end
IPsec Preferred Peer Configuration Examples
The following examples show how to configure an IPsec preferred peer:
•Default Peer Configuration Example
•IPsec Idle Timer with Default Peer Configuration Example
Default Peer Configuration Example
The following example shows how to configure a default peer. In this example, the first peer, at IP address 1.1.1.1, is the default peer:
Router(config)# crypto map tohub 1 ipsec-isakmp
Router(config-crypto-map)# set peer 1.1.1.1 default
Router(config-crypto-map)# set peer 2.2.2.2
Router(config-crypto-map)# exit
IPsec Idle Timer with Default Peer Configuration Example
The following example shows how to configure an IPsec idle timer with a default peer. In the following example, if the current peer is idle for 600 seconds, the default peer 1.1.1.1 (which was specified in the set peer command) is used for the next attempted connection:
Router (config)# crypto map tohub 1 ipsec-isakmp
Router(config-crypto-map)# set peer 1.1.1.1 default
Router(config-crypto-map)# set peer 2.2.2.2
Router(config-crypto-map)# set security-association idle-time 600 default
Router(config-crypto-map)# exit
IPsec Security Association Idle Timer Configuration Examples
The following examples show how to configure the IPsec SA idle timer:
•IPsec SA Idle Timer Global Configuration Example
•IPsec SA Idle Timer per Crypto Map Configuration Example
IPsec SA Idle Timer Global Configuration Example
The following example globally configures the IPsec SA idle timer to drop SAs for inactive peers after 600 seconds:
Router(config)# crypto ipsec security-association idle-time 600
IPsec SA Idle Timer per Crypto Map Configuration Example
The following example configures the IPsec SA idle timer for the crypto map named test to drop SAs for inactive peers after 600 seconds:
Router(config) # crypto map test 1 ipsec-isakmp
Router(config-crypto-map)# set security-association idle-time 600
Distinguished Name-Based Crypto Maps Configuration Example
The following example shows how to configure DN-based crypto maps that have been authenticated by DN and hostname. Comments are included inline to explain various commands.
! DN based crypto maps require you to configure an IKE policy at each peer.
crypto isakmp policy 15
encryption 3des
hash md5
authentication rsa-sig
group 2
lifetime 5000
crypto isakmp policy 20
authentication pre-share
lifetime 10000
crypto isakmp key 1234567890 address 171.69.224.33
!
!The following is an IPsec crypto map (part of IPsec configuration). It can be used only
! by peers that have been authenticated by DN and if the certificate belongs to BigBiz.
crypto map map-to-bigbiz 10 ipsec-isakmp
set peer 172.21.114.196
set transform-set my-transformset
match address 124
identity to-bigbiz
!
crypto identity to-bigbiz
dn ou=BigBiz
!
!
! This crypto map can be used only by peers that have been authenticated by hostname
!and if the certificate belongs to little.com.
crypto map map-to-little-com 10 ipsec-isakmp
set peer 172.21.115.119
set transform-set my-transformset
match address 125
identity to-little-com
!
crypto identity to-little-com
fqdn little.com
!
Platform ACL Configuration Example
This example shows a tunnel configuration with inbound and outbound ACLs:
interface Tunnel1
ip vrf forwarding i1
ip address 26.0.1.2 255.255.255.0
ip access-group T1ACL_IN in
ip access-group T1ACL_OUT out
ip mtu 1400
tunnel source 27.0.1.2
tunnel destination 67.0.1.6
tunnel vrf f1
tunnel protection ipsec profile TUN_PROTECTION
crypto engine slot 3/0 inside
!
!
ip access-list extended T1ACL_IN
permit tcp any any
permit icmp any any
permit ip any host 50.0.1.2 precedence critical
permit ip any host 50.0.1.2 precedence internet
permit ip any host 50.0.1.2 precedence priority
permit ip any host 50.0.1.2 precedence flash
deny ip any any
ip access-list extended T1ACL_OUT
permit tcp any any
permit icmp any any
permit ip any host 60.0.1.2 precedence critical
permit ip any host 60.0.1.2 precedence internet
permit ip any host 60.0.1.2 precedence priority
permit ip any host 60.0.1.2 precedence flash
deny ip any any
Deny Policy Enhancements for ACLs Configuration Example
The following example shows a configuration using the deny policy clear option. In this example, when a deny address is hit, the search will stop and traffic will be allowed to pass in the clear (unencrypted) state:
Router(config)# crypto ipsec ipv4-deny clear
IPv6 IPsec Configuration Example
This example shows how to configure IPv6 IPsec between a hub and a spoke:
Hub Configuration
ipv6 unicast-routing
crypto engine mode vrf
crypto isakmp policy 1
encr aes 192
group 2
auth pre-share
lifetime 7200
crypto isakmp key 12345 address ipv6 ::/0
crypto ipsec transform-set ts esp-aes 256 esp-sha-hmac
!
! WAN interface
!
interface TenGigabitEthernet3/2
mtu 9216
ipv6 enable
ipv6 address 2001:410:4::1/48
crypto engine outside
no shut
!
! LAN interface
!
interface TenGigabitEthernet3/1
mtu 9216
ipv6 enable
ipv6 address 2001:410:5::2/48
no shut
crypto ipsec profile tp
set transform-set ts
interface Loopback1
ipv6 address 2001:410:1:1::1/128
no shut
interface Tunnel1
ipv6 enable
ipv6 address 2001:410:2:1::1/64
tunnel source Loopback1
tunnel destination 2001:410:1:2::1
tunnel mode ipsec ipv6
tunnel protection ipsec profile tp
crypto engine slot 5/0 inside
no shut
!
ipv6 route 2001:410:1:2::/64 2001:410:4::2
ipv6 route 2001:410:8:1::1/128 Tunnel1
!
Spoke Configuration
ipv6 unicast-routing
crypto engine mode vrf
crypto isakmp policy 1
encr aes 192
group 2
auth pre-share
lifetime 7200
crypto isakmp key 12345 address ipv6 ::/0
crypto ipsec transform-set ts esp-aes 256 esp-sha-hmac
!
! WAN interface
!
interface TenGigabitEthernet2/3
mtu 9216
ipv6 enable
ipv6 address 2001:410:4::2/48
crypto engine outside
no shut
!
! LAN interface
!
interface TenGigabitEthernet2/1
mtu 9216
ipv6 enable
ipv6 address 2001:410:6::1/48
no shut
crypto ipsec profile tp
set transform-set ts
interface Loopback1
ipv6 address 2001:410:1:2::1/128
no shut
interface Tunnel1
ipv6 enable
ipv6 address 2001:410:2:1::2/64
tunnel source Loopback1
tunnel destination 2001:410:1:1::1
tunnel mode ipsec ipv6
tunnel protection ipsec profile tp
crypto engine slot 4/0 inside
no shut
!
ipv6 route 2001:410:1:1::/64 2001:410:4::1
ipv6 route 2001:410:7:1::1/128 Tunnel1
!