Skip to main content

Do I need exactly the same ACEs in my ACLs?

ikev2-ACL.jpg


You can find one statement under the above link: “Configure ACLs that mirror each other on both sides of the connection.”

The answer is: not really. Let’s test it: one peer has following encryption domain:
 
asa1# sh run access-list
access-list VPN extended permit ip 20.0.0.0 255.255.255.0 host 150.1.4.4
asa1#

one the second one:
 
R4(config-ext-nacl)#
R4(config-ext-nacl)#do sh runn | s access
ip access-list extended VPN
 permit ip 150.1.4.0 0.0.0.255 20.0.0.0 0.0.0.255
R4(config-ext-nacl)#

As you see the ACL on my ASA is more specific (host 150.1.4.4).

Before I initiate traffic let’s check the ipsec sessions:
 
R4#sh crypto session
Crypto session current status

Interface: FastEthernet0/0
Session status: DOWN
Peer: 10.0.0.1 port 500
  IPSEC FLOW: permit ip 150.1.4.0/255.255.255.0 20.0.0.0/255.255.255.0
        Active SAs: 0, origin: crypto map

R4#

Now I generate traffic and as you see a new IPsec flow has been added:
 
R4#sh crypto session
Crypto session current status

Interface: FastEthernet0/0
Session status: UP-ACTIVE
Peer: 10.0.0.1 port 500
  IKEv2 SA: local 10.0.0.4/500 remote 10.0.0.1/500 Active
  IPSEC FLOW: permit ip host 150.1.4.4 20.0.0.0/255.255.255.0
        Active SAs: 2, origin: crypto map
  IPSEC FLOW: permit ip 150.1.4.0/255.255.255.0 20.0.0.0/255.255.255.0
        Active SAs: 0, origin: crypto map

R4#

to be clear I don’t have host 150.1.4.4 in my ACL:
 
R4#sh run | s acce
ip access-list extended VPN
 permit ip 150.1.4.0 0.0.0.255 20.0.0.0 0.0.0.255
R4#sh run | s acce

I tested one more scenario to be sure it works with different masks:
 
R4(config-ext-nacl)#permit ip 150.1.4.0 0.0.0.15 20.0.0.0 0.0.0.255

and on 2nd peer:

asa1# sh run access-list
access-list VPN extended permit ip 20.0.0.0 255.255.255.0 150.1.4.0 255.255.255.0
asa1#

Before I generate traffic let’s check the ikev2 sessions:
 
R4#sh crypto session
Crypto session current status

Interface: FastEthernet0/0
Session status: DOWN
Peer: 10.0.0.1 port 500
  IPSEC FLOW: permit ip 150.1.4.0/255.255.255.240 20.0.0.0/255.255.255.0
        Active SAs: 0, origin: crypto map

R4#

Let’s test it:
 
R5#ping 150.1.4.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 150.1.4.4, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 72/86/92 ms
R5#

On the R4 we can see IPsec flow that matches with ACL:
 
R4#sh crypto session
Crypto session current status

Interface: FastEthernet0/0
Session status: UP-ACTIVE
Peer: 10.0.0.1 port 500
  IKEv2 SA: local 10.0.0.4/500 remote 10.0.0.1/500 Active
  IPSEC FLOW: permit ip 150.1.4.0/255.255.255.240 20.0.0.0/255.255.255.0
        Active SAs: 2, origin: crypto map

R4#
 
On ASA we see the same SA:
 
asa1# sh crypto ipsec sa
interface: outside
    Crypto map tag: MAPA, seq num: 10, local addr: 10.0.0.1

      access-list VPN extended permit ip 20.0.0.0 255.255.255.0 150.1.4.0 255.255.255.0
      local ident (addr/mask/prot/port): (20.0.0.0/255.255.255.0/0/0)
      remote ident (addr/mask/prot/port): (150.1.4.0/255.255.255.240/0/0)
      current_peer: 10.0.0.4

      #pkts encaps: 4, #pkts encrypt: 4, #pkts digest: 4
      #pkts decaps: 4, #pkts decrypt: 4, #pkts verify: 4

It means the SA will be created from more specific crypto domain.

I tested it also the opposite case scenario (ASA has less specific ACL):
 
asa1# sh run access-list
access-list VPN extended permit ip 20.0.0.0 255.255.255.0 150.1.0.0 255.255.0.0
asa1#
 
R4#sh run | s access
ip access-list extended VPN
 permit ip 150.1.4.0 0.0.0.15 20.0.0.0 0.0.0.255
R4#

and it works in the same way:
 
asa1# sh crypto ipsec sa
interface: outside
    Crypto map tag: MAPA, seq num: 10, local addr: 10.0.0.1

      access-list VPN extended permit ip 20.0.0.0 255.255.255.0 150.1.0.0 255.255.0.0
      local ident (addr/mask/prot/port): (20.0.0.0/255.255.255.0/0/0)
      remote ident (addr/mask/prot/port): (150.1.4.0/255.255.255.240/0/0)
      current_peer: 10.0.0.4

      #pkts encaps: 4, #pkts encrypt: 4, #pkts digest: 4
      #pkts decaps: 4, #pkts decrypt: 4, #pkts verify: 4
 
 
R4#sh crypto session detail
Crypto session current status

Code: C - IKE Configuration mode, D - Dead Peer Detection
K - Keepalives, N - NAT-traversal, T - cTCP encapsulation
X - IKE Extended Authentication, F - IKE Fragmentation

Interface: FastEthernet0/0
Uptime: 00:01:02
Session status: UP-ACTIVE
Peer: 10.0.0.1 port 500 fvrf: (none) ivrf: (none)
      Phase1_id: 10.0.0.1
      Desc: (none)
  IKEv2 SA: local 10.0.0.4/500 remote 10.0.0.1/500 Active
          Capabilities:(none) connid:1 lifetime:23:58:58
  IPSEC FLOW: permit ip 150.1.4.0/255.255.255.240 20.0.0.0/255.255.255.0
        Active SAs: 2, origin: crypto map
        Inbound:  #pkts dec'ed 8 drop 0 life (KB/Sec) 4454585/3537
        Outbound: #pkts enc'ed 8 drop 0 life (KB/Sec) 4454585/3537

R4#

Comments

Popular posts from this blog

What should you know about HA 'override enabled' setting on Fortigate?

High availability is mandatory in most of today's network designs. Only very small companies or branches can run their business without redundancy. When you have Fortigate firewall in your network you have many options to increase network availability. You can use Fortigate Clustering Protocol ( FGCP ) or Virtual Router Redundancy Protocol ( VRRP ). FGCP has two modes: 'override' disabled (default) and 'override' enabled . I'm not going to explain how to set up HA as you can find many resources on Fortinet websites: https://cookbook.fortinet.com/high-availability-two-fortigates-56/ https://cookbook.fortinet.com/high-availability-with-fgcp-56/ Let's recap what is the main difference between them. The default HA setting is 'override' disabled and this is an order of selection an active unit: 1) number of monitored interfaces - when both units have the same number of working (up) interfaces check next parameter 2) HA uptime - an ...

FortiGate and GRE tunnel

Recently I worked on one project where a client requested to re-route web traffic to the GRE tunnel to perform traffic inspection. I would like to share with you what is required if you configure it on FortiGate. We need a new GRE interface and policy base routing (PBR) to change the route for specific source IPs. Of course you need firewall policies to permit the traffic. Let's start with GRE interface. Unfortunately you can't configure it using the GUI, only CLI is the option: config system gre-tunnel edit "gre1" set interface "port1" set local-gw 55.55.55.55 set remote-gw 44.44.44.44 next end When the end peer is Cisco router, you need to set the IP for the GRE interface: config system interface edit gre1 set ip 192.168.10.10 255.255.255.255 set remote-ip192.168.10.20 end In next step we need to fix routing. We need the alternate path via GRE but to keep the route in the active routing table you need to set the same AD (adminis...

Data Leak Prevention (DLP) on Fortigate

Today I would like to present one interesting feature you may find on your Fortigate - Data Leak Prevention. I know there are much better, dedicated solutions on the market but in certain situations the DLP feature available on FortiOS is good enough. Why you should use it? This is very important to say: the DLP in such deployment (on Fortigate) can't protect your data against every data leak. Users in your network with his/her mobile can easily take a photo of any document. Why we should still consider it? It is a good (and easy to deploy) method to prevent users' mistakes. It happened hundreds of time when a user attached a wrong file. Sound familiar? Using the DLP you can create policies which stop such leak. Let me show you how you can configure it. Step #1 First, you have to check if DLP is enabled in a "Feature Visibility" and "Security Features" section: When you do not see the feature, make sure your Fortigate works in a proxy-ba...