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

Friday, 20 November 2015

Any-Connect not connecting with some of the tunnel groups, while working fine with others


I ran into an issue with my Any-Connect
I had some couple of tunnel groups and I upgraded my ASA from 8.6 to 9.2 , after upgrade Any-Connect stopped connecting with few of the tunnel groups.

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


Any-Connect was giving this error:

Failed to get configuration from secure gateway. Contact your system administrator.


Here is the link that helped:  https://supportforums.cisco.com/discussion/11792386/failed-get-configuration-secure-gateway-contact-your-system-administrator

What was I missing?
Somehow my xml profiles were missing from the ASA but they were called under group policies.
I removed them from those group policies.

Sh run webvpn will show what xml porifiles you have.

How did I remove them from group policies?
group-policy TEST attributes
webvpn
anyconnect profiles none

 

Ipsec over GRE : Tunnel protocol is down : Tunnel with Vlan interface


I have an IPSec over GRE tunnel between two routers (ofcourse :) )

I had some physical interface limitation so I could not assign an IP address to it. It is a L2 interface. So I have created a vlan and assigned an Ip address to vlan and then called the vlan under interface.

Here is my configuration : After I have configured this I see tunnel protocol status is DOWN

crypto map mymap local-address FastEthernet0/0/0
crypto map mymap 10 ipsec-isakmp
 set peer 1.1.1.1
 set transform-set myset
 match address 110

interface Tunnel40
 bandwidth 2000
 ip address 10.10.10.10 255.255.255.252
 ip mtu 1420
 ip tcp adjust-mss 1380
 keepalive 10 3
 tunnel source FastEthernet0/0/0
 tunnel destination 2.2.2.2
 tunnel path-mtu-discovery
end

interface fa0/0/0
switchport access vlan1
 crypto map mymap


Here are the debugs:

Nov 18 15:52:48.276: IPSEC(validate_transform_proposal): invalid local address 213.163.150.250
Nov 18 15:52:48.276: ISAKMP:(0:196:HW:2): IPSec policy invalidated proposal
Nov 18 15:52:48.280: ISAKMP:(0:196:HW:2): phase 2 SA policy not acceptable! (local 213.163.150.250 remote 80.169.157.115)
Nov 18 15:52:48.280: ISAKMP: set new node -1071324651 to QM_IDLE
Nov 18 15:52:48.280: ISAKMP:(0:196:HW:2):Sending NOTIFY PROPOSAL_NOT_CHOSEN protocol 3
        spi 1698541472, message ID = -1071324651


Solution:
=============

Here is the solution that fixed the issue:
 Removed this crypto map mymap local-address FastEthernet0/0/0

interface Tunnel40
no  keepalive 10 3
no  tunnel source FastEthernet0/0/0
 tunnel source vlan1

Thursday, 19 November 2015

Packet capture on router




1.Define a 'capture buffer' with the specified name
monitor capture buffer mycap size 2048 max-size 4000 circular

2. Specify access-list
ip access-list ex mycap
permit ip host
permit ip host


monitor capture buffer mycap filter access-list mycap

3. Defines a capture point
monitor capture point ip cef cap fastEthernet 1/0 both

4. Attach capture point with the capture buffer specified.
monitor capture point associate cap mycap

5. Enables the capture point to start capturing packet data:
monitor capture point start cap



Now the capture is enabled and allows collecting necessary data as configure in ACL

To disable the capture point and stops the packet data capture process use following command:
monitor capture point stop cap

How to see the capture:
==============================
show monitor capture buffer all parameters

Send it to TFTP :
monitor capture mycap export tftp://1.1.1.2//Capture.pcap 


=================
All commands at once, just copy and paste:
=================
!
conf t
!
ip access-list ex mycap
permit ip host
permit ip host
!
exit
exit
!
monitor capture buffer mycap size 2048 max-size 4000 circular
!      
monitor capture buffer mycap filter access-list mycap
!  
monitor capture point ip cef cap fastEthernet 1/0 both 
!
monitor capture point associate cap mycap
!
monitor capture point start cap
!
==========================================================

Tuesday, 17 November 2015

Saturday, 7 November 2015

Anyconnect 4.0 License Scheme



Failover: If you are using failover firewalls you can (but don't have to) use a shared license' model, this lets you purchase a bundle of Premium licenses. and share them across multiple pieces of hardware, This requires an ASA to be setup as the license' server'. Before version 8.3 you needed to purchase licenses for both firewalls. After version 8.3, Cisco allowed the licenses. to be replicated between firewalls in a failover pair. The exception is Active/Active where the amount of licenses. is aggregated together from both firewalls and ALL are available providing the figure does not exceed the maximum for the hardware being used
Prior to version 4 Anyconnect had the AnyConnect Essentials and Premium licensing scheme. The newer v4.xAnyConnect licenses now have one of the three licensing options:
  • Cisco AnyConnect Plus License (Subscription Based) - 1 year, 3 ,5
  • Cisco AnyConnect Plus Perpetual License (Permanent – no subscription) - Need to buy once permanently
  • Cisco AnyConnect Apex License (Subscription Based) - 1 year, 3 ,5\

The Plus Perpetual License on the other hand allows Cisco customers to purchase a one-time license, however the license costs significantly higher than the subscription-based license.

We should also note that AnyConnect 4.0 is not licensed based on simultaneous connections (like the previous AnyConnect 3.x), but is now user-based. This means a user connecting via his smartphone and laptop simultaneously will only occupy a single license.

Cisco AnyConnect Secure Mobility Client 4.0 supports the following operating systems:
  • Windows 8.1 (32bit & 64Bit)
  • Windows 8 (32bit & 64Bit)
  • Windows 7 (32bit & 64Bit)
  • Linux Ubuntu 12.X 64Bit
  • Linux RedHat 6 64Bit
  • Mac OS X 10.10 – 10.8
Let’s take a look at each license feature and how the older AnyConnect Essentials and Premium licenses map to the newer AnyConnect Plus and Apex licenses:
 
  
AnyConnect Mobile is now integrated into the new AnyConnect Plus license.

  

How to assign IP address on ASA 5505 - and how to create local pool for Inside on ASA 5505



Create VLAN Interface : interface vlan 1
ip address 192.168.1.1 255.255.255.0
no shut
exit


Go to physical interface and call the vlan using switchport access command

Interface eth0/0
switchport access vlan 1
no shut

For the ASA 5505, the maximum number of DHCP client addresses varies depending on the license: • If the limit is 10 hosts, the maximum available DHCP pool is 32 addresses.
• If the limit is 50 hosts, the maximum available DHCP pool is 128 addresses.
• If the number of hosts is unlimited, the maximum available DHCP pool is 256 addresses.

By default, the ASA 5505 ships with a 10-user license

You can configure a DHCP server on each interface of the ASA. Each interface can have its own pool of addresses to draw from.

You cannot configure a DHCP client or DHCP relay services on an interface on which the server is enabled. DHCP clients must be directly connected to the interface on which the server is enabled.

 show running-config dhcpd ----------- Shows the current DHCP configuration




Thursday, 5 November 2015

Anyconnect gives error : Not calling vpn_remove_uauth: not IPv4! webvpn_svc_np_tear_down: no ACL


Error message when connecting to Anyconnect:
==============================================

Not calling vpn_remove_uauth: not IPv4!
webvpn_svc_np_tear_down: no ACL webvpn_svc_np_tear_down: no IPv6 ACL


So for me the issue was :

Anyconnect was trying to establish connection with Default RA group tunnel-group.
There was no IP pool called under it.

I then enabled tunnel-group-list enable under Webvpn
and
tunnel-group Bangalore webvpn-attributes
group-alias Bangalore enable


This resolved the issue.
 

Friday, 30 October 2015

Site to site timeouts : Stop Site-to-Site VPN Drop (ASA & Router)


By default, site-to-site VPNs timeout after 30 minutes of idle time.

On ASA:
=========

Enter the vpn-idle-timeout command in
group-policy configuration mode or in username configuration mode in
order to configure the user timeout period: 

hostname(config)#group-policy DfltGrpPolicy attributes
hostname(config-group-policy)#vpn-idle-timeout none
 
Configure a maximum amount of time for VPN connections with the vpn-session-timeout 
command in group-policy configuration mode or in username configuration mode: 

hostname(config)#group-policy DfltGrpPolicy attributes
hostname(config-group-policy)#vpn-session-timeout none
 
On ROUTER:
=========== 
Use the crypto ipsec security-association idle-time command in global configuration
mode or crypto map configuration mode in order to configure the IPsec SA idle 
timer. 
By default IPsec SA idle timers are disabled. 

crypto ipsec security-association idle-time 
seconds
 
Time is in seconds, which the idle timer allows an inactive peer to maintain an SA.
Valid values for the seconds argument range from 60 to 86400. 

Friday, 23 October 2015

Thursday, 22 October 2015

ASA L2L IPsec not encrypting the traffic (Duplicate SPI troubleshooting)


What is an SPI ?

SPIs are the components that are going to be used to provide
protection to an outgoing packet ( Security Parameter Index ), so we are
going to see that it will identify a packet that is going to be
protected via an encryption

How to identify that we have duplicate SPIs: ?

1) Do a packet-tracer for the traffic that is supposed to go over the
VPN tunnel and get encrypted , include the Detail keyword to get the
information need it to proceed. and look at VPN - Allow section.

packet-tracer input inside udp 10.255.203.102 1610 10.220.100.17 3389 DETAIL

Phase: 9

Type: VPN

Subtype: encrypt

Result: ALLOW

Config:

Additional Information:

Forward Flow based lookup yields rule:

out id=0xcf20d730, priority=70, domain=encrypt, deny=false

hits=3016, *user_data=0x2d2ea0a4*, cs_id=0xcd3b96f0, reverse, flags=0×0,
protocol=0

src ip=10.255.203.0, mask=255.255.255.0, port=0

dst ip=10.220.100.0, mask=255.255.255.0, port=0, dscp=0×0



The value highlighted is the Virtual-Context being used for that VPN
traffic (There are several VPN contexts  used by a single crypto-map.)

2) Copy the  user_data vlaue from the above output and then paste it a notepad and capitalize the letters and then we are going to do a show asp table vpn-context search (We must capitalize the letters) .

show asp table vpn-context detail | begin  *0x2D2EA0A4*

VPN CTX  =* 0x2D2EA0A4*

Peer IP  = 10.220.100.0

Pointer  = 0xD26F7CA8

State    = UP

Flags    = *ENCR+ESP*

SA       =* 0x6B856011*

SPI      =* 0x25A3076D*

Group    = 7

Pkts     = *41006*

Bad Pkts = 0

Bad SPI  = 0

Spoof    = 0

Bad Crypto = 0

Rekey Pkt  = 9

Rekey Call = 9

Okay now we have the *VPN context , SA and SPI* being used for that
particular VPN traffic (remember that multiple VPN context can be used
for*different subnets*, this is why one subnet traffic across the VPN
might work and other ones not on the same Crypto-Map).

We can also see that it says*ENCR+ESP* which means that it’s encrypting
the traffic. We also see that it has a value of 4006 (Packets being
encrypted) So for the sake of the Packet-tracer everything is good.


3) Now let’s go to the Show crypto IPSec SA to get the SPI (in a perfect
world it should be the same one than the one used for the packet
tracer *0x25A3076D) *But let’s see if there is an issue:

sh crypto ipsec sa peer X.X.X.X ( We will focus only on the   current
 outbound esp SPI  as the problem is with encryption traffic)

peer address: X.X.X.X

Crypto map tag: TEST, seq num: 40, local addr: Y.Y.Y.Y

access-list TEST permit ip 10.255.203.0 255.255.255.0 10.220.100.0
255.255.255.0

local ident (addr/mask/prot/port): (10.255.203.0/255.255.255.0/0/0)

remote ident (addr/mask/prot/port): (10.220.100.0/255.255.255.0/0/0)

current_peer: X.X.X.X

* #pkts encaps: 0, #pkts encrypt: 0, #pkts digest: 0*

*      #pkts decaps: 484, #pkts decrypt: 484, #pkts verify: 484*

#pkts compressed: 0, #pkts decompressed: 0

#pkts not compressed: 0, #pkts comp failed: 0, #pkts decomp failed: 0

#pre-frag successes: 0, #pre-frag failures: 0, #fragments created: 0

#PMTUs sent: 0, #PMTUs rcvd: 0, #decapsulated frgs needing reassembly: 0

#send errors: 0, #recv errors: 0

local crypto endpt.: Y.Y.Y.Y, remote crypto endpt.: X.X.X.X

path mtu 1500, ipsec overhead 58, media mtu 1500

*      current outbound spi: A19EC57E*

inbound esp sas:

spi: 0xCF559E0D (3478494733)

transform: esp-3des esp-md5-hmac no compression

in use settings ={L2L, Tunnel, }

slot: 0, conn_id: 43950080, crypto-map: TEST

sa timing: remaining key lifetime (kB/sec): (4373958/27285)

IV size: 8 bytes

replay detection support: Y

Anti replay bitmap:

0xFFFFFFFF 0xFFFFFFFF

outbound esp sas:

spi: 0x25A3076D (2711537022)

transform: esp-3des esp-md5-hmac no compression

in use settings ={L2L, Tunnel, }

slot: 0, conn_id: 43950080, crypto-map: TEST

sa timing: remaining key lifetime (kB/sec): (4374000/27284)

IV size: 8 bytes

replay detection support: Y

Anti replay bitmap:

0×00000000 0×00000001

What are the interesting outputs here:


1)  No packets are being encrypted, we are just decrypting traffic.


#pkts encaps: 0, #pkts encrypt: 0, #pkts digest: 0

#pkts decaps: 484, #pkts decrypt: 484, #pkts verify: 484

 2)  We  have an SPI value for the IPSec SA which is different than the
one used for the Packet-tracer

Packet tracer *25A3076D*

SPI                *      A19EC57E*



So what is next..



Well now that we have the SPI for the real IPSec traffic (not the
virtual-packet tracer flow) let’s look for the VPN context of that SPI:

sh asp table vpn-context detail | begin *A19EC57E*

* *

*VPN CTX  = 0x2D80E6FC*

Peer IP  = 10.220.100.0

Pointer  = 0xD08A30D0

State    = UP

Flags    = ENCR+ESP

*SA       = 0x6D5DAF29*

*SPI      = 0xA19EC57E*

Group    = 0

Pkts     = 0

Bad Pkts = 0

Bad SPI  = 0

Spoof    = 0

Bad Crypto = 0

Rekey Pkt  = 0

Rekey Call = 0



And there you go, 2 different VPN context and SPIs assigned to the same
traffic flow.. And in this one ( the real one) there are no packets
being encrypted.. which matches what the show crypto IPSec sa shows…

Now that we have recognized the issue, How do we fix it:

Well this is certainly a bug (an unexpected behavior) a reboot will fix
it! I know.. I know.. A reboot is not good enough .



Do this: clear crypto ipsec sa inactive

https://tools.cisco.com/bugsearch/bug/CSCtd36473

Thursday, 15 October 2015

Site to site Error messages




During debug I could see this log:

Queueing KEY-ACQUIRE messages to be processed when P1 SA is complete.

I referred many documents to figure out what does this message say, and tried all
their suggestions but couldn't get my tunnel up.
Then I realized I have been missing something in my configuration.

I took a closer look and found that I have not enabled isakmp on my DMZ interface
where I was trying to create a tunnel to.
crypto isakmp enable DMZ


Monday, 12 October 2015

EZVPN on routers



Server side:

=================

username ezvpn-spoke1 password cisco1

aaa authentication login USER_AAA local
aaa authentication login USERLIST local
aaa authorization network GROUP_AAA local

Create A pool:

====================
ip local pool VPN-POOL 10.1.1.1 10.1.1.10

Split ACL :


ip access-list extended SPLIT_T
permit ip 192.168.0.0 0.0.255.255 any

!--- IKE configuration
!
crypto isakmp policy 10
encr 3des
hash md5
authentication pre-share
group 2

!
crypto isakmp client configuration group VPN1
acl SPLIT_T
key cisco123
pool VPN-POOL
save-password

!--- IPSec configuration
!
crypto ipsec transform-set TRANSFORM-1 esp-3des esp-md5-hmac
!
! Create a dynamic map
crypto dynamic-map dynamap
set transform-set TRANSFORM-1
!
crypto map mymap client authentication list USER_AAA
crypto map mymap isakmp authorization list GROUP_AAA
crypto map mymap client configuration address respond
crypto map mymap 30000 ipsec-isakmp dynamic dynamap

on public interface
crypto map mymap


Client Side config:
=========================
!--- IPSec configuration
!
crypto ipsec client ezvpn VPN1
connect auto
group VPN1 key cisco123
mode client
peer 1.1.1.1
username ezvpn-spoke1 password cisco1


on private interface
crypto ipsec client ezvpn VPN1 inside

on public Interface:
====================
crypto ipsec client ezvpn VPN1













Ref:
http://www.cisco.com/c/en/us/td/docs/routers/access/1800/1841/software/configuration/guide/sw/ezvpn.html

VPN client on ASA


This section describes how to configure remote access VPNs and includes the following topics:




•Configuring Interfaces
•Configuring ISAKMP Policy and Enabling ISAKMP on the Outside Interface
•Configuring an Address Pool
•Adding a User
•Creating a Transform Set
•Defining a Tunnel Group
•Creating a Dynamic Crypto Map
•Creating a Crypto Map Entry to Use the Dynamic Crypto Map


Configuring ISAKMP Policy and Enabling ISAKMP on the Outside Interface

 crypto isakmp policy 10
authentication pre-share
encryption 3des
hash sha
group 2

isakmp enable outside
 

Configuring an Address Pool

ip local pool testpool 192.168.0.10-192.168.0.15
 
 

Creating Split ACL

access-list SPLIT st permit ip 10.10.10.0 255.255.255.0

Creating Group policy:  Later we will call this policy in tunnel group

group-policy MYVPN
group-policy MYVPN internal
group-policy MYVPN attributes
split-tunnel-policy tunnelspecified
split-tunnel-network-list value SPLIT

Creating a Transform Set 

crypto ipsec transform set FirstSet esp-3des esp-md5-hmac
 

Defining a Tunnel Group 

tunnel-group testgroup type ipsec-ra
tunnel-group testgroup general-attributes 
address-pool testpool
default-group-policy MYVPN ********* This one is for split tunnel 
tunnel-group testgroup ipsec-attributes
pre-shared-key cisco123
 
 

Creating a Dynamic Crypto Map

crypto dynamic-map dyn1 1 set transform-set FirstSet

Creating a Crypto Map Entry to Use the Dynamic Crypto Map

crypto map mymap 65530 ipsec-isakmp dynamic dyn1
 crypto map mymap interface outside
 

 

 

 Ref: http://www.cisco.com/c/en/us/support/docs/security/asa-5500-x-series-next-generation-firewalls/70847-local-lan-pix-asa.html 

http://www.cisco.com/c/en/us/td/docs/security/asa/asa82/configuration/guide/config/vpnrmote.html#wp1084002

 

 

 

 

 

 

 

Thursday, 8 October 2015

Wednesday, 7 October 2015

Anyconnect CLI config on ASA


upload .pkg file to asa
You can ASDM to ASA and put .pkg file to your disk0.
or you can copy fro your TFTP
copy tftp flash
enter source IP
enter source file name anyconnect-win-3.1.05152-k9
destination file name , let it be same just hit enter

! Here is the scenario

!
! Create a 'pool' of IP addresses that the ASA will allocate to the remote clients.
!
ip local pool MYANYCONNECTPOOL 10.10.10.10-10.10.10.60 mask 255.255.255.0
!
!
! Enable webvpn, set the package to the one you uploaded earlier, then turn on AnyConnect. we are doing this so that if a user doesnt have anyconnect software he can connect to web VPN and then download the installation package.
!
webvpn
enable outside
tunnel-group-list enable ********** this command enables your tunnel-group drop down list option on the WebVPN Login page from webvpn mode
anyconnect image disk0:/anyconnect-win-3.1.05152-k9.pkg 1 
anyconnect enable
!
! create a local username and password, you may choose to use RADIUS or Kerberos AAA. also create an ACL that we will use for split tunneling in a minute.
!
username raj password cisco123
!
access-list SPLIT-TUNNEL standard permit 20.20.20.0 255.255.255.0
!
! Create a group policy and define the tunnel protocol as ssl-client also define what you want to do with your split tunnel.
!
group-policy GroupPolicy_ANYCONNECT-PROFILE internal
group-policy GroupPolicy_ANYCONNECT-PROFILE attributes
vpn-tunnel-protocol ssl-client
split-tunnel-policy tunnelspecified
split-tunnel-network-list value SPLIT-TUNNEL
!
! Create a matching tunnel-group that ties everything together. A tunnel group should have atleast three attributes : Type - Remote access, Pool & authentication method
!
tunnel-group Bangalore type remote-access
! Bangalore is the name of the profile that we will connect to.
tunnel-group Bangalore general-attributes
default-group-policy GroupPolicy_ANYCONNECT-PROFILE
address-pool MYANYCONNECTPOOL
tunnel-group Bangalore webvpn-attributes
! now when you will connect to VPN it will by default fall on default-webvpn tunnel group and you will get all drop down options to select your tunnel group/profile. But if you want to have direct connection to your profile then this can be done using "Group URL". you need to add this command additionally. I am not going to use it so I am just putting the command here :
! group-url https://10.197.226.101/Bangalore enable
group-alias Bangalore enable

2-factor authentication example:
==========================
We can enable 2- factor authentication and it will ask for 2 local user name and passwords if local authentication is enabled. Normally this Secondary authentication is done either using certificate or AD in association with a softoken software.

Here is how we can just test it using local authentication:

Using CLI :
============
 tunnel-group Bangalore general-attributes
        authentication-attr-from-server secondary
        authenticated-session-username secondary

        secondary-authentication-server-group LOCAL
Using ASDM:
============


source: http://www.cisco.com/c/en/us/td/docs/security/asa/asa84/asdm64/configuration_guide/asdm_64_config/vpn_asdm_setup.html