topleft
topright
ASA Transparent Firewall Behavior
Written by Paul Stewart   
Friday, 20 November 2009
 

I posted a couple of questions to Twitter this morning as both a challenge and a learning experience for myself and others. 

 

These two questions were as follows:

  1. How does the ASA in transparent mode know which interface remote networks should be reached through?
  2. What is permitted at layer 2 disregarding- layer 3 restrictions?

In addition, I’d like to pose one more question:

  1. In what case does the ASA in Transparent mode drop the first packet?

 

I promised an answer, but Twitter just didn’t allow enough characters to describe the behavior well.  First of I have always assumed that the ASA in transparent mode acted like a bridge.  In other words if a frame was received at interface A, it must be destined to interface B.  While that seems logical, that is incorrect.  The ASA has a CAM table like a switch, but does not behave the same way as a switch when an entry is missing.  On a CAM miss, a switch floods the frames out all ports except the port the frame arrived on.  When the ASA has a CAM table miss, it does not flood the traffic.

 

So how does an ASA build its CAM table?  The first way is exactly the same way a switch does.  This is by recording the source MAC address from frames received.  This passive method is quite logical and makes perfect sense.  However, in the case of a CAM table miss, this passive method of learning must be augmented in a way that is more conservative than the flooding method employed by a switch.  The second way the CAM table is built in the ASA is by issuing an ARP Request using its own MAC and IP address.  The third way is in the case that the destination IP address is on a remote network is to send an ICMP echo and see what interface the response arrives on. 

 

To be completely honest I had a hard time believing this when I read it, so I decided to see for myself.  So the process is as follows.  Any frames having been received by the ASA will cause their source MAC Addresses to be recorded in the CAM table and associated with the receive port.  The aging-time defaults to 5 minutes but can be changed.  If the CAM table is complete, then there will not be a miss and no need for any active discovery by the ASA. 

 

However in the case of a CAM table miss; things work a bit differently than they do with a switch.  One of two things happens when a frame traveling through the device has a destination MAC in which the egress interface is not known.  If based on the IP Address (remember we need an IP address on a transparent ASA prior to passing IP Traffic) of the ASA and the Netmask the frame is found to be local, an ARP will be sent using the IP address and MAC of the ASA.  The interface that receives the ARP Reply is assumed to be the destination interface.   If the frame is remote based on the above criteria, an ICMP echo will be sent to the destination address and an ARP will be sent to the next hop address (again from the ASA).  The interface receiving the ICMP Echo reply will be associated as the egress interface and the CAM table will be built with the MAC address.  If there is no response received, the CAM table will not be populated.  One more note, though not documented, and ICMP Unreachable will allow the CAM table to be populated.

 

To restate, an ICMP Echo and an ARP are sent when the following conditions are met:

  1. A frame is destined to a remote network
  2. There is a route in the route table for the destination
  3. The MAC address associated with the next hop is not in the CAM table

 

When these three conditions are met, the ASA actually sends an ICMP to the destination host.  So if that IP address fails to respond, there will be communication issues until the CAM table is populated through communication with a host that does respond, or another device sending traffic through the ASA to the router (also populating the CAM table). 

 

This behavior is documented in the following location.  For the link to go to the correct location in the page, it may require you already being logged in to CCO.

 

Information About the MAC Address Table

 

The second question I posed is what type of traffic is permitted at Layer 2 by default.  In other words, what traffic do we not have to manually allow with an EtherType ACL.  The short answer is any traffic equal to or greater than 0x600.  This is documented in a excerpt at the following location

 

Allowed MAC Addresses

 

Passing Traffic Not Allowed in Routed Mode


One concern I have is that both of those seem to say that BPDU’s are supported.  However reading further, it is apparent that BPDU’s should be permitted using and EtherType ACL.  Additionally, the document below clearly states that BPDU’s are denied without an EtherType ACL.  I will confirm this behavior as well the next time I have some access to lab gear (my ASA5505 with an integrated switch might behave differently than an enterprise ASA with regards to BPDU’s).

 

Adding EtherType Access Lists

 

Now we know that the CAM table on the ASA has some interesting mechanics when it comes to learning.  Additionally, we have seen that we typically need to permit traffic with an EtherType below 0x600.  So now back to my final question…

 

When does an ASA in transparent mode drop the first packet? 

Answer:  When the CAM table is not populated

 

This behavior is documented in the URL below:

 

How Data Moves through the Transparent Firewall

 

So if you are like me and have always made an assumption that the ASA simply behaves like a bridge, that is a slightly incorrect assumption.  Although in practice, it will usually seem to behave exactly like a bridge at layer two.

 

 

If you found this document useful, please share it with your friends. 

If you have anything to add, please comment below.





Digg!Reddit!Del.icio.us!Slashdot!StumbleUpon!


Users' Comments (12)
Posted by invalidCCIE, on 21-11-2009 01:54,
wow, i am shocked! :) 
it's unbelievable. it's now even mentioned in SNAF course. 
i'll try to lab it and to publish examples and captures.
 
» Report this comment to administrator

Posted by invalidCCIE, on 21-11-2009 02:04,
i meant 'not mentioned in SNAF'. 
 
questions: 
if "destination IP address is on a remote network is to send an ICMP echo and see what interface the response arrives on". 
how this echo is sent? using asa's routing tables? and what if routing table is emty?
 
» Report this comment to administrator

Posted by Paul Stewart, on 21-11-2009 06:09,
It appears to be sent using the ASA's routing table. I experimented with it quite a bit. So if the ASA didn't have a routing table some interesting things would happen on a CAM miss. For example, if the device on the other end knew how to get to a remote network, through a router on the other side of the ASA it would not succeed until it sent some traffic to the router to force a CAM table to be populated with only ARP verification. Very strange.
 
» Report this comment to administrator

Posted by TacACK, on 21-11-2009 09:46,
Great Article Paul!  
When you mentioned this to me on twitter, i was kinda surprised over the PING's which are sent out. But i have one question. Suppose the firewall has 3 interfaces ( Inside, DMZ and Outside) and a packet arrives on the inside interface destined to a remote address for which there is no entry available in the CAM table. Will it send pings on both the dmz and outside interfaces? 
 
Regarding the BPDU's i'm confused too.  
1) Below Ethertype 0x600 nothing's permitted ( ex : CDP, IPv6 , ISIS ,etc 
2) STP BPDU's have to be explicitly permitted using ethertype ACL's
 
» Report this comment to administrator

Posted by TacACK, on 21-11-2009 09:48,
 
 
3) Multicast traffic must be EXPLICITLY permitted on both inside and outside interfaces. This takes care of routing traffic. 
 
The conflicting stuff is kinda confusing :) Must lab this. 
 
Again, great resource my friend. Definitely helpful to me :) 
 
Cheers
 
» Report this comment to administrator

Posted by TacACK, on 21-11-2009 09:52,
Sorry, forgot the mention that the above 3 points was what i found the other day when i was doing a task on this.
 
» Report this comment to administrator

Posted by Paul Stewart, on 21-11-2009 10:28,
Regarding the question on the pings. On thing is we would only have 2 interfaces since the ASA is in transparent mode. The condition is that there is a CAM table miss for the next hop MAC address. As the ASA is in transparent mode, there is only really one IP interface. At layer two, I think since the next hop is unknown that it would go out both interfaces. Once an ARP response is received and an ICMP response (echo-reply or unreachable). The source of the ARP response goes into the CAM table. I tested a lot in a LAB to understand the logic.
 
» Report this comment to administrator

Posted by TacACK, on 21-11-2009 10:35,
Geez, what was i thinking :) I totally forgot about 2 interfaces in transparent rule.  
 
And man this is kinda complex to understand. But now i think i have a fair idea how it works. 
 
Thanks for the reply Paul
 
» Report this comment to administrator

Posted by Paul Stewart, on 21-11-2009 11:27,
The ICMP Echo actually only appear to use the ip address specified in the route (i.e. route outside 0 0 x.x.x.x) command. So, again, I don't see the need for this process since the output interface could be derived this way for remote networks. Seems redundant.
 
» Report this comment to administrator

Posted by TacACK, on 21-11-2009 11:50,
Correct me if i'm wrong. There are only 2 interfaces in a transparent firewall. So packets coming from one will be destined to hosts on the other interface. This can be found out by checking the route table. 
 
If found to be true, All you need is to do a ARP lookup and get the MAC of the hosts that are directly attached to the firewall interface right?  
 
Maybe my understanding of the CAM is flawed?
 
» Report this comment to administrator

Posted by Paul Stewart, on 25-11-2009 21:36,
I don't think your understanding of the CAM table is flawed. I honestly see no benefit from the ICMP process when the mac-address of the next hop is not in the cam table. Seems to be an overcomplicated verification process that provides no *real* benefit. Good to understand though, as there are ways that it could create inconsistent resulsts.
 
» Report this comment to administrator

Posted by Barooq, on 26-11-2009 09:38,
Read about your lab attempt in IPX mailing list... 
Can't believe it...  
I am sure you will clear it quickly and easily in your next attempt. 
 
Regards 
Barooq 
http:// iptechtalk.wordpress.com
 
» Report this comment to administrator

Add your comment



mXcomment 1.0.7 © 2007-2010 - visualclinic.fr
License Creative Commons - Some rights reserved

Polls

What type of Study do you prefer?
 

Packet Bytes

Joomla Templates by Joomlashack