VPN problems are most commonly caused by device misconfigurations. Common errors made when implementing a VPN solution include tunnel and IPsec misconfigurations. The following are common issues that should be considered when establishing or troubleshooting site-to-site VPNs:
- Overlapping IP address space
- GRE and IPsec configurations
- MTU size
- Routing problems
- Device resource utilization
Overlapping IP Address Space
Given the significant use of private addressing space in IPv4 networks, it is not uncommon for multiple sites to have overlapping addresses, as illustrated in Figure 13-3 below:
Fig. 13-3. Overlapping Address Space
The overlapping address space requires that NAT be used to allow LAN-to-LAN connectivity between the sites. NAT adds additional complexities to the VPN implementation and configuration. Consideration should also be given to any other applications that are not compatible with NAT. For example, NAT can prevent IPTV from working. NAT implementation and troubleshooting was described earlier in this guide. It will not be included again in this chapter for brevity.
GRE and IPsec Configurations
Generic Routing Encapsulation (GRE) and IPsec misconfigurations are common causes of site-to-site VPN issues. Issues such as tunnel encapsulation, tunnel source, and destination address misconfigurations are quite common, especially when implementing multiple tunnels in large networks. When implementing dynamic routing protocols, ensure that the routing protocols are enabled for the correct networks. Incorrect routing protocol configuration can result in recursive routing failures. Recursive routing is described in additional detail later in this chapter. Tunneling configuration was described in detail earlier in this guide.
IPsec misconfigurations are also very common and contribute to a large number of IPsec VPN problem reports. Because Cisco IOS IPsec site-to-site VPN configuration generally includes more lines of configuration than other technologies, some engineers cut-and-paste configurations from one device to another. While this is a straightforward process, one problem is that sometimes they forget to change all the necessary parameters, a very common example being the ACL that is used for the interesting traffic. Understanding the overall IPsec process also helps to facilitate the troubleshooting process. There are five steps in the IPsec process, which are used to establish the IPsec VPN session. Understanding the following five steps will greatly aid IPsec VPN troubleshooting:
- Interesting traffic initiates the IPsec process
- IKE phase 1
- IKE phase 2
- Secure data transfer
- The termination of the IPsec tunnel
The following sections take a more detailed look at each of these steps and include some of the troubleshooting and verification commands that you can use during each of these steps or phases when troubleshooting or verifying IPsec VPN operation in Cisco IOS software routers.
The first step in establishing the IPsec tunnel is that interesting traffic must initiate this process. When implementing crypto commands in Cisco IOS software, as was illustrated earlier in the chapter, an ACL is required to define the traffic that is considered interesting. The ACL is then assigned to a crypto policy that allows this traffic to be encrypted based on the parameters specified in the crypto configuration. Traffic that does not match or is explicitly denied by the ACL will not be encrypted or acted upon by the crypto configuration referencing that ACL.
You can use the show ip access-lists command to determine which traffic is matched by an ACL. In situations where multiple ACLs exist on the router, consider using the show crypto map <name> command, as this includes all configuration parameters for the specified crypto map, which includes the ACL assigned to this map as illustrated below:
| R4#show crypto map Crypto Map “VPN-EXAMPLE” 1 ipsec-isakmp Description: ‘Secure VPN Tunnel To 150.1.1.1 (R1)’ Peer = 150.1.1.1 Extended IP access list 100 access-list 100 permit ip 172.16.4.0 0.0.0.255 172.16.1.0 0.0.0.255 Current peer: 150.1.1.1 Security association lifetime: 4608000 kilobytes/3600 seconds PFS (Y/N): N Transform sets={ ESP-3DES-SHA, } Interfaces using crypto map VPN-EXAMPLE: Serial0/0 |
Referencing the output above, the ACL assigned to crypto map “VPN-EXAMPLE” will initiate the IPsec process only if traffic or packets from the 172.16.4.0/24 subnet destined to the 172.16.1.0/24 subnet are received by the local router. This configuration does not imply that packets from 172.16.1.0/24 to 172.16.4.0/24 are also encrypted. In the event that you see no matches against the ACL, verify the configuration.
In the second step, IKE phase 1, IKE authenticates IPsec peers and negotiates IKE SAs. As stated earlier in this chapter, phase 1 operations are required infrequently and can use main mode or aggressive mode. Main mode is the default method used in most implementations. Main mode defines six message exchanges to establish SA. Alternatively, aggressive mode uses only three message exchanges to establish phase 1. The basic steps in phase 1 include the following:
- Negotiating the security policy: This includes negotiating the security algorithms and hashes used to secure IKE communications.
- Establish a shared secret key: This is performed using the Diffie-Hellman exchange. Cisco IOS supports three Diffie-Hellman groups: group 1, group 2, and group 5.
- Verify the identity of the peer: The identity value is the peer’s IP address in encrypted form. Three methods can be used for peer authentication: public key encryption, pre-shared key (the most common), and public key signature.
You can verify the options that will be used in policy negotiation (i.e., the security algorithms and hashes selected by the administrator) using the show crypto isakmp policy command. A sample output of the information that is printed by this command is illustrated below:
| R4#show crypto isakmp policy |
Global IKE policy
Protection suite of priority 1
encryption algorithm: Three key triple DES
hash algorithm: Secure Hash Standard
authentication method: Pre-Shared Key
Diffie-Hellman group: #2 (1024 bit)
lifetime: 86400 seconds, no volume limit
Default protection suite
encryption algorithm: DES – Data Encryption Standard (56 bit keys)
hash algorithm: Secure Hash Standard
authentication method: Rivest-Shamir-Adleman Signature
Diffie-Hellman group: #1 (768 bit)
lifetime: 86400 seconds, no volume limit
Referencing the output above, we can determine that policy 1 has been configured to use Triple-DES (3DES) encryption, the SHA hashing algorithm (default), the pre-shared key method for peer authentication, and Diffie-Hellman group 2 (1024 bit) for key exchange. Finally, this policy is using the default lifetime value.
Also, for phase 1 verification, you can verify the identity of the peer using the show crypto iskamp peers <address> command, which prints the IP address(es) of the peer. This is printed in clear text. A sample output of the information printed by this command is illustrated below:
| R4#show crypto isakmp peers Peer: 150.1.1.1 Port: 500 Local: 150.4.4.4 Phase1 id: 150.1.1.1 |
In the third step, IKE phase 2, IKE negotiates IPsec SA parameters and sets up matching IPsec SAs in the peers. This second phase negotiates the protection suite, the algorithms that will be used within the protection suite, and the network that will be encrypted. The following list summarizes the actions that are performed during IKE phase 2:
- The negotiation of IPsec SA parameters
- The establishment of IPsec SAs
- The periodic renegotiation of IPsec SAs
In addition to these three functions, sometimes an additional Diffie-Hellman exchange may be performed. In Cisco IOS software, use the show crypto ipsec sa command to display all information about the SAs, in addition to other information such as identity information and packet counts. Because SAs are unidirectional, there will be one inbound and one outbound SA for both AH and ESP. A sample output of the information printed by this command is illustrated below:
| R4#show crypto ipsec sa |
interface: Serial0/0
Crypto map tag: VPN-EXAMPLE, local addr 150.4.4.4
protected vrf: (none)
local ident (addr/mask/prot/port): (172.16.4.0/255.255.255.0/0/0)
remote ident (addr/mask/prot/port): (172.16.1.0/255.255.255.0/0/0)
current_peer 150.1.1.1 port 500
PERMIT, flags={origin_is_acl,}
#pkts encaps: 54, #pkts encrypt: 54, #pkts digest: 54
#pkts decaps: 54, #pkts decrypt: 54, #pkts verify: 54
#pkts compressed: 0, #pkts decompressed: 0
#pkts not compressed: 0, #pkts compr. failed: 0
#pkts not decompressed: 0, #pkts decompress failed: 0
#send errors 1, #recv errors 0
local crypto endpt.: 150.4.4.4, remote crypto endpt.: 150.1.1.1
path mtu 1500, ip mtu 1500, ip mtu idb Serial0/0
current outbound spi: 0xF8E1F449(4175557705)
inbound esp sas:
spi: 0x34AA253B(883565883)
transform: esp-3des esp-sha-hmac ,
in use settings ={Tunnel, }
conn id: 2001, flow_id: SW:1, crypto map: VPN-EXAMPLE
sa timing: remaining key lifetime (k/sec): (4447424/2093)
IV size: 8 bytes
replay detection support: Y
Status: ACTIVE
inbound ah sas:
inbound pcp sas:
outbound esp sas:
spi: 0xF8E1F449(4175557705)
transform: esp-3des esp-sha-hmac ,
in use settings ={Tunnel, }
conn id: 2002, flow_id: SW:2, crypto map: VPN-EXAMPLE
sa timing: remaining key lifetime (k/sec): (4447424/2092)
IV size: 8 bytes
replay detection support: Y
Status: ACTIVE
outbound ah sas:
outbound pcp sas:
In the fourth step, the data is then transferred securely. This follows the successful completion of IKE phase 2 (i.e., quick mode). Quick mode uses the message exchanges described in the previous section to establish the phase 2 IPsec SA. Once established, data can then be securely transferred across the IPsec tunnel and the negotiated parameters are applied to the traffic.
In this step, traffic is encrypted by the local router and decrypted by the peer (i.e., remote router) prior to being forwarded to the intended destination. In Cisco IOS software, you can verify active crypto sessions using the show crypto session [detail] command. A sample output of the information that is printed by this command, when the optional detail keyword is included, is illustrated below:
| R4#show crypto session detail Crypto session current status |
Code: C – IKE Configuration mode, D – Dead Peer Detection
K – Keepalives, N – NAT-traversal, X – IKE Extended Authentication
Interface: Serial0/0
Session status: UP-ACTIVE
Peer: 150.1.1.1 port 500 fvrf: (none) ivrf: (none)
Phase1_id: 150.1.1.1
Desc: (none)
IKE SA: local 150.4.4.4/500 remote 150.1.1.1/500 Active
Capabilities:(none) connid:1 lifetime:23:22:43
IPSEC FLOW: permit ip 172.16.4.0/255.255.255.0 172.16.1.0/255.255.255.0
Active SAs: 2, origin: crypto map
Inbound: #pkts dec’ed 746 drop 0 life (KB/Sec) 4447322/1364
Outbound: #pkts enc’ed 746 drop 1 life (KB/Sec) 4447322/1364
Finally, in the last step, the termination of the IPsec tunnel, the IPsec SAs are terminated either by deleting them, by exceeding a specified byte count, or simply by timing out. The termination of the IPsec tunnel means that the negotiated key is also discarded. In the event that a new session is required, phase 2 performs an optional Diffie-Hellman exchange and continues through the remaining steps. Alternatively, the process begins again at phase 1.
MTU Size
IP supports a maximum length of 65,536 bytes for an IP packet. However, this is not supported by all Data Link protocols. Based on the supported MTU, it might be necessary to fragment packets to transmit them across a particular Data Link Layer media type. The destination then has to reassemble the fragments back into the original, complete IP packet. When you are implementing VPN solutions, it is important to understand that in order to protect data, additional overhead is added to the original data, which then sometimes requires that these packets be fragmented. Table 13-3 below shows the additional overhead (in bytes) that could potentially be added to the original data when you are implementing a secure VPN solution:
Table 13-3. Additional Overhead Introduced by Security Protocols
|
Protocol |
Additional Overhead (Bytes) |
| Encapsulating Security Protocol (ESP) |
56 |
| Authentication Header (AH) |
24 |
| Generic Routing Encapsulation (GRE) |
24 |
| NAT-Traversal / IPsec over UDP |
8 |
| IPsec over TCP |
20 |
Taking these values into consideration, you should keep in mind that, as with PPPoE, you may need to change the MTU and MSS values on the routers in order to avoid fragmentation or to allow connectivity to applications that stop working following the VPN tunnel implementation.
Routing Problems
In large site-to-site VPN implementations, you will most likely consider using DMVPN instead of the traditional IPsec VPN. Unlike traditional IPsec VPNs, DMVPN uses the Cisco GRE protocol to encapsulate packets. This allows you to run dynamic routing protocols for the VPN. In addition to the other potential issues with GRE, introducing routing protocols can result in recursive routing issues. Recursive routing is caused by routing protocol misconfigurations that result in the tunnel interface learning the best path to the tunnel destination through itself. When this happens, Cisco IOS software will print messages on the console similar to the following:
| %TUN-5-RECURDOWN: Tunnel0 temporarily disabled due to recursive routing %TUN-5-RECURDOWN: Tunnel1 temporarily disabled due to recursive routing %TUN-5-RECURDOWN: Tunnel2 temporarily disabled due to recursive routing |
When the router detects a recursive routing failure for the tunnel destination, it shuts the tunnel interface down for a few minutes so that the situation causing the problem can resolve itself as routing protocols converge. If the problem is caused by misconfiguration, the tunnel may continue to flap indefinitely. Recursive routing may also be caused by routing protocol neighbor flaps, when these neighbor relationships are established over the tunnel itself. Cisco recommends the following to avoid creating recursive routing failures on tunnel interfaces:
- Using a different Autonomous System number or tag
- Using a different routing protocol
- Using static routes to override the first hop, but watch for routing loops
In addition to recursive routing issues, implementing GRE tunnels can result in suboptimal routing because GRE tunnels are point-to-point. For example, in a traditional tunnel implementation across a hub-and-spoke network, each spoke might have a single tunnel configured to the hub site. This same tunnel is therefore also used for inter-spoke traffic, increasing the load on the hub router and inefficiently using resources. In such topologies, consider implementing a DMVPN solution over the hub-and-spoke network instead.
With DMVPN, only the tunnel between the hub router and each individual spoke router will be up continuously. When data needs to be securely exchanged between spoke sites, the spokes use Next Hop Resolution Protocol (NHRP) to determine dynamically the required destination address of the destination spoke. A tunnel is then established to the destination spoke router, allowing for secure data exchange. After the data transfer, the tunnel is dynamically torn down after a period of inactivity.
Because the DMVPN solution is based on GRE tunnels, which support the tunneling of Unicast, Multicast, and Broadcast packets, it also supports dynamic routing protocols, versus the traditional IPsec VPN solution. Routing protocol adjacencies are established between the hub and spoke routers, while NHRP is used for spoke-to-spoke routing logic.
Device Resource Utilization
Device resource utilization is another potential source of problems when implementing IPsec VPN solutions. Functions such as fragmentation can increase CPU utilization and memory consumption on routers. If the router is performing a lot of fragmentation, in addition to additional tasks, this may result in poor VPN and device performance.
Additionally, if the encryption process is performed in software, which is typically the case in routers, high CPU utilization may also occur. Consider using dedicated hardware that offloads such functions from the CPU. In Cisco ISR routers, you can use the VPN Advanced Integration Module (AIM) when implementing site-to-site, as well as remote-access, VPN solutions. The Cisco VPN and SSL AIM provide up to 40 percent better performance for IPsec VPN over the built-in IPsec encryption, and up to twice the performance for SSL VPN encryption, because these functions are performed in hardware versus in Cisco IOS software.
The Cisco IPsec and SSL VPN AIM supports up to 800 tunnels on the Cisco 1841 Series, up to 1500 tunnels on the Cisco 2800 Series, and up to 2000 tunnels on the Cisco 3800 Series. Understanding the different hardware limitations is an important step in the design process. However, it is also important from a troubleshooting perspective. For example, you are troubleshooting a VPN performance issue on a Cisco 1841 ISR. You have been advised that prior to some changes made over the weekend, the VPN performance was fine. However, following these changes, users are now complaining about poor performance.
Logging into the router, you notice that it has been configured with 900 tunnels. Naturally, with your understanding of Cisco hardware, you know that on an 1841 ISR, the AIM module supports up to 800 tunnels. This means that encryption for the additional tunnels is being performed in software versus hardware, which can result in high resource utilization that can lead to a degradation in performance. The solution in this case would be to replace the 1841 router with a 2800 or 3800 series ISR, which will be able to support hardware encryption for the 900 tunnels configured on the router.
In summation, troubleshooting site-to-site VPN problems might seem to be a rather daunting task initially; however, as with all other topics discussed in this guide, take some time to understand the technologies and protocols involved. Having a solid understanding of these technologies and protocols allows you to use a systematic (structured) approach to the troubleshooting process. For example, if you are troubleshooting a VPN issue and notice that following initiation, the VPN tunnel is disconnected, you would know that this issue might occur because of a mismatched pre-shared-key during the phase 1 negotiations. Therefore, you would check the device configuration and ensure that the required phase 1 parameters are identical on both the local and the peer routers. This would also be applicable to the remote access VPN troubleshooting process. Remote access VPN troubleshooting is discussed in the next section.
