CCNA 200-301

CCNP Enterprise

CCNP Security

CCIE Enterprise Lab

CCIE Security Lab

CCNP Service Provider

CCNP Data Center

CCNP Collaboration

CCIE DC Lab

Site-to-site and remote access VPN tunnels on Cisco Adaptive Security Appliances (ASA) can occasionally stall, experience unidirectional traffic drops, or fail to rekey properly after configuration changes. Bouncing or clearing the Security Associations (SAs) forces the firewall to tear down the cryptographic session and renegotiate security parameters. However, executing global reset commands on a production firewall risks dropping every active tunnel in the enterprise.

Whether you manage your Cisco ASA through the command-line interface (CLI) or the Adaptive Security Device Manager (ASDM), knowing how to pinpoint and reset a single tunnel is critical for maintaining uptime. This guide covers how to clear specific IKEv1, IKEv2, and IPsec associations, navigate the ASDM graphical interface, disconnect individual remote access users, and troubleshoot tunnels that fail to recover after a bounce.


Phase 1 vs. Phase 2: When to Clear ISAKMP vs. IPsec SAs

Before executing reset commands, you must identify whether the failure exists in the management plane negotiation (Phase 1) or the data encryption plane (Phase 2). Clearing the wrong layer can cause unnecessary renegotiation overhead or fail to resolve the underlying issue.

What is the operational difference between clearing Phase 1 and Phase 2?

Phase 1 (ISAKMP / IKEv1 / IKEv2) is the control plane channel. It authenticates both tunnel endpoints using pre-shared keys or digital certificates, establishes a secure bidirectional management session, and exchanges keying material via Diffie-Hellman.

Phase 2 (IPsec) is the data plane channel. It creates unidirectional Security Associations (one inbound, one outbound) using Encapsulating Security Payload (ESP) to encrypt and encapsulate actual payload traffic matching your crypto access control lists (ACLs) or traffic selectors.

When should you clear only the IPsec SA (Phase 2)?

You should reset only Phase 2 when:
* Phase 1 is fully established (MM_ACTIVE for IKEv1 or active state for IKEv2), but traffic is stalling or passing unidirectionally.
* You modified a crypto access list, traffic selector, or IPsec transform set and need existing tunnels to renegotiate encryption domains without re-authenticating the peer.
* Encrypted packet counters (encaps) are incrementing, but decrypted packet counters (decaps) remain flat at zero.

Clearing Phase 2 renegotiates Quick Mode (IKEv1) or CREATE_CHILD_SA (IKEv2) over the existing, verified management channel. This is fast, non-disruptive to the control plane, and completes in milliseconds.

When must you clear the ISAKMP / IKE SA (Phase 1)?

You must reset Phase 1 when:
* Pre-shared keys, authentication certificates, or Phase 1 policy parameters (encryption, hashing, DH group) have been updated on either endpoint.
* Dead Peer Detection (DPD) has timed out, leaving an orphan SA in the local database.
* The tunnel is stuck in an intermediate negotiation state (such as MM_WAIT_MSG2 or MM_WAIT_MSG6).
* A peer device rebooted or crashed, leaving stale Phase 1 state records on the ASA.

Note: Tearing down Phase 1 automatically destroys all associated child Phase 2 IPsec SAs. Once Phase 1 is cleared, the entire tunnel renegotiates from scratch.


Resetting IKEv1 and IPsec Tunnels by Remote Peer IP (CLI)

To restart an IKEv1 site-to-site tunnel without disrupting other active tunnels on the firewall, always append the remote peer’s public IP address to your command. Running clear crypto isakmp sa without an argument drops all IKEv1 tunnels on the ASA.

Step 1: Verify the Active SAs

ciscoasa# show crypto isakmp sa
ciscoasa# show crypto ipsec sa peer <REMOTE_PEER_IP>

Step 2: Clear IPsec (Phase 2 Only)

To reset data plane security associations while keeping Phase 1 intact:

ciscoasa# clear crypto ipsec sa peer <REMOTE_PEER_IP>

Step 3: Clear IKEv1 (Phase 1 and Associated Phase 2)

To tear down the entire tunnel (Phase 1 and Phase 2) for a specific peer:

ciscoasa# clear crypto ikev1 sa peer <REMOTE_PEER_IP>

(On legacy ASA software releases prior to 8.4, use vpn-sessiondb logoff tunnel-group <REMOTE_PEER_IP> or clear crypto isakmp sa <REMOTE_PEER_IP> if supported by the platform build.)

Step 4: Alternative Method Using Session Index

If the tunnel refuses to clear by peer IP, terminate it directly from the VPN session database:

ciscoasa# show vpn-sessiondb l2l filter ipaddress <REMOTE_PEER_IP>
! Locate the Index number from the output (e.g., Index : 14205)
ciscoasa# vpn-sessiondb logoff index <INDEX_NUMBER>

Step 5: Trigger Re-Negotiation

Because Cisco ASA negotiates policy-based IPsec on demand, send interesting traffic across the tunnel to bring it back up:

ciscoasa# ping <LOCAL_INTERFACE_NAME> <REMOTE_INTERNAL_IP>

Bouncing Modern IKEv2 Site-to-Site VPN Tunnels (CLI)

IKEv2 features separate command structures from legacy ISAKMP. Resetting an IKEv2 security association targets the management channel and immediately clears any associated child SAs.

Step 1: Check Current IKEv2 Status

ciscoasa# show crypto ikev2 sa
ciscoasa# show crypto ikev2 sa detail

Step 2: Terminate the Specific IKEv2 Peer SA

ciscoasa# clear crypto ikev2 sa peer <REMOTE_PEER_IP>

Step 3: Clear Only Child IPsec SAs (Optional)

If IKEv2 is stable and you only want to force Phase 2 re-keying:

ciscoasa# clear crypto ipsec sa peer <REMOTE_PEER_IP>

Step 4: Verify and Initiate

! Monitor the re-establishment
ciscoasa# show crypto ikev2 sa
ciscoasa# show crypto ipsec sa peer <REMOTE_PEER_IP>

! Force tunnel initiation via packet tracer if no host is generating traffic
ciscoasa# packet-tracer input <INSIDE_INTERFACE> icmp <LOCAL_INTERNAL_IP> 8 0 <REMOTE_INTERNAL_IP>

How to Reset a VPN Tunnel in Cisco ASDM (GUI)

If you prefer using the Cisco Adaptive Security Device Manager (ASDM) graphical interface, you can locate and disconnect any active LAN-to-LAN tunnel with a few clicks.

  1. Log in to ASDM: Launch the ASDM client and authenticate to your ASA with administrative credentials.
  2. Access the Monitoring Pane: In the top navigation bar, click on Monitoring.
  3. Navigate to Sessions: In the left-hand menu tree, expand VPN > VPN Statistics, and select Sessions.
  4. Filter by Connection Type: In the main panel, locate the Filter by drop-down menu on the right and select IPsec Site-to-Site (or IPsec LAN-to-LAN depending on your ASDM version).
  5. Locate the Tunnel: Review the active session list for the remote gateway’s public IP address or configured Tunnel Group name.
  6. Terminate the Session: Click on the target tunnel row to highlight it, then click the Logout button at the bottom right of the pane.
  7. Confirm Termination: When prompted with the confirmation dialog, click OK to disconnect the session.
  8. Verify Status: Click Refresh to verify the tunnel has been cleared from active sessions. Generate interesting traffic through the tunnel or use ASDM’s Packet Tracer tool (Tools > Packet Tracer) to trigger renegotiation.

Disconnecting Remote Access AnyConnect SSL/IPsec Sessions

Remote access VPNs running Cisco Secure Client (AnyConnect) operate through the ASA’s WebVPN/SSL and IKEv2 remote access database. They cannot be bounced using standard clear crypto ipsec sa commands. Instead, use the session database management utilities.

Template: View and Log Off Specific Remote Access Users

! Step 1: Locate the user session and session index
ciscoasa# show vpn-sessiondb anyconnect filter name <USERNAME>

! Step 2: Log off the user by username
ciscoasa# vpn-sessiondb logoff name <USERNAME>

! Step 3: Alternatively, log off the user by session index
ciscoasa# vpn-sessiondb logoff index <SESSION_INDEX>

! Step 4: Disconnect all users tied to a specific tunnel group/connection profile
ciscoasa# vpn-sessiondb logoff tunnel-group <TUNNEL_GROUP_NAME>

! Step 5: Verify user termination
ciscoasa# show vpn-sessiondb anyconnect filter name <USERNAME>

Troubleshooting Tunnels That Fail to Recover After a Bounce

When a cleared tunnel remains down, it is typically caught in an asymmetric routing loop, an access-list mismatch, or a negotiation failure. Follow this sequential troubleshooting workflow to pinpoint the root cause.

+----------------------------------------------------------------+
|                 Tunnel Down After SA Clear                     |
+----------------------------------------------------------------+
                               |
                               v
             [ Did you send Interesting Traffic? ]
                               |
            +------------------+------------------+
            | No                                  | Yes
            v                                     v
  [ Send ping from host or           [ Check Phase 1 State ]
    run packet-tracer ]              ciscoasa# show crypto isakmp sa
                                     ciscoasa# show crypto ikev2 sa
                                                  |
                    +-----------------------------+-----------------------------+
                    |                                                           |
                    v                                                           v
       [ Phase 1 Down / Incomplete ]                                  [ Phase 1 Up / Active ]
         MM_WAIT_MSG2 / MSG3 / MSG6                                     MM_ACTIVE / IKEv2 Up
                    |                                                           |
                    v                                                           v
     1. Verify UDP 500 / 4500 reachability.                       [ Check Phase 2 (IPsec) ]
     2. Confirm Pre-Shared Key (PSK).                            ciscoasa# show crypto ipsec sa
     3. Check IKE proposals (AES/SHA/DH).                                       |
                                                  +-----------------------------+-----------------------------+
                                                  |                                                           |
                                                  v                                                           v
                                     [ QM_IDLE / Incomplete ]                                    [ Encaps > 0, Decaps = 0 ]
                                                  |                                                           |
                                                  v                                                           v
                                   1. Compare Crypto ACLs (Proxy IDs).                         1. Check upstream NAT / ESP drops.
                                   2. Verify Transform-Set / Proposal.                         2. Verify remote routing table.
                                   3. Confirm NAT Exemption (Identity NAT).                    3. Check reverse path filtering (RPF).

Step 1: Verify Traffic Generation

Cisco ASA does not bring up a policy-based IPsec tunnel automatically after a reset unless data traffic matches the crypto map.
* Ping a remote host sourced from an interface on the local protected subnet:
text
ciscoasa# ping inside <REMOTE_INTERNAL_IP>

* Alternatively, simulate the packet using the ASA packet-tracer utility:
text
ciscoasa# packet-tracer input inside tcp <LOCAL_INTERNAL_IP> 1025 <REMOTE_INTERNAL_IP> 443

Step 2: Diagnose Phase 1 Hangs

Run show crypto isakmp sa (or show crypto ikev2 sa) and analyze the state:
* MM_WAIT_MSG2 or MM_WAIT_MSG3: The ASA sent its initial proposal but received no reply. Check network path reachability, upstream ISP firewall rules blocking UDP port 500/4500, or Phase 1 policy mismatches (encryption, hash, or authentication method).
* MM_WAIT_MSG5 or MM_WAIT_MSG6: Authentication failed. The peers exchanged identities, but validation stalled. Re-verify the pre-shared key on both firewalls:
text
ciscoasa# show run tunnel-group <REMOTE_PEER_IP>

Step 3: Diagnose Phase 2 and Quick Mode Issues

If Phase 1 reaches MM_ACTIVE but the tunnel drops packets, check Phase 2:
* Crypto ACL (Proxy ID / Traffic Selector) Mismatch: The local access list defining interesting traffic must perfectly mirror the remote peer’s crypto access list.
text
ciscoasa# show run access-list <CRYPTO_ACL_NAME>

* NAT Exemption (Identity NAT) Bypassed: Ensure traffic destined for the remote VPN subnet is not being translated by your global internet PAT rule. The identity NAT rule must sit above dynamic PAT rules:
text
ciscoasa# show nat

Step 4: Run Targeted, Non-Disruptive Debugs

Never run unconstrained debugs on a busy production firewall. Constrain the debug engine to the single peer IP address:

ciscoasa# debug crypto condition peer <REMOTE_PEER_IP>
ciscoasa# debug crypto ikev1 127
ciscoasa# debug crypto ipsec 127
! After observing negotiation:
ciscoasa# undebug all

Cisco ASA Crypto Reset Command Reference

The following reference documents the formal command syntax, operational modes, and parameter descriptions for session maintenance commands defined in the Cisco Secure Firewall ASA Series Command Reference.

clear crypto ipsec sa

Deletes active IPsec (Phase 2) Security Associations and flushes encryption keys for specified or all data plane tunnels.

  • Command Mode: Privileged EXEC (ciscoasa#)
  • Syntax:
    text
    clear crypto ipsec sa [counters | entry <dest_ip> <protocol> <spi> | map <map_name> | peer <peer_ip>]
  • Parameters:
  • peer <peer_ip>: (Recommended) Deletes IPsec SAs established with the specified remote peer address without impacting other tunnels.
  • map <map_name>: Deletes SAs associated with a specific crypto map name.
  • entry <dest_ip> <protocol> <spi>: Deletes a specific SA entry identified by destination IP, protocol (ESP/AH), and Security Parameter Index (SPI).
  • counters: Resets packet and byte counters for IPsec SAs without dropping active connections.
  • (No parameters): CAUTION. Deletes all active IPsec SAs across the entire firewall.

clear crypto ikev1

Terminates and resets Phase 1 Internet Key Exchange Version 1 (ISAKMP) management sessions.

  • Command Mode: Privileged EXEC (ciscoasa#)
  • Syntax:
    text
    clear crypto ikev1 {sa [peer <peer_ip>] | stats}
  • Parameters:
  • sa peer <peer_ip>: Deletes the IKEv1 SA for the designated peer and tears down associated Phase 2 child SAs.
  • stats: Resets IKEv1 negotiation statistics to zero.
  • sa: (Without arguments) CAUTION. Clears all active IKEv1 Phase 1 SAs on the firewall.

clear crypto ikev2

Terminates active Internet Key Exchange Version 2 sessions and statistics.

  • Command Mode: Privileged EXEC (ciscoasa#)
  • Syntax:
    text
    clear crypto ikev2 {sa [peer <peer_ip>] | stats}
  • Parameters:
  • sa peer <peer_ip>: Terminates the IKEv2 control channel for the specified remote endpoint.
  • stats: Clears all runtime IKEv2 statistical counters.
  • sa: (Without arguments) CAUTION. Drops every active IKEv2 session on the firewall.

vpn-sessiondb logoff

Terminates active VPN sessions from the unified session database across LAN-to-LAN, AnyConnect, and clientless sessions.

  • Command Mode: Privileged EXEC (ciscoasa#)
  • Syntax:
    text
    vpn-sessiondb logoff {all | anyconnect | index <index_num> | l2l | name <username> | protocol <protocol> | tunnel-group <group_name>}
  • Parameters:
  • index <index_num>: Terminates the specific VPN session identified by its database index ID.
  • name <username>: Terminates all active sessions for the specified authenticated username.
  • tunnel-group <group_name>: Logs off all sessions associated with the specified connection profile or peer IP.
  • l2l: Terminates all active LAN-to-LAN IPsec tunnels.
  • all: CAUTION. Disconnects every active VPN session on the appliance.

Conclusion

Bouncing a VPN tunnel on a Cisco ASA is an effective way to resolve stalled encryption states, force re-authentication, or apply updated security policies. However, executing unconstrained global clear commands can turn a single-tunnel troubleshooting task into an enterprise-wide network outage. By targeting your commands using the remote peer’s IP address (clear crypto ipsec sa peer or clear crypto ikev2 sa peer), leveraging vpn-sessiondb logoff index, or using ASDM’s session logout interface, you can isolate and recover individual site-to-site and AnyConnect sessions with minimal disruption.

Please follow and like us:
Last modified: November 16, 2026

Author

Comments

Write a Reply or Comment

Your email address will not be published.