Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    Example: Configuring a Filter to Accept Packets Based on IPv6 TCP Flags

    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 packets with specific IPv6 TCP flags.

    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.

    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.

    set firewall family inet6 filter tcp_filter term 1 from next-header tcpset firewall family inet6 filter tcp_filter term 1 from tcp-flags synset firewall family inet6 filter tcp_filter term 1 then count tcp_syn_pktset firewall family inet6 filter tcp_filter term 1 then logset firewall family inet6 filter tcp_filter term 1 then acceptset interfaces lo0 unit 0 family inet6 filter input tcp_filterset interfaces lo0 unit 0 family inet6 address ::10.34.1.0/120

    Configure the Stateless Firewall Filter

    Step-by-Step Procedure

    To configure the firewall filter

    1. Create the IPv6 stateless firewall filter tcp_filter.

      [edit]user@host# edit firewall family inet6 filter tcp_filter
    2. Specify that a packet matches if it is the initial packet in a TCP session and the next header after the IPv6 header is type TCP.

      [edit firewall family inet6 filter tcp_filter]user@host# set term 1 from next-header tcpuser@host# set term 1 from tcp-flags syn
    3. Specify that matched packets are counted, logged to the buffer on the Packet Forwarding Engine, and accepted.

      [edit firewall family inet6 filter tcp_filter]user@host# set term 1 then count tcp_syn_pktuser@host# set term 1 then loguser@host# set term 1 then accept

    Apply the Firewall Filter to the Loopback Interface

    Step-by-Step Procedure

    To apply the firewall filter to the loopback interface:

    • [edit]user@host# set interfaces lo0 unit 0 family inet6 filter input tcp_filteruser@host# set interfaces lo0 unit 0 family inet6 address ::10.34.1.0/120

    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.

      [edit]user@host# show firewall
      family inet6 {filter tcp_filter {term 1 {from {next-header tcp;tcp-flags syn;}then {count tcp_syn_pkt;log;accept;}}}}
    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.

      [edit]user@host# show interfaces
      lo0 {unit 0 {family inet6 {filter {input tcp_filter;}address ::10.34.1.0/120;}}}
    3. 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.

    Published: 2013-08-28