Related Documentation
- EX, J, M, MX, PTX, SRX, T Series
- Understanding How to Use Standard Firewall Filters
- Example: Configuring a Stateless Firewall Filter to Accept Traffic from Trusted Sources
- EX, M, MX, T Series
- Example: Configuring a Filter to Block Telnet and SSH Access
- EX, M, MX, PTX, T Series
- Example: Configuring a Filter to Block TFTP Access
- Example: Configuring a Filter to Accept DHCP Packets Based on Address
Example: Configuring a Filter to Accept OSPF Packets from a Prefix
This example shows how to configure a standard stateless firewall filter to accept packets from a trusted source.
Requirements
No special configuration beyond device initialization is required before configuring this example.
Overview
In this example, you create a filter that accepts only OSPF packets from an address in the prefix 10.108.0.0/16, discarding all other packets with an administratively-prohibited ICMP message
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.
To configure this example, perform the following tasks:
- Configure the Stateless Firewall Filter
- Apply the Firewall Filter to the Loopback Interface
- Confirm and Commit Your Candidate Configuration
CLI Quick Configuration
To quickly configure this example, copy the following configuration 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 ospf_filter:
Create the filter.
[edit]user@host# edit firewall family inet filter ospf_filterConfigure the term that accepts packets.
[edit firewall family inet filter ospf_filter]user@host# set term term1 from source-address 10.108.0.0/16 user@host# set term term1 from protocol ospf user@host# set term term1 then acceptConfigure the term that rejects all other packets.
[edit firewall family inet filter ospf_filter]user@host# set term default_term then reject administratively-prohibited
Apply the Firewall Filter to the Loopback Interface
Step-by-Step Procedure
To apply the firewall filter to the loopback interface:
Configure the interface.
[edit]user@host# edit interfaces ge-0/0/1 unit 0 family inetConfigure the logical interface IP address.
[edit interfaces ge-0/0/1 unit 0 family inet]user@host# set address 10.1.2.3/30Apply the filter to the input.
[edit interfaces ge-0/0/1 unit 0 family inet]user@host# set filter input ospf_filter
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 firewallfamily inet {filter ospf_filter {term term1 {from {source-address {10.108.0.0/16;}protocol ospf;}then {accept;}}term default_term {then {reject administratively-prohibited; # default reject action}}}}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 interfaceslo0 {unit 0 {family inet {filter {input ospf_filter;}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 firewall filter ospf_filter operational mode command.
Related Documentation
- EX, J, M, MX, PTX, SRX, T Series
- Understanding How to Use Standard Firewall Filters
- Example: Configuring a Stateless Firewall Filter to Accept Traffic from Trusted Sources
- EX, M, MX, T Series
- Example: Configuring a Filter to Block Telnet and SSH Access
- EX, M, MX, PTX, T Series
- Example: Configuring a Filter to Block TFTP Access
- Example: Configuring a Filter to Accept DHCP Packets Based on Address
Published: 2013-04-10
Related Documentation
- EX, J, M, MX, PTX, SRX, T Series
- Understanding How to Use Standard Firewall Filters
- Example: Configuring a Stateless Firewall Filter to Accept Traffic from Trusted Sources
- EX, M, MX, T Series
- Example: Configuring a Filter to Block Telnet and SSH Access
- EX, M, MX, PTX, T Series
- Example: Configuring a Filter to Block TFTP Access
- Example: Configuring a Filter to Accept DHCP Packets Based on Address