Let's troubleshoot... We also do trainings .. Checkout our training page https://asame2.blogspot.com/p/we-also-deliver-trainings.html

Featured Post

How to generate a CSR on Cisco ASA using CLI? CSR- (Certificate signing request)

First thing we need is an RSA key pair:   crypto key generate rsa label SSL-Key modulus 1024 noconfirm Create a trust-point crypto ca...

Recent Comments

Recent Post

Tuesday, 29 March 2016

How to boot ASA from/using TFTP


So you have issue with your flash memory and ASA is unable to pick the image from flash.
It goes into a booting loop but never boots up.

You can now boot using a TFTP server.

IP address that you want to assign to ASA:

ADDRESS=10.197.222.100


IP Address of TFTP Server:
SERVER=10.197.161.160

Default gateway IP address:
GATEWAY=10.197.222.1

Image path or name:
IMAGE=asa961-smp-k8.bin

On which port do you want to assign IP address on ASA:
PORT=Gi0/0

Enter this command to start download process: tftpdnld
==============

All the commands at once:


ADDRESS=10.197.222.100
!
SERVER=10.197.161.160
!
GATEWAY=10.197.222.1
!
IMAGE=asa961-smp-k8.bin
!
PORT=Gi0/0
!
set
!
tftpdnld

Monday, 21 March 2016

Port forwarding on ASA


 I need to access a resource from outside world that is in my private network at port 5900 using ASA's public IP.

object service port_vnc

service tcp source eq 5900
!
nat (inside,outside) source static obj_192.168.1.11 interface destination static any_1 any_1 service port_vnc port_vnc

Saturday, 27 February 2016

Packet capture on IOS XE



Specify the interface where you would like to take capture:
monitor capture mycap interface <interface_name> both

What are the interested IPs:
monitor capture mycap match ipv4 host <IP> host <IP>

or you can apply captures for a protocol:

monitor capture mycap match ipv4 protocol ?
tcp
udp
 monitor capture mycap match ipv4 protocol tcp any any

Start the capture:
monitor capture mycap start

Stop the capture:
monitor capture mycap stop

Look at the capture: If you do not stop the capture and directly enter this command, it automatically stops the capture.
show monitor cap mycap buffer bri

If you are done taking a look at this capture and would like to clear the capture so that you can capture some new data:

monitor capture mycap clear






Wednesday, 10 February 2016

Tuesday, 9 February 2016

How to check on which port ASA is listening at?


"show asp table sockets" will show you all the ports that an ASA is listening at.

 TEST-ASA5505(config-webvpn)#  sh asp table so
Protocol  Socket    Local Address               Foreign Address         State
SSL       00022cef  10.10.10.253:443            0.0.0.0:*               LISTEN
TCP       0005509f  10.10.10.253:23             0.0.0.0:*               LISTEN
TCP       0006af1f  10.10.10.253:22             0.0.0.0:*               LISTEN
TCP       00095f0f  1.93.34.130:22             0.0.0.0:*               LISTEN
SSL       0076a158  10.10.10.253:443            10.10.10.55:60820       ESTAB
SSL       007e4038  10.10.10.253:443            10.10.10.55:60824       ESTAB
SSL       08f3732f  1.93.34.130:4443           0.0.0.0:*               LISTEN
DTLS      08f5b9df  1.93.34.130:443            0.0.0.0:*               LISTEN

How many address pools can be configured in a tunnel group or group policy?


A maximum of 6 address pools can be configured under a tunnel group or group policy.

This is what happens when you try to call 7th address pool.

Test-ASA(config-tunnel-general)# address-pool 7
ERROR: list full: only 6 address pools can be specified

For more reference :
http://www.cisco.com/c/en/us/td/docs/security/asa/asa70/configuration/guide/config/vpngrp.html

Sunday, 17 January 2016

What is Service?















Friday, 15 January 2016

EZVPN between ASAs



Server:
===========
Server configuration will be like RAVPN configuration.

Phase 1 policy
Phase 2 policy
Create a pool
Create Split access list (Extended)
Create group policy
Create a tunnel group and call-in the group policy

In the group policy attributes, put this additional command:
nem enable

Create dynamic map and then call the dynamic map in crypto map
Enable crypto map on interface.

Client end configuration:
===================
vpnclient server "ip add of server ASA"
vpnclient mode network-extentention-mode
vpnclient vpngroup <tunnel group name that we have created on other ASA> 
password <Password that we have created as pre-shared key in our tunnel group on server ASA>
vpnclient username <a username that we have created on server ASA> password <password for that user>
client nem-st-autoconnect
vpnclient enable


Debugs::

Debug cry isa 200

Wednesday, 13 January 2016

Could not connect to server : Anyconnect


Back once again!

This time its my Any-connect. It gives me an error the moment I hit Connect :
"Could not connect to server. Please verify Internet connectivity and server address"

I am using any-connect 3. 1.13015. When I try to connect I get an immediate error message as shown above.

Debugs were saying :
Not calling vpn_remove_uauth: not IPv4!
webvpn_svc_np_tear_down: no IPv6 ACL

Luckily I had  Any-connect 4.2 installed on one of my machine and when I tested it from that machine it works fine.
I then figured out that Any-connect 3.x supports only TLSv1 and not 1.1 or 1.2, so I thought of verifying that: sh run all ssl

sh run all ssl
ssl server-version tlsv1.2
ssl client-version tlsv1.1

ssl cipher default custom "DES-CBC3-SHA:AES128-SHA:AES256-SHA"
ssl cipher tlsv1 custom "DES-CBC3-SHA:AES128-SHA:AES256-SHA"
ssl cipher tlsv1.1 medium

 

What did I do to fix this issue ?
conf t
 ssl client-version tlsv1
 

Replay check failed on Cisco Router with IPsec


Hello Again!!!

You are absolutely right, I am back with another issue with VPN :(

So this time, I have a router and have VTI tunnel setup on it. I don't know how it all started but I now see some logs on my router :

%CRYPTO-4-PKT_REPLAY_ERR: decrypt: replay check failed
        connection id=3625, sequence number=1281790

So I started to figure out what does this message mean?

Replay Attack: A replay attack is a form of network attack in which a valid data transmission is maliciously or fraudulently repeated or delayed. In a replay attack someone records legitimate communications and repeats them in order to impersonate a valid user, and to disrupt or cause negative impact for legitimate connections.

 Replay Check Failure: IPSec provides anti-replay protection against an attacker who duplicates encrypted packets with the assignment of a monotonically increasing sequence number to each encrypted packet. The receiving IPSec endpoint keeps track of which packets it has already processed on the basis of these numbers with the use of a sliding window of all acceptable sequence numbers. Currently, the default anti-replay window size in Cisco IOS implementation is 64 packets.

How the incoming IPSec traffic on the receiving tunnel endpoint will be processed with anti-replay enabled?

 

  1. When a packet is received, if the sequence number falls within the window and was not previously received, the packet is accepted, and marked as received before it is sent to integrity verification.
  2. If the sequence number falls within the window and was previously received, the packet is dropped, and the replay counter is incremented. (In this case a replay check failure occurs, and the router displays an error message similar to this: %CRYPTO-4-PKT_REPLAY_ERR: decrypt: replay check failed)
  3. If the sequence number is greater than the highest sequence number in the window, the packet is accepted, and marked as received. The sliding window is then moved to the right.
  4. If the sequence number is less than the lowest sequence in the window, the packet is dropped, and the replay counter is incremented. (In this case a replay check failure occurs, and the router displays an error message similar to this: %CRYPTO-4-PKT_REPLAY_ERR: decrypt: replay check failed)
I have referred this doc here:

http://www.cisco.com/c/en/us/support/docs/ip/internet-key-exchange-ike/116858-problem-replay-00.html#anc2



If the window size is small (which it is by default 64) then the packet gets dropped due to a replay failure (it is not really an attack).
In such scenarios, increase the size of the replay window in order to ensure that such delays are accounted for and prevent legitimate packets from being dropped. By default, the window size is fairly small (window size of 64). If you increase the size, it does not greatly increase the risk of an attack.

Use show crypto ipsec sa peer ip-address platform command in order to verify the hardware anti-replay window size.
 
How can I change the Window size?

1. Change the window size globally : Configure IPsec Anti-Replay Window: Expanding and Disabling globally (so that it affects all SAs that are created— except for those that are specifically overridden on a per-crypto map basis)
crypto ipsec security-association replay window-size 512

2. Configuring IPsec Anti-Replay Window: Expanding and Disabling
on a Crypto Map 

crypto map Test 10 ipsec-isakmp
set security-association replay window-size 512

 

  

 

 

Thursday, 7 January 2016

Ipsec on router (with HSRP failover) doesn't work after failover


This made me really scratch my head!

Here I am first trying to put a picture of the scenario:



This looks cool, whats the problem ?

Well, the problem is I have R1 and R2 running as HSRP peers. I have SLA monitoring going on to even check Internet connectivity, if Internet connectivity goes down, it will failover.

R1 and R2 both have a tunnel with R3. Under normal circumstances both R1 and R2 show the tunnel is UP and Active and I can reach the remote end subnets from both R1 and R2 when sourced it from inside interface.

Lets say there is some ongoing traffic over the tunnel, for some reason R1 fails and Failover occurs. R2 becomes the active router now and VPN traffic works fine as well.

Lets say there is no ongoing traffic over the tunnel and for some reason R1 fails and Failover occurs.
R2 becomes active router now. Now if we try to initiate the traffic for the tunnel it won't work, you wait as long as you want, it just won't work. (Clearing the session was the only thing that will make it work : clear crypto session)

ON R2:
==========
So when I further investigated, found that "sh cry ipsec sa peer 3.3.3.3" shows me encaps increasing but no decaps.

It starts making some sense now. So we are doing encaps and sending to peer , but peer is not sending it back to us. WHY ?

Let's take a look at the R3:
=====================
"Sh cry isa sa" on R3 shows that the tunnel is still UP with R1 and there are Ipsec as well. And its doing encap for peer 1.1.1.1 which is no longer alive, but this router R3 doesn't know that.

Now the question comes, why doesn't R3 know R1 has gone down?

DPD : Dead peer Detection

On R3 : sh run | in keepalive
crypto isakmp keepalive 30 5

Router supports two kind of keep-alives : 1. On-Demand DPD and 2. Periodic

This document really helped me to understand these two different keep alives :
https://supportforums.cisco.com/document/32546/dead-peer-detection

DPD is disabled by default on Cisco routers. The default mode is "on-demand" if not specified.

Here is how did I fix it:
==================
Changed the keepalive mode to periodic:
conf t
crypto isakmp keepalive 30 5 periodic

Voila!

Thanks to periodic keep-alive feature.

Wednesday, 23 December 2015

%CRYPTO-5-IKMP_AG_MODE_DISABLED: Unable to initiate or respond to Aggressive Mode while disabled


I don't understand why it has to be me every time to run into wired issues like this:

I have a router and I disabled AM mode using command : crypto isakmp aggressive-mode disable

Well, then I see these logging messages and they don't stop:

"%CRYPTO-5-IKMP_AG_MODE_DISABLED: Unable to initiate or respond to 
Aggressive Mode while disabled"


I was just looking if there is a way I can disable this message. Then I found this information:



Router checks for aggressive-mode during initiating or responding IKE requests. If you are getting this message, it means that some unauthorized remote-peer
keeps trying to initiate IPSec to this router. You can use interface access-list to block these addresses. 'show crypto isakmp sa' will show you the incomplete session for such traffic from which IP address can be obtained.
 
you could also use "logging discriminator" feature, available since 12.4(11). You should be able to use it to drop messages in the buffer as well as in syslog server, here is an example (not tested) for buffer logging:
 
1) Configure a discriminator: 
                    logging discriminator IKMP-AG mnemonics drops IKMP_AG_MODE_DISABLED 
2) Apply it to logging buffer:
                    logging buffered discriminator IKMP-AG 4096
 
logging buffered discriminator IKMP-AG 4096" will set the logging buffer to 4096 this may not be what you want, use what is configured on your router currently, and add the discriminator to that line:
 
        show run | i logging buffered



Tuesday, 22 December 2015

Save password for Ipsec client on machine


How to save password on client machine for IPsec users?

I ran through an issue where I needed to save user password on client machine for IPsec user. I tried using ASDM and once I apply the setting and come back and check I find its disabled. So for some reason ASDM wasn't allowing me to enable it.

The option is available under group policy:





So I did using CLI mode. I went into the group policy and made the change and it worked.

      group-policy GroupPolicy_ANYCONNECT-PROFILE attributes
        password-storage enable


Wednesday, 9 December 2015

How to disable IKE Aggressive Mode?



ASA is vulnerable because AM (aggressive) mode was enabled.
 
How to disable it?
 
First check if your ASA has any current tunnel using AM mode, if not then you can go
ahead and disable it. 
crypto isakmp am-disable