Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

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 Use the CLI Editor in Configuration Mode.

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:

  1. Create the stateless firewall filter rpf_dhcp.

  2. Configure the term to match packets with a source address of 0.0.0.0 and a destination address of 255.255.255.255.

  3. Configure the term to accept packets that match the specified conditions.

Apply the Firewall Filter to the Loopback Interface

Step-by-Step Procedure

To apply the filter to the input at the loopback interface:

  1. Apply the rpf_dhcp filter if packets are not arriving on an expected path.

  2. Configure an address for the loopback interface.

Confirm and Commit Your Candidate Configuration

Step-by-Step Procedure

To confirm and then commit your candidate configuration:

  1. 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.

  2. 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.

  3. When you are done configuring the device, commit your candidate configuration.

Verification

To confirm that the configuration is working properly, enter the show firewall operational mode command.