Skip to main content

Transparent Firewall (IOS) and CBAC.

Sometimes you have to implement L2 firewall in your network. There are many reasons to choose this solution and one of them is to preserve your L3 design. On Cisco routers you can implement IRB (Integrated Routing & Bridging) or CRB (Concurrent Routing & Bridging). The first one allows on exchanging traffic between routed and bridged interfaces. While CRB totally separate these types of traffic (L2 and L3). If you need L3 interface together with L2 you have to add BVI interface with IP from the same subnet as its neighbors

IRB (with BVI interface):

bridge irb
!
interface GigabitEthernet0/0.10
 encapsulation dot1Q 10
 bridge-group 1
!
interface GigabitEthernet0/1.20
 encapsulation dot1Q 20
 bridge-group 1
!
interface BVI1
 ip address 31.31.31.31 255.255.255.0
!
bridge 1 protocol ieee
!

 

 IRB (without BVI interface):

 

bridge irb
!
interface GigabitEthernet0/0.10
 encapsulation dot1Q 10
 bridge-group 1
!
interface GigabitEthernet0/1.20
 encapsulation dot1Q 20
 bridge-group 1
!
bridge 1 protocol ieee
!
no ip routing
!

 

CRB:

 

bridge crb
!
interface GigabitEthernet0/0.10
 encapsulation dot1Q 10
 bridge-group 1
!
interface GigabitEthernet0/1.20
 encapsulation dot1Q 20
 bridge-group 1
!
bridge 1 protocol ieee
!
no ip routing
!

Now, we implement the CBAC and we inspect icmp and tcp:


         OUTSIDE     L2 firewall       INSIDE
      [31.31.31.100]                 [31.31.31.2] 
          /----\        /----\         /----\ 
         |  R1  |------|  R2  |-------| Win  |
          \----/      / \----/ \       \----/ 
                  gig0/0.10 gig0/1.20  
                      icmp, tcp

                      <---------      


R2: 
ip inspect name L2-FW1 tcp 
ip inspect name L2-FW1 icmp alert on  
!
interface GigabitEthernet0/1.20 
encapsulation dot1Q 20 
ip inspect L2-FW1 in 
no ip route-cache 
bridge-group 1 
!

Let’s do some tests:

a) Win —> R1 (inside->outside)- ping:
 
C:\Documents and Settings\LabXP14>ping 31.31.31.100 -t
Pinging 31.31.31.100 with 32 bytes of data:
Reply from 31.31.31.100: bytes=32 time=1ms TTL=255
Reply from 31.31.31.100: bytes=32 time<1ms TTL=255
Reply from 31.31.31.100: bytes=32 time<1ms TTL=255
Reply from 31.31.31.100: bytes=32 time<1ms TTL=255
Ping statistics for 31.31.31.100:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 1ms, Average = 0ms

 We check if the FW sees the session:
 
r2#sh ip inspect sessions 
Established Sessions
 Session 312374B4 (31.31.31.2:8)=>(31.31.31.100:0) icmp SIS_OPEN
r2#

b) Win —> R1 (inside->outside)- telnet:
 
telnet 31.31.31.100

r2#sh ip inspect sessions 
Established Sessions
Session 31237294 (31.31.31.2:2452)=>(31.31.31.100:23) tcp SIS_OPEN
r2#

Let’s try to initiate traffic from R1 to Win (outside->inside):

a) telnet:
 
r2#sh ip inspect sessions 
Established Sessions
 Session 31237294 (31.31.31.2:2452)=>(31.31.31.100:23) tcp SIS_OPEN
r2#

b) ping:
 
r2#sh ip inspect sessions 
Established Sessions
 Session 312374B4 (31.31.31.2:8)=>(31.31.31.100:0) icmp SIS_OPEN
r2#

As we see from above tests we inspect traffic from the Windows client to R1 but we still can send any non-inspected traffic through the firewall in both directions. There is no implicit deny at the end of the inspection rule and to protect our network we have to apply the ACL. In our case we apply the ACL on our OUTSIDE with direction ‘in’:
 
r2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
r2(config)#access-list 101 deny   ip any any log
r2(config)#int gig0/0.10 
r2(config-subif)#ip access-group 101 in 
r2(config-subif)#end
r2#

r2#sh ip access-lists 
Extended IP access list 101
    10 deny ip any any log (2 matches)
r2#

Let’s try again send traffic from R1 to the Windows client (outside->inside):
 
r1#telnet 31.31.31.2
Trying 31.31.31.2 ...

On the firewall we can see the log message:
 
r2#
*Apr 14 20:55:20.262: %SEC-6-IPACCESSLOGP: list 101 denied tcp 31.31.31.100(33479) -> 31.31.31.2(23), 1 packet  

Let’s try ping:
 
r1#ping 31.31.31.2  

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 31.31.31.2, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
r1#

r2#
*Apr 14 20:56:48.574: %SEC-6-IPACCESSLOGDP: list 101 denied icmp 31.31.31.100 -> 31.31.31.2 (8/0), 11 packets

And now when we send traffic from the Windows client to R1 we see on the firewall following sessions:
 
r2#sh ip inspect sessions 
Established Sessions
 Session 31237294 (31.31.31.2:8)=>(31.31.31.100:0) icmp SIS_OPEN
 Session 312374B4 (31.31.31.2:2455)=>(31.31.31.100:23) tcp SIS_OPEN
r2#

It means that returning traffic which is already inspected is not controlled by the ACL applied on the OUTSIDE interface. The newer version of firewall - the Zone Base Firewall (ZBF) - doesn’t allow on any non-inspected traffic by default and you don’t have to apply any ACL like with CBAC.

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...