Firewall Filter Match Conditions and Actions (QFX10000 Switches)
Each term in a firewall filter consists of match conditions and an action. Match conditions are the fields and values that a packet must contain to be considered a match. You can define single or multiple match conditions in match statements. You can also include no match statement, in which case the term matches all packets.
When a packet matches a filter, the switch takes the action specified in the term. In addition, you can specify action modifiers to count, mirror, rate-limit, and classify packets. If no match conditions are specified for the term, the switch accepts the packet by default.
This topic describes the various match conditions, actions, and action modifiers that you can define in firewall filters on QFX10000 switches. For similar information about other QFX switches, see Firewall Filter Match Conditions and Actions (QFX and EX Series Switches).
Table 1 describes the match conditions you can specify when configuring a firewall filter. Some of the numeric range and bit-field match conditions allow you to specify a text synonym. To see a list of all the synonyms for a match condition, type
?
at the appropriate place in a statement.Table 2 shows the actions that you can specify in a term.
Table 3 shows the action modifiers you can use to count, mirror, rate-limit, and classify packets.
Match Condition |
Description |
Direction and Interface |
---|---|---|
|
IP destination address field, which is the address of the final destination node. |
Ingress IPv4 (inet) interfaces and IPv6 (inet6) interfaces. Egress IPv4 (inet) interfaces, and IPv6 (inet6) interfaces. Ingress IRB interface for EVPN/VXLAN fabric, where applicable |
|
Destination media access control (MAC) address of the packet. |
Ingress ports and VLANs. Egress ports and VLANs. |
|
TCP or UDP destination port field. Typically, you specify this match
in conjunction with the
|
Ingress ports, VLANs, IPv4 (inet) interfaces, and IPv6 (inet6) interfaces. Egress ports, VLANs, IPv4 (inet) interfaces, and IPv6 (inet6) interfaces. ingress IRB interface for EVPN/VXLAN fabric, where applicable |
|
IP destination prefix list field. You can define a list of IP address prefixes
under a prefix-list alias for frequent use. Define this list at the |
Ingress ports, VLANs, IPv4 (inet) interfaces, and IPv6 (inet6) interfaces. Egress ports, VLANs, IPv4 (inet) interfaces, and IPv6 (inet6) interfaces. |
|
Differentiated Services code point (DSCP). The DiffServ protocol uses the type-of-service (ToS) byte in the IP header. The most-significant 6 bits of this byte form the DSCP. You can specify DSCP in hexadecimal, binary, or decimal form. In place of the numeric value, you can specify one of the following text synonyms (the field values are also listed):
|
Ingress ports, VLANs, and IPv4 (inet) interfaces. Egress ports, VLANs, and IPv4 (inet) interfaces. |
|
Ethernet type field of a packet. The EtherType value specifies what protocol is being transported in the Ethernet frame. In place of the numeric value, you can specify one of the following text synonyms (the field values are also listed):
|
Ingress ports and VLANs. Egress ports and VLANs. |
|
Classify the packet in one of the following default forwarding classes, or in a user-defined forwarding class:
|
Egress IPv4 (inet) and IPv6 (inet6) interfaces. |
|
IP fragmentation flags. In place of the numeric value, you can specify one of the following text synonyms (the hexadecimal values are also listed):
|
Ingress ports, VLANs, and IPv4 (inet) interfaces. |
|
Match the specified hop limit or set of hop limits. Specify a single value or a range of values from 0 through 255. |
Ingress and egress IPv6 (inet6) interfaces. |
|
ICMP code field. Because the meaning of the value depends upon the associated
|
Ingress ports, VLANs, IPv4 (inet) interfaces, and IPv6 (inet6) interfaces. Egress ports, VLANs, IPv4 (inet) interfaces, and IPv6 (inet6) interfaces |
|
ICMP message type field. Typically, you specify this match in conjunction with
the IPv4: IPv6: See also |
Ingress ports, VLANs, IPv4 (inet) interfaces, and IPv6 (inet6) interfaces. Egress ports, VLANs, IPv4 (inet) interfaces, and IPv6 (inet6) interfaces. |
|
Interface on which the packet is received, including the logical unit. You can
include the wildcard character ( Note:
An interface from which a packet is sent cannot be used as a match condition. |
Ingress ports, VLANs, IPv4 (inet) interfaces, and IPv6 (inet6) interfaces. Egress IPv4 (inet) interfaces and IPv6 (inet6) interfaces. |
|
IPv4 address that is the final destination node address for the packet. |
Ingress ports, egress ports, and VLANs. Ingress IRB interface for EVPN/VXLAN fabric, where applicable |
|
Specify |
Ingress ports, VLANs, and IPv4 (inet) interfaces. |
|
IP precedence field. In place of the numeric field value, you can specify one
of the following text synonyms (the field values are also listed): |
Ingress ports and VLANs. Egress ports and VLANs. |
|
IP protocol field. |
Ingress ports and VLANs. Egress ports and VLANs. Ingress IRB interface for EVPN/VXLAN fabric, where applicable |
|
IPv4 address of the source node sending the packet. |
Ingress ports and VLANs. Egress ports and VLANs. Ingress IRB interface for EVPN/VXLAN fabric, where applicable |
|
IP version of the packet. Use this condition to match IPv4 or IPv6 header fields in traffic that arrives on a Layer 2 port or VLAN interface. |
Ingress ports and VLANs. Egress ports and VLANs. |
|
Using this condition causes a match if the More Fragments flag is enabled in the IP header or if the fragment offset is not zero. |
Ingress ports, VLANs, and IPv4 (inet) interfaces. Egress IPv4 (inet) interfaces. |
|
Matches the specified IEEE 802.1p VLAN priority bits in the range |
Ingress ports and VLANs. Egress ports and VLANs. |
|
Matches the ID of a normal VLAN or the ID of the outer (service) VLAN (for Q-in-Q
VLANs). To use filter memory most efficiently and maximize the number of possible filters,
use this condition in addition to |
Ingress ports and VLANs. Egress ports and VLANs. Ingress IRB interface for EVPN/VXLAN fabric, where applicable |
|
Set the packet loss priority (PLP). Note:
The |
Egress IPv4 (inet) and IPv6 (inet6) interfaces. |
|
IPv4 or IPv6 protocol value. In place of the numeric value, you can specify one of the following text synonyms (the numeric values are also listed):
|
Ingress IPv6 (inet6) interfaces. Egress IPv6 (inet6) interfaces. |
|
Packet length in bytes. You must enter a number between 0 and 65535. |
Ingress ports, VLANs, IPv4 (inet), and IPv6 (inet6) interfaces. Egress IPv4 (inet) interfaces. |
|
IP precedence bits in the type-of-service (ToS) byte in the IP header. (This byte can also used for the DiffServ DSCP.) In place of the numeric value, you can specify one of the following text synonyms (the numeric values are also listed):
|
Ingress IPv4 (inet) interfaces. Egress IPv4 (inet) interfaces. |
|
IPv4 or IPv6 protocol value. In place of the numeric value, you can specify one of the following text synonyms (the numeric values are also listed):
|
Ingress IPv4 (inet) interfaces. Egress IPv4 (inet) interfaces. |
|
IP source address field, which is the address of the node that sent the packet. |
Ingress IPv4 (inet) interfaces and IPv6 (inet6) interfaces. Egress IPv4 (inet) interfaces and IPv6 (inet6) interfaces. Ingress IRB interface for EVPN/VXLAN fabric, where applicable |
|
Source media access control (MAC) address of the packet. |
Ingress ports and VLANs. Egress ports and VLANs. |
|
TCP or UDP source port. Typically, you specify this match in conjunction with
the |
Ingress ports, VLANs, IPv4 (inet) interfaces, and IPv6 (inet6) interfaces. Egress ports, VLANs, IPv4 (inet) interfaces, and IPv6 (inet6) interfaces. Ingress IRB interface for EVPN/VXLAN fabric, where applicable |
|
IP source prefix list. You can define a list of IP address prefixes under a prefix-list
alias for frequent use. Define this list at the |
Ingress ports, VLANs, IPv4 (inet) interfaces, and IPv6 (inet6) interfaces. Egress ports, VLANs, IPv4 (inet) interfaces, and IPv6 (inet6) interfaces. |
|
Match packets of an established TCP connection. This condition matches packets other than those used to set up a TCP connection—that is, three-way handshake packets are not matched. When you specify |
Ingress ports, VLANs, IPv4 (inet) interfaces, and IPv6 (inet6) interfaces. Egress IPv4 (inet) interfaces. |
|
One or more TCP flags:
|
Ingress ports, VLANs, IPv4 (inet) interfaces, and IPv6 (inet6) interfaces. Egress IPv4 (inet) interfaces. |
|
Match the first TCP packet of a connection. A match occurs when the TCP flag When you specify |
Ingress ports, VLANs, IPv4 (inet) interfaces, and IPv6 (inet6) interfaces. Egress IPv4 (inet) interfaces. |
|
8-bit field that specifies the class-of-service (CoS) priority of the packet. The traffic-class field is used to specify a DiffServ code point (DSCP) value. This field was previously used as the type-of-service (ToS) field in IPv4, and, the semantics of this field (for example, DSCP) are identical to those of IPv4. You can specify one of the following text synonyms (the field values are also listed):
|
Ingress IPv6 (inet6) interfaces. Egress IPv6 (inet6) interfaces. |
|
IP Time-to-live (TTL) field in decimal. The value can be 1-255. |
Ingress IPv4 (inet) interfaces. Egress IPv4 (inet) interfaces. Ingress IRB interface for EVPN/VXLAN fabric, where applicable |
|
Matches the ID of the inner (customer) VLAN in a Q-in-Q VLAN. To use filter memory
most efficiently and maximize the number of possible filters, use in combination with |
Ingress ports and VLANs. Egress ports and VLANs. |
Use then
statements to define actions that should occur if a packet matches
all conditions in a from
statement. Table 2 shows
the actions that you can specify in a term. (If you do not include a then
statement,
the system accepts packets that match the filter.)
Action |
Description |
---|---|
|
Accept a packet. This is the default action for packets that match a term. |
|
Discard a packet silently without sending an Internet Control Message Protocol (ICMP) message. |
|
Discard a packet and send a “destination unreachable” ICMPv4 message
(type 3). To log rejected packets, configure the You can specify one of the following message types: If you specify If you do not specify a message type, the ICMP notification “destination unreachable” is sent with the default message “communication administratively filtered.” Note:
The |
|
Forward matched packets to a virtual routing instance. (The only supported instance
type is |
|
Forward matched packets to a specific VLAN. Note:
The Note:
This action is not supported on OCX series switches. |
You can also specify the action modifiers listed in Table 3 to count, mirror, rate-limit, and classify packets.
Action Modifier |
Description |
---|---|
|
Count the number of packets that match the term. |
|
Classify the packet in one of the following default forwarding classes, or in a user-defined forwarding class:
Note:
To configure a forwarding class, you must also configure loss priority. |
|
Log the packet's header information in the Routing Engine. To view this information,
enter the Note:
The |
|
Set the packet loss priority (PLP). Note:
The Note:
The |
|
Send packets to a policer (for the purpose of applying rate limiting). You can specify a policer for ingress and egress port, VLAN, IPv4 (inet), and IPv6 (inet6) firewall filters. Note:
The |
|
(ELS platforms) Mirror traffic (copy packets) to an output interface configured
in a port-mirroring instance at the You can specify port mirroring for ingress and egress port, VLAN, IPv4 (inet), and IPv6 (inet6) firewall filters. |
|
(ELS platforms) Mirror traffic to a port-mirroring instance configured at the You can specify port mirroring for ingress and egress port, VLAN, IPv4 (inet), and IPv6 (inet6) firewall filters. Note:
|
|
Log an alert for this packet. Note:
The |
|
Send packets to a three-color policer (for the purpose of applying rate limiting). You can specify a three-color policer for ingress and egress port, VLAN, IPv4 (inet), and IPv6 (inet6) filters. Note:
The |