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 OSPF Packets from a Prefix
Example: Configuring a Filter to Accept DHCP Packets Based on Address
This example shows how to configure a standard stateless firewall filter to accept packets from a trusted source.
Requirements
This example is supported only on MX Series routers and EX Series switches.
Overview
In this example, you create a filter (rpf_dhcp) that accepts DHCP packets with a source address of 0.0.0.0 and a destination address of 255.255.255.255.
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 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:
Create the stateless firewall filter rpf_dhcp.
[edit]user@host# edit firewall family inet filter rpf_dhcpConfigure the term to match packets with a source address of 0.0.0.0 and a destination address of 255.255.255.255.
[edit firewall family inet filter rpf_dhcp]user@host# set term dhcp_term from source-address 0.0.0.0/32 user@host# set term dhcp_term from destination-address 255.255.255.255/32Configure the term to accept packets that match the specified conditions.
[edit firewall family inet filter rpf_dhcp]set term dhcp_term then accept
Apply the Firewall Filter to the Loopback Interface
Step-by-Step Procedure
To apply the filter to the input at the loopback interface:
Apply the rpf_dhcp filter if packets are not arriving on an expected path.
[edit]user@host# set interfaces lo0 unit 0 family inet rpf-check fail-filter rpf_dhcpConfigure an address for the loopback interface.
[edit]user@host# set interfaces lo0 unit 0 family inet address 127.0.0.1/32
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 rpf_dhcp {term dhcp_term {from {source-address {0.0.0.0/32;}destination-address {255.255.255.255/32;}}then accept;}}}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 {rpf-check {fail-filter rpf_dhcp;mode loose;}}address 127.0.0.1/32;}}}When 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 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 OSPF Packets from a Prefix
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 OSPF Packets from a Prefix