This section contains the following topics:
A stateless firewall filter can filter packets transiting the device from a source to a destination, or packets originating from, or destined for, the Routing Engine. Stateless firewall filters applied to the Routing Engine interface protect the processes and resources owned by the Routing Engine.
You can apply a stateless firewall filter to an input or output interface, or to both. Every packet, including fragmented packets, is evaluated against stateless firewall filters.
All stateless firewall filters contain one or more terms, and each term consists of two components—match conditions and actions. The match conditions define the values or fields that the packet must contain to be considered a match. If a packet is a match, the corresponding action is taken. By default, a packet that does not match a firewall filter is discarded.
![]() |
Note: A firewall filter with a large number of terms can adversely affect both the configuration commit time and the performance of the Routing Engine. |
You can configure a stateless firewall filter within the term of another filter. This method enables you to add common terms to multiple filters without having to modify all filter definitions. You can configure one filter with the desired common terms, and configure this filter as a term in other filters. Consequently, to make a change in these common terms, you need to modify only one filter that contains the common terms, instead of multiple filters. For more information about how to configure a filter within a filter, see the JUNOS Policy Framework Configuration Guide.
Before creating a stateless firewall filter and applying it to an interface, determine what you want the firewall filter to accomplish and how to use its match conditions and actions to achieve your goal. Also, make sure you understand how packets are matched and the default action of the resulting firewall filter.
![]() |
Caution: If a packet does not match any terms in a stateless firewall filter rule, the packet is discarded. Take care that you do not configure a firewall filter that prevents you from accessing the device after you commit the configuration. For example, if you configure a firewall filter that does not match HTTP or HTTPS packets, you cannot access the device with the J-Web interface. |
To configure a stateless firewall filter, determine the following:
For more information about what a stateless firewall filter can include, see Stateless Firewall Filter Match Conditions. For more information about stateless firewall filters, see the JUNOS Policy Framework Configuration Guide.
Table 227 lists the match conditions you can specify in stateless firewall filter terms. Some of the numeric range and bit-field match conditions allow you to specify a text synonym. For a complete list of the synonyms, do any of the following:
To specify a bit-field match condition with values, such as tcp-flags, you must enclose the values in quotation marks (“ “). You can use bit-field logical operators to create expressions that are evaluated for matches. For example, if the following expression is used in a filter term, a match occurs if the packet is the initial packet of a TCP session:
Table 228 lists the bit-field logical operators in order of highest to lowest precedence.
You can use text synonyms to specify some common bit-field matches. In the previous example, you can specify tcp-initial to specify the same match condition.
![]() |
Note: When the device compares the stateless firewall filter match conditions to a packet, it compares only the header fields specified in the match condition. There is no implied protocol match. For example, if you specify a match of destination-port ssh, the device checks for a value of 0x22 in the 2-byte field that is two bytes after the IP packet header. The protocol field of the packet is not checked. |
Table 227: Stateless Firewall Filter Match Conditions
Table 228: Stateless Firewall Filter Bit-Field Logical Operators
Logical Operator |
Description |
|---|---|
(...) |
Grouping |
! |
Negation |
& or + |
Logical AND |
| or , |
Logical OR |
Table 229 lists the actions and action modifiers you can specify in stateless firewall filter terms.
Table 229: Stateless Firewall Filter Actions and Action Modifiers