Related Documentation
- EX, J, M, MX, PTX, SRX, T Series
- Understanding How to Use Standard Firewall Filters
- EX, M, MX, T Series
- Filtering Packets Received on an Interface Set Overview
- Statement Hierarchy for Defining an Interface Set
- Statement Hierarchy for Configuring a Filter to Match on an Interface Set
- EX, M, MX, PTX, T Series
- Example: Filtering Packets Received on an Interface Set
Example: Configuring a Rate-Limiting Filter Based on Destination Class
This example shows how to configure a rate-limiting stateless firewall filter.
Requirements
No special configuration beyond device initialization is required before configuring this example.
Before you begin, configure the destination class class1.
Overview
In this example, you use a stateless firewall filter to set rate limits based on a destination class.
To activate a policer from within a stateless firewall filter configuration:
- Create a template for the policer by including the policer policer-name statement.
- Reference the policer in a filter term that specifies the policer in the policer policer-name nonterminating action.
You can also activate a policer by including the policer (input | output) policer-template-name statement at a logical interface.
Configuration
The following example requires you to navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode.
- Configure the Stateless Firewall Filter
- Apply the Stateless Firewall Filter to a Logical Interface
- Confirm and Commit Your Candidate Configuration
CLI Quick Configuration
To quickly configure this example, copy the following commands into a text file, remove any line breaks, and then paste the commands into the CLI at the [edit] hierarchy level.
Configure the Stateless Firewall Filter
Step-by-Step Procedure
To configure the stateless firewall filter rl_dclass1 with policer police_class1 for destination class class1:
Create the stateless firewall filter rl_dclass1.
[edit]user@host# edit firewall filter rl_dclass1Configure the policer template police_class1.
[edit firewall filter rl_dclass1]user@host# set policer police_class1 if-exceeding bandwidth-limit 25user@host# set policer police_class1 if-exceeding burst-size-limit 1000user@host# set policer police_class1 then discardConfigure a filter term that uses policer police_class1 to rate-limit traffic for destination class class1.
[edit firewall filter rl_dclass1]user@host# set term term1 from destination-class class1user@host# set term term1 then policer police_class1
Apply the Stateless Firewall Filter to a Logical Interface
Step-by-Step Procedure
To apply the filter rl_dclass1 to a logical interface:
Configure the logical interface to which you will apply the stateless firewall filter.
[edit]user@host# edit interfaces ge-0/0/1 unit 0 family inetConfigure the interface address for the logical interface.
[edit interfaces ge-0/0/1 unit 0 family inet]user@host# set address 10.1.2.3/30Apply the stateless firewall filter to the logical interface.
[edit interfaces ge-0/0/1 unit 0 family inet]user@host# set filter input rl_dclass1
Confirm and Commit Your Candidate Configuration
Step-by-Step Procedure
To confirm and then commit your candidate configuration:
Confirm the configuration of the stateless firewall filter by entering the show firewall configuration mode command. If the command output does not display the intended configuration, repeat the instructions in this example to correct the configuration.
[edit]user@host# show firewallfilter rl_dclass1 {policer police_class1 {if-exceeding {bandwidth-limit 25;burst-size-limit 1000;}then {discard;}}term term1 {from {destination-class class1;}then {policer police_class1;}}}Confirm the configuration of the interface by entering the show interfaces configuration mode command. If the command output does not display the intended configuration, repeat the instructions in this example to correct the configuration.
[edit]user@host# show interfacesge-0/0/1 {unit 0 {family inet {filter {input rl_dclass1;}address 10.1.2.3/30;}}}If you are done configuring the device, commit your candidate configuration.
[edit]user@host# commit
Verification
To confirm that the configuration is working properly, enter the show class-of-service ge-0/0/1 operational mode command.
Related Documentation
- EX, J, M, MX, PTX, SRX, T Series
- Understanding How to Use Standard Firewall Filters
- EX, M, MX, T Series
- Filtering Packets Received on an Interface Set Overview
- Statement Hierarchy for Defining an Interface Set
- Statement Hierarchy for Configuring a Filter to Match on an Interface Set
- EX, M, MX, PTX, T Series
- Example: Filtering Packets Received on an Interface Set
Published: 2013-04-10
Related Documentation
- EX, J, M, MX, PTX, SRX, T Series
- Understanding How to Use Standard Firewall Filters
- EX, M, MX, T Series
- Filtering Packets Received on an Interface Set Overview
- Statement Hierarchy for Defining an Interface Set
- Statement Hierarchy for Configuring a Filter to Match on an Interface Set
- EX, M, MX, PTX, T Series
- Example: Filtering Packets Received on an Interface Set