02-10-2008 08:32 PM - edited 02-21-2020 03:33 PM
Hi every1, if i want to terminate an IPsec session forcefully after a specified amount of time like 5 hours what command do i need? i am using simple site to site vpn between 2 sites, i want the ipsec tunnel to be terminated so that the counters in show crypto ipsec sa equals to zero..
Thanks
02-10-2008 11:44 PM
you can use clear crypto sa counters
Quote !!
The counters keyword simply clears the traffic counters maintained for each security association; it does not clear the security associations themselves.
more command deatails and explanation here
http://www.cisco.com/en/US/docs/ios/12_2/security/command/reference/srfipsec.html#wp1017393
Rgds
Jorge
02-11-2008 12:56 AM
Sorry i forgot to mention AUTOMATICALLY, i want to ipsec tunnel ( phase 2 ) to be terminated automatically after very 5 hours.
Thanks
02-11-2008 01:08 AM
Hi,
Depending on your version of IOS, you can script commands using kron.
Cheers
02-11-2008 09:54 AM
or set your ipsec lifetimes for five hours (18000seconds)...i don't know if this resets counters or not though.
02-11-2008 08:25 PM
hi srue, are you sure that ipsec lifetimes terminate the tunnel ?? coz i heard that it just re-authenticates the tunnel !! so kindly confirm me that it terminates the tunnel.
Thanks
02-12-2008 04:51 AM
There are 2 lifetimes though, for phase 1 and 2. They will terminate the tunnel but any interesting traffic will bring it up again of course.
02-12-2008 10:41 AM
How These Lifetimes Work
Assuming that the particular crypto map entry does not have lifetime values configured, when the router requests new security associations it will specify its global lifetime values in the request to the peer; it will use this value as the lifetime of the new security associations. When the router receives a negotiation request from the peer, it will use the smaller of either the lifetime value proposed by the peer or the locally configured lifetime value as the lifetime of the new security associations.
The security association (and corresponding keys) will expire according to whichever comes sooner, either after the number of seconds has passed (specified by the seconds keyword) or after the amount of traffic in kilobytes is passed (specified by the kilobytes keyword). Security associations that are established manually (via a crypto map entry marked as ipsec-manual) have an infinite lifetime.
A new security association is negotiated before the lifetime threshold of the existing security association is reached, to ensure that a new security association is ready for use when the old one expires. The new security association is negotiated either 30 seconds before the seconds lifetime expires or when the volume of traffic through the tunnel reaches 256 kilobytes less than the kilobytes lifetime (whichever comes first).
If no traffic has passed through the tunnel during the entire life of the security association, a new security association is not negotiated when the lifetime expires. Instead, a new security association will be negotiated only when IPSec sees another packet that should be protected.
http://cisco.com/univercd/cc/td/doc/product/software/ios122/122cgcr/fsecur_c/fipsenc/scfipsec.htm
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: