How Firewall Filters Are Evaluated
When a firewall filter consists of a single term, the filter is evaluated as follows:
- If the packet matches all the conditions, the action in the
thenstatement is taken.- If the packet matches all the conditions, and if there is no action specified in the
thenstatement, the default actionacceptis used.- If the packet does not match all the conditions, it is discarded.
When a firewall filter consists of more than one term, the filter is evaluated sequentially:
- The packet is evaluated against the conditions in the
fromstatement in the first term.- If the packet matches, the action in the
thenstatement is taken and, if thenext termaction is not used, the evaluation ends. Subsequent terms in the filter are not evaluated.- If the packet matches, the action in the
thenstatement is taken; if thenext termaction is present, the evaluation continues to the next term.- If the packet does not match, it is evaluated against the conditions in the
fromstatement in the second term.This process continues until either the packet matches the
fromconditions in one of the subsequent terms or there are no more terms.
- If a packet passes through all the terms in the filter without matching any of them, it is discarded.
If a term does not contain a
fromstatement, the packet is considered to match and the action in the term'sthenstatement is taken.If a term does not contain a
thenstatement or if you do not configure an action in thethenstatement, and if the packet matches the conditions in the term'sfromstatement, the packet is accepted.Each firewall filter has an implicit discard action at the end of the filter, which is equivalent to the following explicit filter term:
term implicit-rule {then discard;}Therefore, if a packet matches none of the terms in the filter, it is discarded.