Networking-Blog

My WordPress Blog

Connection Flags on Cisco ASA

Below is presented list of flags with short description which you can see on Cisco devices:

 

A – awaiting inside ACK to SYN
a – awaiting outside ACK to SYN
B – initial SYN from outside
b – TCP state-bypass or nailed
C – CTIQBE media
D – DNS
d – dump
E – outside back connection
F – outside FIN
f – inside FIN
G – group
g – MGCP
H – H.323
h – H.225.0
I – inbound data
i – incomplete
J – GTP
j – GTP data
K – GTP t3-response
k – Skinny media
M – SMTP data
m – SIP media
n – GUP
O – outbound data
P – inside back connection
p – Phone-proxy TFTP connection
q – SQL*Net data
R – outside acknowledged FIN
R – UDP SUNRPC
r – inside acknowledged FIN
S – awaiting inside SYN
s – awaiting outside SYN
T – SIP
t – SIP transient
U – up
V – VPN orphan
W – WAAS
X – inspected by service module

Note: When checking flags in connection table on firewall make sure you confirm communication
protocol. It’s displayed in first column. 
Below is example of two identical flags having different meaning
depending on protocol used:

Example of connection table :

UDP outside 125.209.93.83:0 dmz 94.236.50.225:5060, idle 0:00:00, bytes 0, flags ti
UDP outside 125.209.93.83:0 dmz 94.236.50.225:5060, idle 0:00:00, bytes 0, flags ti
UDP outside 125.209.93.83:0 dmz 94.236.50.225:31825, idle 0:00:00, bytes 0, flags mi
UDP outside 125.209.93.83:0 dmz 94.236.50.225:31824, idle 0:00:00, bytes 0, flags mi

Inter-VLAN routing on a Cisco ASA with same security interfaces

The Problem: You’re setting up inter-VLAN routing on your Cisco ASA firewall  (5510, et al) using sub-interfaces.  There should be no restrictions on what traffic can flow where between the internal VLANs, so you’ve set the same security level on all of the sub-interfaces and have added the configuration command(s) to allow “same security” traffic to move freely.

Should work like a champ, right?  Not so fast!  Things never work quite as planned when we’re talking about Cisco’s powerful but often frustrating line of firewalls.

When you use a separate internal router for inter-VLAN routing, this type of setup is sometimes referred to as a “router on a stick”. Small and mid-sized companies don’t want to spend the money on an extra router (or have an extra point of failure), so they’re just using their ASAs to do the inter-VLAN routing.

The main difference here is that the ASA is also the gateway out to the Internet, which means that it performs NAT. Another difference is that Cisco still hasn’t made the inter-VLAN routing implementation very user-friendly on ASAs. But it does work if you know how to set it up.

The Solution: From a technical standpoint, the main issue here is that the ASA also does NAT whenever inside traffic connects out to anywhere else.  You might think that it would know to keep the same addresses when traffic flows from one VLAN-assigned same-security interface to another, but it doesn’t.  You have to add static commands for every possible subint-to-subint (vlan-to-vlan) interconnection and specifically tell it to use the same addresses before and after NAT.

See below for an actual configuration.

Configuration:  Here’s a typical configuration for setting this up on an ASA 5510, along with some comments.

Let’s say that you are routing for 3 different VLANs via sub-interfaces on the physical E0/0 interface. The base configuration on the ASA looks something like this:

interface Ethernet0/0
 description LAN
 no nameif
 no security-level
 no ip address
!
interface Ethernet0/0.2
 vlan 2
 nameif inside
 security-level 100
 ip address 192.168.2.1 255.255.255.0
!
interface Ethernet0/0.3
 vlan 3
 nameif wireless
 security-level 100
 ip address 192.168.3.1 255.255.255.0
!
interface Ethernet0/0.4
 vlan 4
 nameif servers
 security-level 100
 ip address 192.168.4.1 255.255.255.0
!
interface Ethernet0/1
 description Primary Internet
 nameif outside
 security-level 0
 ip address 209.9.9.16 255.255.255.0
!
same-security-traffic permit inter-interface
same-security-traffic permit intra-interface
!
global (outside) 1 interface
nat (inside) 1 192.168.2.0 255.255.255.0
nat (wireless) 1 192.168.3.0 255.255.255.0
nat (servers) 1 192.168.4.0 255.255.255.0

Note the two same-security-traffic statements that allow traffic to flow between and within interfaces and sub-interfaces that have the same security level. This prevents you from having to add access lists, but that’s about it.

Inter-VLAN routing won’t work with the above configuration as is. You might think you could just add some additional globals for the sub-ints, but that also won’t do the job with this setup. What you need are a series of static entries, basically telling it not to NAT traffic between the various sub-ints (actually, it does NAT them, but keeps the same IP address before and after).  You’ll need a separate static for each subint-to-subint (vlan-to-vlan) connection. For each one, the first sub-int specified is the one whose IP network you need to enter twice in the static statement.

For example, to get the above configuration to work, you would add the following:

static (inside,wireless) 192.168.2.0 192.168.2.0 netmask 255.255.255.0
static (inside,servers) 192.168.2.0 192.168.2.0 netmask 255.255.255.0
static (wireless,inside) 192.168.3.0 192.168.3.0 netmask 255.255.255.0
static (wireless,servers) 192.168.3.0 192.168.3.0 netmask 255.255.255.0
static (servers,inside) 192.168.4.0 192.168.4.0 netmask 255.255.255.0
static (servers,wireless) 192.168.4.0 192.168.4.0 netmask 255.255.255.0

Once you get those statics in there, inter-VLAN routing will work just fine. But it’s a bit ugly, isn’t it?!? For N number of VLANs, you need (N-1) x N of these statements, so for just 5 total VLANs you need 20 of them.

TCP State bypass on a Cisco ASA

We have a few remote sites that directly connect to the primary data centre with fibre
optic cables. A backup connection is provided using MPLS.

StateLess

 

If the fibre optic cable is cut (thankfully a not too common event) traffic is rerouted through
the managed MPLS network and enters the data centre through an ASA firewall.

Because the ASA has no information in its state table about in-flight connections, the
TCP packets are dropped, temporarily disrupting the operation of the remote site.

For this scenario and for others where asymmetric traffic flow can occur it is possible
to configure the ASA to bypass TCP state checking. Note that the traffic still has to be
allowed by access-lists.

Step 1 – Identify the traffic

The first step is to identify the traffic for which you want to bypass TCP state inspection.
This is done by creating an access list. In this example traffic flowing between subnets
10.1.0.0/16 and 10.2.0.0/16 is identified:

access-list StatelessTraffic remark Outbound Traffic
access-list StatelessTraffic extended permit tcp 10.1.0.0 255.255.0.0 10.12.0.0 255.255.0.0
log disable
access-list StatelessTraffic remark Inbound Traffic
access-list StatelessTraffic extended permit tcp 10.2.0.0 255.255.0.0 10.1.0.0 255.255.0.0
log disable

 

Step 2 – Create a class map

A class map is created to match traffic using the access-list created in step 1

class-map tcp_bypass 
match access-list StatelessTraffic

Step 3 – Create the policy maps

A policy map defines the actions to be taken for traffic matching specified class maps.
The policy map is applied to one or more interfaces or can be applied as a global policy.
In this example two policy maps are used, one for the outgoing traffic (entering the
Inside interface) and one for the incoming traffic (entering the MPLS interface):

policy-map Inside-policy 
class tcp_bypass  
set connection timeout idle 0:15:00   
set connection advanced-options tcp-state-bypass

policy-map MPLS-policy 
class tcp_bypass  
set connection timeout idle 0:15:00   
set connection advanced-options tcp-state-bypass

The two policies apply two settings for matching traffic. The first set statement modifies
the idle timeout from the default (usually one hour) to 15 minutes (see below). The
second set statement requests that state inspection of matching TCP traffic be bypassed.

Step 4 – Apply the policy maps to the interfaces

The last step is to apply the policy maps to the appropriate interfaces, in this case Inside
and MPLS:

service-policy Inside-policy interface Inside 
service-policy MPLS-policy interface MPLS

Idle Timeout Interval

The idle timeout interval is used to remove entries from the ASA state table for any
connections which have been idle for a specified time, usually one hour. Normally TCP
entries will be deleted when the ASA sees that the connection has been terminated
(FIN or RST). However when TCP state bypass is enabled, this check is not done and
all TCP sessions will remain in the state table until the idle timeout is reached.
Reducing the idle timeout to 15 minutes will delete closed sessions earlier and reduce
memory requirements.

Limitations

There are a number of limitations introduced when TCP bypass is enabled on an ASA.
You should refer to the latest Cisco documentation to understand how they may impact
your security before using this feature. In our case we only enable TCP bypass for traffic in 
fairly rare and short lived cases and accept the limitations to provide a seamless failover
to our remote users.

Getting Started with Cisco Anyconnect

AnyConnect tunnels through HTTPS


1
. Enable WebVPN on the interface

webvpn
enable PUBLIC
svc ask enable

!

2. Configure AAA authentication and tunnel group

tunnel-group DefaultWEBVPNGroup type remote-access
tunnel-group DefaultWEBVPNGroup general-attributes
authentication-server-group LOCAL

!

3. If using LOCAL database, add users to the Database

username test password t3stP@ssw0rd
username test attributes
service-type remote-access

!

4. Point the ASA to an AnyConnect image

webvpn
svc image anyconnect-win-2.1.0148-k9.pkg

!

5. Enable AnyConnect

webvpn
enable PUBLIC

!

6. Add an address pool to assign an ip address to the AnyConnect

ip local pool client-pool 192.168.1.1-192.168.1.254 mask 255.255.255.0

!

7. Configure group policy

group-policy DfltGrpPolicy internal
group-policy DfltGrpPolicy attributes
vpn-tunnel-protocol svc webvpn

!

8. NAT Exemption

access-list NONAT extended permit ip 192.168.1.0 255.255.255.0 192.168.2.0 255.255.255.0
!
nat (inside) 0 access-list NONAT

!

9. DNS

group-policy DfltGrpPolicy attributes
dns-server value 8.8.8.8
default-domain value

!

10. Split Tunneling + Binding to Group-Policy

access-list SPLIT standard permit 192.168.1.0 255.255.255.0

group-policy DfltGrpPolicy attributes
split-tunnel-policy tunnelspecified
split-tunnel-network value SPLIT

!

11. Autolaunch Anyconnect ( Cisco SSL VPN Client (SVC)

group-policy DfltGrpPolicy attributes
webvpn
svc ask none default svc

!
!

12. Complete Configuration :

access-list NONAT extended permit ip 192.168.1.0 255.255.255.0 192.168.2.0 255.255.255.0
!
access-list SPLIT standard permit 192.168.1.0 255.255.255.0
!
ip local pool client-pool 192.168.2.1-192.168.2.254 mask 255.255.255.0
!
nat (inside) 0 access-list NONAT

!
!

webvpn
enable PUBLIC
svc ask enable
svc image disk0:/anyconnect-win-2.4.1012-k9.pkg 1
!
tunnel-group DefaultWEBVPNGroup type remote-access
tunnel-group DefaultWEBVPNGroup general-attributes
authentication-server-group LOCAL
!
group-policy DfltGrpPolicy internal
group-policy DfltGrpPolicy attributes
dns-server value 8.8.8.8
default-domain value dallas.co.uk
vpn-simultaneous-logins 50
vpn-idle-timeout none
vpn-tunnel-protocol svc webvpn
password-storage enable
address-pool client-pool
split-tunnel-policy tunnelspecified
split-tunnel-network value SPLIT
!
username ECVPN01 attributes
service-type remote-access
!
username ECVPN01 attributes
webvpn
file-browsing enable
file-entry enable
homepage value http://172.28.2.10

 

Summary :
Complete Configuration (nonat/split tunnel/client-pool) :

access-list NONAT extended permit ip 192.168.1.0 255.255.255.0 192.168.2.0 255.255.255.0
!
access-list SPLIT standard permit 192.168.1.0 255.255.255.0
!
ip local pool client-pool 192.168.2.1-192.168.2.254 mask 255.255.255.0
!
nat (inside) 0 access-list NONAT
!

Complete Configuration (webvpn) :

webvpn
enable outside
svc enable
svc image disk0:/anyconnect-win-2.4.1012-k9.pkg 1
svc image disk0:/macimg.dmg 2
!

Complete Configuration (group-policy)

group-policy DfltGrpPolicy internal
group-policy DfltGrpPolicy attributes
dns-server value 8.8.8.8
vpn-simultaneous-logins 50
vpn-idle-timeout none
vpn-tunnel-protocol svc webvpn
password-storage enable
split-tunnel-policy tunnelspecified
split-tunnel-network-list value SPLIT
default-domain value mydomain.com
!

Tunnel-Group Configuration :

ip local pool client-pool 192.168.50.1-192.168.50.254 mask 255.255.255.0
!
tunnel-group DefaultPolicy type remote-access
tunnel-group DefaultPolicy general-attributes
address-pool client-pool
authentication-server-group (PUBLIC) LOCAL
default-group-policy DfltGrpPolicy
!
tunnel-group DfltGrpPolicy webvpn-attributes
group-alias MYVPN enable
!
webvpn
tunnel-group-list enable
!

Username Configuration :

username ECVPN01 attributes
service-type remote-access
!
username ECVPN01 attributes
webvpn
file-browsing enable
file-entry enable
homepage value http://172.28.2.10

Cisco Pix/ASA hairpinning

The term hairpinning comes from the fact that the traffic comes from one source into a router or similar
devices,
makes a U-turn and goes back the same way it came.

Hairpinning is only relevant when the firewall is in routed mode since the “turnaround” of traffic
is a routing decision. Also there needs to be another router 
involved. If the firewall is setup to only
pass traffic between interfaces no hairpinning will be taking place.

Typical hairpinning is done when there is a router inside of the firewall beyond which there is
another network that needs to be reached
  to/from the inside network.

 

Another fundament for hairpinning taking place is that not all network equipment has full knowledge
of the network topology. Typically these are computers with only a default route (“default gateway”)
to something but not aware of the fact that the remote network is reachable directly via the other router
without taking the path via the firewall (see picture above).

If the computer had that knowledge it would never involve the firewall. A workaround like this could be
in a windows-host to add “route -p 192.168.2.0 mask 255.255.255.0 192.168.1.2″ from the command
prompt. However this is in most cases not very flexible since it is a manual work at each host.

ver 7.2

Beginning with v7.2 the “same-security permit-intra-interface”-command becomes useful and can
be used for other traffic than vpn-initiated. Now we can do hair- pinning. So, what is needed?
First of all, the “same-security permit -intra-interface”. Also we need to allow inbound  traffic if
we 
have an access-list applied inbound on the interface.

Let´s have another look at our example:

 

In this example we have one host at 192.168.1.100 using the firewall .1 as default gateway.
The firewall has a route for the 192.168.2.0/24-network via 192.168.1.2 
and the route is
directly connected to both networks. Because of this configuration the traffic from
192.168.1.100 is hair-pinned back, to the router.


interface Vlan1
nameif inside
security-level 100
ip address 192.168.1.1 255.255.255.0
!
route inside 192.168.2.0 255.255.255.0 192.168.1.2 1
!
same-security-traffic permit intra-interface
!
no nat-control

All magic lies in the “same-security-traffic”-command. In the example above we have no
access-list applied.
If we have we must also open for that traffic:


access-list acl_inside extended permit ip 192.168.2.0 255.255.255.0 192.168.1.0 255.255.255.0
!
access-list acl_inside extended permit ip 192.168.1.0 255.255.255.0 192.168.2.0 255.255.255.0
!
access-list acl_inside extended deny ip any any
!
access-group acl_inside in interface inside

We most likely has a NAT/global configured for the inside network to be able to reach internet.
If we add this to our example we kill our hair-pinning:


nat (inside) 1 0.0.0.0 0.0.0.0
global (outside) 1 interface

Now, when we try to ping from 192.168.1.100 to 192.168.2.200 we get this log output
of the firewall:


%ASA-3-305006: portmap translation creation failed for icmp src inside:192.168.1.100 dst inside:192.168.2.200 (type 8, code 0)
%ASA-3-305006: portmap translation creation failed for icmp src inside:192.168.1.100 dst inside:192.168.2.200 (type 8, code 0)
%ASA-3-305006: portmap translation creation failed for icmp src inside:192.168.1.100 dst inside:192.168.2.200 (type 8, code 0)
%ASA-3-305006: portmap translation creation failed for icmp src inside:192.168.1.100 dst inside:192.168.2.200 (type 8, code 0)
%ASA-3-305006: portmap translation creation failed for icmp src inside:192.168.1.100 dst inside:192.168.2.200 (type 8, code 0)

As soon as we add ANY nat-configuration for an interface we must configure nat for all traffic from
that interface, even hairpinned traffic. We do this with the static-command below. The purpose of this
is to “static” translate traffic from interface “inside” to interface “inside” where the source is “192.168.1.0″
(netmask 255.255.255.0 and translate the source to “192.168.1.0″ (the same address). We also do the same
for the 192.168.2.0-network to ensure that traffic can flow initiated in both directions.


static (inside,inside) 192.168.1.0 192.168.1.0 netmask 255.255.255.0
!
static (inside,inside) 192.168.2.0 192.168.2.0 netmask 255.255.255.0

The compilation of relevant configuration lines in the firewall to ackomplish this is shown here:


hostname fw
!
interface Vlan1
nameif inside
security-level 100
ip address 192.168.1.1 255.255.255.0
!
interface Vlan222
nameif outside
security-level 0
ip address dhcp setroute
!
boot system disk0:/asa725-k8.bin
!
same-security-traffic permit intra-interface
!
access-list acl_inside extended permit ip 192.168.2.0
255.255.255.0 192.168.1.0 255.255.255.0
!
access-list acl_inside extended permit ip 192.168.1.0
255.255.255.0 192.168.2.0 255.255.255.0
!
access-list acl_inside extended deny ip any any
!
nat-control
!
global (outside) 1 interface
nat (inside) 1 0.0.0.0 0.0.0.0
!
static (inside,inside) 192.168.1.0 192.168.1.0 netmask 255.255.255.0
static (inside,inside) 192.168.2.0 192.168.2.0 netmask 255.255.255.0
!
access-group acl_inside in interface inside
!
route inside 192.168.2.0 255.255.255.0 192.168.1.2 1

Ver 8.3

In this version the nat-concept is totally rewritten with a new command syntax.
More about this can be read about elsewhere, but the technique is the same.

This is the converted version of the configuration snippet above:


hostname fw
!
interface Vlan1
nameif inside
security-level 100
ip address 192.168.1.1 255.255.255.0
!
interface Vlan222
nameif outside
security-level 0
ip address dhcp setroute
boot system disk0:/asa831-k8.bin
!
same-security-traffic permit intra-interface
!
object network obj-192.168.1.0
subnet 192.168.1.0 255.255.255.0
!
object network obj-192.168.2.0
subnet 192.168.2.0 255.255.255.0
!
object network obj_any
subnet 0.0.0.0 0.0.0.0
!
object network obj_any-01
subnet 0.0.0.0 0.0.0.0
!
object network obj-0.0.0.0
host 0.0.0.0
!
access-list acl_inside extended permit ip 192.168.2.0
255.255.255.0 192.168.1.0 255.255.255.0
!
access-list acl_inside extended permit ip 192.168.1.0
255.255.255.0 192.168.2.0 255.255.255.0
!
access-list acl_inside extended deny ip any any
!
object network obj-192.168.1.0
nat (inside,inside) static 192.168.1.0
!
object network obj-192.168.2.0
nat (inside,inside) static 192.168.2.0
!
object network obj_any
nat (inside,outside) dynamic interface
!
object network obj_any-01
nat (inside,outside) dynamic obj-0.0.0.0
!
access-group acl_inside in interface inside
!
route inside 192.168.2.0 255.255.255.0 192.168.1.2 1


Assymetric routing

An issue with the configuration above is that since the firewall is stateful
(which means that it keeps track of TCP-states) and the fact that traffic in one direction
goes via the firewall (from 192.168.1.100 to 192.168.2.200) but the traffic in the other direction
goes direct makes the firewall going bananas. If the traffic initiates from the 1-network all is
fine since the firewall allowes the initial packet and never sees the return traffic. It might build a
quite large list of incomplete sessions that eventually will time out, but it will work:

 

 

However, when the traffic is initiated from the 2-network the first packet that will be seen
by the firewall
is the second (SYN-ACK) which is not very appreciated.

 

Beginning with version 8.2 there is a solution for this in the “tcp state bypass”-functionality.
By using this you can with MPF (modular policy framework) specify
traffic that should not be
handled stateful.

Here is an example of doing that. Genereally my solution to hairpinning- and/or
assymetric routing-issue is 
to avoid it. If you have one or more routers in your topology it is
probably a good idea to use that router
as the default gateway instead and only direct traffic to
the firewall that should pass it.

The drawback from this is that internet-traffic needs to go via the router instead.
However this seldom causes any trouble since the router is not stateful and has no issues
with doing hairpinning.

Conclusion

Hairpinning of traffic in Cisco Pix/ASA and problems with assymetric routing can be a
pain. There are workarounds but mostly assymetric issues are symptoms of bad network
design rather than configuration issues.

There are more dimensions of hairpinning than just internal traffic turning around to a
WAN-router. Such a common example is U-turning of VPN-traffic, for example traffic
from an VPN-client going via the firewall out to internet or into another vpn-tunnel.
Or spoke-hub-spoke VPN-traffic. This type of traffic seldom gives routing or assymetric issues
but is more a matter of defining proxy ACL:s for vpn-traffic and not doing NAT on that traffic.

Using NAT when nat-control is disabled

Traditionally, the PIX required a NAT translation for traffic flowing from one interface to another.
Beginning with 7.0, this is no longer the case. The introduction of the nat-control command means
that you can configure your PIX or ASA to allow traffic to flow across the security appliance without nat.

When nat-control is enabled NAT is required for all traffic flowing across the security appliance.
When nat-control is disabled NAT is optional for traffic flowing across the security appliance.

What I learned the other day, though, is that even if NAT control is disabled, if you add a NAT configuration
to an interface, all traffic originating on that interface must have a NAT rule in place.

Here is the situation (simplified) from a recent forum discussion I was engaged in:Nat-control was off.
There were two high security interfaces named “inside” and “inside2″.

The user wanted to PAT traffic from those high security interfaces out the outside interface, so he added
two nat statements to his config.

nat (inside) 1 0.0.0.0 0.0.0.0
nat (inside2) 1 0.0.0.0 0.0.0.0
global (outside) 1 interface

This worked great for outbound traffic. Users on both interfaces could reach the Internet via PAT and all
was well…except that the two interfaces could not talk to each other. When the user tried to send traffic from
inside to inside2, he got the following translation error:

portmap translation creation failed for icmp src inside:192.168.200.1 dst
inside2:192.168.0.150 (type 8, code 0)

As we now know, this error showed up because he did not have a NAT rule to cover traffic from inside to
inside2 (or vice versa). He only had a NAT rule for the outbound PAT!

It appears that nat behaves on a per-interface basis, not a per-flow basis. My first thought was that
traffic going outbound would use the PAT configuration, while traffic going from inside to inside2 would not
need nat because of no nat-control. After labbing it up, though, I realized I was wrong.

So what was there to do? Since PAT is a requirement, the solution is more NAT. In this case statics were
used 
to perform identity NAT for traffic flowing across the security appliance between the two inside
interfaces:

static (inside,inside2) 192.168.200.0 192.168.200.0 netmask 255.255.255.0
static (inside2,inside) 192.168.0.0 192.168.0.0 netmask 255.255.255.0

Keep it in mind: Even with nat-control disabled, once you add a nat statement for PAT to an interface, you
require NAT for all traffic on that interface. :-)

CISCO ASA DYNAMIC IPSEC VPN

Dynamic IPSEC :

object-group network Eyre_Remote_Private_nonat
network-object 192.168.3.0 255.255.255.0
!
object-group network Eyre_HQ_Private_nonat
network-object 172.16.0.0 255.255.0.0
!
!
nat (DC_LAN,PUBLIC) source static Eyre_HQ_Private_nonat Eyre_HQ_Private_nonat destination static Eyre_Remote_Private_nonat Eyre_Remote_Private_nonat
!
!
crypto ipsec security-association lifetime seconds 86400
crypto ipsec security-association lifetime kilobytes 9908000
!
crypto dynamic-map draytech_map 5 set ikev1 transform-set ESP-3DES-MD5
crypto dynamic-map draytech_map 5 set reverse-route
!
crypto map Public_map 10 ipsec-isakmp dynamic draytech_map
!
crypto map Public_map interface outside
!
crypto isakmp identity address
crypto isakmp nat-traversal 10
crypto ikev1 enable outside
sysopt connection permit-ipsec
!
crypto ikev1 policy 1
authentication pre-share
encryption 3des
hash md5
group 2
lifetime 86400
!
tunnel-group DefaultL2LGroup type ipsec-l2l
tunnel-group DefaultL2LGroup ipsec-attributes
ikev1 pre-shared-key PASSWORD
isakmp keepalive threshold 20 retry 5

 

If all traffic is to be pushed down the tunnel from remote site, we need to make sure both ends
Access-list policies match :

eg :

ASA 5520 V8.3 :

name 10.171.53.0 ee053
! 
object-group network Remote_Private_Range
description Remote Summarisation of Private IP Address
network-object ee053 255.255.255.0
!
object network Eyre_HQ_Private_nonat
description HQ site private range
subnet 0.0.0.0 0.0.0.0
!
access-list Colo_cryptomap_5 extended permit ip any object-group Remote_Private_Range
!
!
nat (DC_LAN,PUBLIC) source static Eyre_HQ_Private_nonat Eyre_HQ_Private_nonat destination static Eyre_Remote_Private_nonat Eyre_Remote_Private_nonat
!
nat (PUBLIC,DC_LAN) source static Eyre_Remote_Private_nonat Eyre_Remote_Private_nonat destination static Eyre_HQ_Private_nonat Eyre_HQ_Private_nonat
!
crypto dynamic-map draytech_map 5 match address Colo_cryptomap_5


Remote Site Cisco :

ip access-list extended VPN
permit ip 10.171.53.0 0.0.0.255 any

 

 

 

CISCO ASA ISAKMP KEEPALIVE – DPD

Dead Peer Detection – DPD

DPD on ASA

ASA and PIX firewalls support “semi-periodic” DPD only. I.e. they send R-U-THERE message to
a peer if the peer was idle for <threshold> seconds. ASA may have nothing to send to the peer,
but DPD is still sent if the peer is idle. If the VPN session is comletely idle the R-U-THERE messages
are sent every <threshold> seconds. If there is a traffic coming from the peer the R-U-THERE
messages are not sent.

Unlike routers, you can completely disable DPD on ASA and it will not negotiate it with a peer
(“disable” configuration option).

Also, you can configure “one-way” DPD mode on ASA. The ASA will respond to R-U-THERE
messages, but will not initiate DPD exchange (“threshold infinite” configuration option).

isakmp keepalive {disable | threshold <threshold> retry <retry-interval> | threshold infinite}

If the peer doesn’t respond with the R-U-THERE-ACK the ASA starts retransmitting R-U-THERE
messages every <retry-interval> seconds with a maximum of three retransmissions.
After that the peer is declared dead.

You cannot specify the number of retries on ASA.

DPD is enabled by default on ASA for both L2L and RA IPSec:

tunnel-group DefaultRAGroup ipsec-attributes
isakmp keepalive threshold 300 retry 2

In brief, on ASA we have the following:

only “semi-periodic” DPD is supported
DPD can be completely disabled
one-way mode is supported
bidirectional mode is the default one
retry interval can be configured
retry count cannot be configured and equals to three

Recommended Settings :

ASA :

tunnel-group DefaultL2LGroup ipsec-attributes
isakmp keepalive threshold 20 retry 2

CISCO ROUTER :

crypto isakmp profile 1
keepalive interval 20 retry 2

Allows the gateway to send DPD messages to the peer.

•seconds—Number of seconds between DPD messages.
•retries—(Optional) Number of seconds between DPD retries if the DPD message fails.
•periodic—(Optional) DPD messages are sent at regular intervals.
•on-demand—(Optional) DPD retries are sent on demand. This is the default behavior.

command on ASA’s/PIX’s to view the status of isakmp keepalives?

This command shows you how long it has been since a keepalive has been received.

show vpn-sessiondb detail l2l
show crypto isakmp sa detail

If the remote VPN peer initiates a site-to-site tunnel using aggressive mode, then the ASA uses that
for tunnel negotiations. Aggressive mode has some security weaknesses, so it is recommended to use
main mode where possible.

However, if you do not want to accept connections using aggressive mode, you can disable it globally,

Disabling Aggressive Mode
crypto isakmp am-disable

Cisco ASA – Configuring Connection Limits

The Cisco ASA firewall offers excellent protection for Denial of Service attacks, such as SYN floods,
TCP excessive connection attacks etc. Using the new Policy Framework functionality,
the ASA administrator can configure granular controls for TCP Connection limits and timeouts.

For example, we can control and limit the maximum number of simultaneous TCP and UDP connections
that are allowed towards a specific host (or subnet), the maximum number of simultaneous embryonic
connections allowed (for SYN flood attacks), the per-client max number of connections allowed etc.

Configuration Example

STEP1: Identify the traffic to apply connection limits using a class map

access list CONNS-ACL extended permit ip any 10.1.1.1 255.255.255.255
!
class-map CONNS-MAP
match access-list CONNS-ACL

STEP2: Add a policy map to set the actions to take on the class map traffic

policy-map CONNS-POLICY
class CONNS-MAP
set connection timeout idle 0:00:00 dcd 0:00:15 60

STEP3: Apply the Policy on one or more interfaces or Globaly

service-policy CONNS-POLICY {global | interface interface_name}( interface PUBLIC).

Additional Notes :

Default Settings :

timeout conn 2:30:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02

Modified Settings :

timeout conn 0:00:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02

where the embryonic hh:mm:ss keyword sets the timeout period until a TCP embryonic (half-open)
connection is closed, between 0:0:5 and 1193:00:00. The default is 0:0:30.
You can also set this value to 0, which means the connection never times out.

The idle hh:mm:ss keyword sets the idle timeout for all protocols between 0:5:0 and 1193:00:00.
The default is 1:0:0. You can also set this value to 0, which means the connection never times out.
For TCP traffic, the reset keyword sends a reset to TCP endpoints when the connection times out.

The half-closed hh:mm:ss keyword sets the idle timeout between 0:5:0 and 1193:00:00.
The default is 0:10:0. Half-closed connections are not affected by DCD. Also, the ASA does not send a
reset when taking down half-closed connections.

The dcd keyword enables DCD. DCD detects a dead connection and allows it to expire,
without expiring connections that can still handle traffic. You configure DCD when you want
idle,but valid connections to persist. After a TCP connection times out, the ASA sends DCD probes
to the end hosts to determine the validity of the connection.
If one of the end hosts fails to respond after the maximum retries are exhausted, the ASA frees
the connection. If both end hosts respond that the connection is valid, the ASA updates the activity
timeout to the current time and reschedules the idle timeout accordingly.

The retry-interval sets the time duration in hh:mm:ss format to wait after each unresponsive DCD
probe before sending another probe, between 0:0:1 and 24:0:0. The default is 0:0:15.

The max-retries sets the number of consecutive failed retries for DCD before declaring the connection
as dead. The minimum value is 1 and the maximum value is 255. The default is 5.

Where the conn-max sets the maximum number of simultaneous TCP and/or UDP connections
that are allowed, between 0 and 65535.

The embryonic-conn-max sets the maximum number of simultaneous embryonic connections
allowed, between 0 and 65535.

The per-client-embryonic-max sets the maximum number of simultaneous embryonic connections
allowed per client, between 0 and 65535.

The per-client-max sets the maximum number of simultaneous connections allowed per client,
between 0 and 65535.


set connection timeout embryonic 0:0:30 idle 0 half-closed 0:10:00 dcd 0:0:15 60

dcd : 15 secs interval and retry 60 times. 4 retries in 1 minute equals to 60 retries within 15mins.

CISCO – ASA HTTP QOS Traffic

priority-queue outside
exit
!
access-list
Http-Traffic-OUT extended permit tcp
172.16.0.0 255.255.0.0 any eq http
!

class-map http_traffic
match dscp ef
match access-list Http-Traffic-OUT
!
policy-map
http_traffic_policy
class http_traffic
inspect http
police output 750000
!

service-policy http_traffic_policy interface outside