4.2. Configuring Filter Policies with CLI

This section provides information to configure filter policies using the command line interface.

4.2.1. Common Configuration Tasks

This section provides a brief overview of the tasks that must be performed for all IPv4, IPv6, and MAC filter configurations and provides the CLI commands.

4.2.1.1. Creating an IPv4 Filter Policy

A filter policy has the following attributes:

  1. Policy ID and policy name
  2. Scope: template, exclusive, embedded, system
  3. Type: normal, src-mac, packet-length
  4. One or more filter entries defining match criteria and action
  5. Default action to define how packets that do not match any of the filter entries are handled

Use the following CLI syntax to create a template IPv4 filter policy:

CLI Syntax:
config>filter# ip-filter filter-id [create]
description description-string
scope {exclusive | template | embedded | system}
default-action {drop | forward}

4.2.1.1.1. IPv4 Filter Entry

Within a filter policy, configure filter entries which contain criteria against which ingress, egress traffic is matched. The action specified in the entry determine how the packets are handled, such as drop or forward.

  1. Enter a filter entry ID.
  2. Configure the filter action.
  3. Configure the filter matching criteria.

The following displays an IPv4 filter entry configuration example:

A:ALA-7>config>filter>ip-filter# info
----------------------------------------------
            description "filter-main"
            scope exclusive
            entry 10 create
                description "no-91"
                match
                    dst-ip 10.10.10.91/24
                    src-ip 10.10.0.100/24
                exit
                action drop
            exit
----------------------------------------------
A:ALA-7>config>filter>ip-filter#

4.2.1.1.1.1. Cflowd Filter Sampling

Within a filter entry, you can specify that traffic matching the associated IPv4 filter entry is sampled if the IPv4 interface is set to cflowd acl mode. Enabling filter-sample enables the cflowd tool.

The following displays an IPv4 filter entry configuration example:

A:ALA-7>config>filter>ip-filter# info
----------------------------------------------
            description "filter-main"
            scope exclusive
            entry 10 create
                description "no-91"
                filter-sample
                interface-disable-sample
                match
                exit
                action forward redirect-policy redirect1
            exit
----------------------------------------------
A:ALA-7>config>filter>ip-filter#
 

Within a filter entry, you can also specify that traffic matching the associated IPv4 filter entry is not sampled by cflowd if the IPv4 interface is set to cflowd interface mode. The following displays an IPv4 filter entry configuration example:

A:ALA-7>config>filter>ip-filter# info
----------------------------------------------
            description "filter-main"
            scope exclusive
            entry 10 create
                description "no-91"
                no filter-sample
                no interface-disable-sample
                match
                exit
                action forward redirect-policy redirect1
            exit
----------------------------------------------
A:ALA-7>config>filter>ip-filter#
 

4.2.1.2. Creating an IPv6 Filter Policy

IPv6 filter policy configuration mimics IP filter policy configuration. See Creating an IPv4 Filter Policy.

4.2.1.3. Creating a MAC Filter Policy

Each filter policy must have the following:

  1. The filter policy type specified (MAC normal, MAC isid, MAC vid)
  2. A filter policy ID
  3. A default action, either drop or forward
  4. Filter policy scope, either exclusive or template
  5. At least one filter entry, with a match criterion defined

4.2.1.3.1. MAC Filter Policy

The following example shows a MAC filter policy configuration:

A:ALA-7>config>filter# info
----------------------------------------------
...
        mac-filter 90 create
            description "filter-west"
            scope exclusive
            type normal
        exit
----------------------------------------------
A:ALA-7>config>filter#

4.2.1.3.2. MAC ISID Filter Policy

The following example shows an ISID filter policy configuration:

A;ALA-7>config>filter# info
----------------------------------------------
mac-filter 90 create
     description "filter-wan-man"
     scope template
     type isid
     entry 1 create
          description "drop-local-isids"
          match
               isid 100 to 1000
          exit
          action drop
     exit
     entry 2 create
          description "allow-wan-isids"
          match
               isid 150
          exit
          action forward
     exit

4.2.1.3.3. MAC VID Filter Policy

The following example shows a VID filter policy configuration:

A:TOP_NODE>config>filter>mac-filter# info
----------------------------------------------
      default-action forward
      type vic
      entry 1 create
         match frame-type ethernet_II
           ouiter-tag 85 4095
         exit
         action drop
      exit
      entry 2 create
         match frame-type ethernet_II
           ouiter-tag 43 4095
         exit
         action drop
      exit       
----------------------------------------------
A:TOP_NODE>config>filter>mac-filter#

4.2.1.3.4. MAC Filter Entry

Within a filter policy, configure filter entries that contain criteria against which ingress, egress, or network traffic is matched. The action specified in the entry determines how the packets are handled, such as dropping or forwarding.

  1. Enter a filter entry ID. The system does not dynamically assign a value.
  2. Assign an action.
  3. Specify matching criteria.

The following displays a MAC filter entry configuration example:

A:sim1>config>filter# info
----------------------------------------------
        mac-filter 90 create
            entry 1 create
                description "allow-104" 
                match 
                exit 
                action drop
            exit 
        exit 
----------------------------------------------
A:sim1>config>filter# 

4.2.1.4. Creating an IPv4 Exception Filter Policy

Configuring and applying IPv4 exception filter policies is optional. Each exception filter policy must have the following:

  1. an exception filter policy ID
  2. scope specified, either exclusive or template
  3. at least one filter entry with matching criteria specified

4.2.1.4.1. IP Exception Filter Policy

Use the following CLI syntax to create an IP exception filter policy:

CLI Syntax:
config>filter# ip-exception filter-id [create]
description description-string
scope {exclusive | template}
Example:
config>filter# ip-exception 1 create
config>filter>ip-except# description "IP-exception"
config>filter>ip-except# scope template

The following example displays a template IP exception filter policy configuration.

A:domain1>config>filter# info
----------------------------------------------
...
        ip-exception 1 create
            description "IP-exception"
            scope template
        exit
...
----------------------------------------------
A:domain1>config>filter#

4.2.1.4.2. IP Exception Entry Matching Criteria

Within an exception filter policy, configure exception entries that contain criteria against which ingress, egress, and network traffic is matched. Packets that match the entry criteria are allowed to transit the NGE domain in clear text.

  1. Enter an exception filter entry ID. The system does not dynamically assign a value.
  2. Specify matching criteria.

Use the following CLI syntax to configure IP exception filter matching criteria:

CLI Syntax:
config>filter# ip-exception filter-id
entry entry-id [create]
description description-string
match
dst-ip {ip-address/mask | ip-address ipv4-address-mask}
dst-port {lt | gt | eq} dst-port-number
dst-port range dst-port-number dst-port-number
icmp-code icmp-code
icmp-type icmp-type
src-ip {ip-address/mask | ip-address ipv4-address-mask}
src-port {lt | gt | eq} src-port-number
src-port range src-port-number src-port-number
Example:
config>filter>ip-except# entry 1 create
config>filter>ip-except>entry# match
config>filter>ip-except>entry>match# src-ip 10.10.10.10/32
config>filter>ip-except>entry>match# dst-ip 10.10.10.91/24
config>filter>ip-except>entry>match# exit

The following example displays a matching configuration.

A:domain1>config>filter>ip-exception# info
----------------------------------------------
            description "exception-main"
            scope exclusive
            entry 1
                match
                    dst-ip 10.10.10.91/24
                    src-ip 10.10.10.10/32
                exit
            exit
----------------------------------------------
A:domain1>config>filter>ip-except#

4.2.1.5. Creating an IPv6 Exception Filter Policy

Configuring and applying IPv6 exception filter policies is optional. Each exception filter policy must have the following:

  1. an exception filter policy ID
  2. at least one filter entry with matching criteria specified

4.2.1.5.1. IPv6 Exception Filter Policy

Use the following CLI syntax to create an IPv6 exception filter policy:

Note:

In the ipv6-exception command, exception-id is equivalent to the ip-exception variable filter-id.

CLI Syntax:
config>filter# ipv6-exception exception-id [create]
description description-string
Example:
config>filter# ipv6-exception 1 create
config>filter>ipv6-except# description "IPv6-exception"

The following example displays a template IPv6 exception filter policy configuration.

A:domain1>config>filter# info
----------------------------------------------
...
        ipv6-exception 1 create
            description "IPv6-exception"
        exit
...
----------------------------------------------
A:domain1>config>filter#

4.2.1.5.2. IPv6 Exception Entry Matching Criteria

Within an exception filter policy, configure exception entries that contain criteria against which ingress and network traffic is matched. Packets that match the entry criteria are allowed to transit the IPsec domain in clear text.

  1. Enter an exception filter entry ID. The system does not dynamically assign a value.
  2. Specify matching criteria.

Use the following CLI syntax to configure IPv6 exception filter matching criteria:

CLI Syntax:
config>filter# ipv6-exception exception-id
entry entry-id [create]
description description-string
match
dst-ip {ipv6-address/prefix-length | ipv6-address | ipv6-prefix-list prefix-list-name}
dst-port {lt | gt | eq} dst-port-number
dst-port range dst-port-number dst-port-number
icmp-code icmp-code
icmp-type icmp-type
src-ip {ipv6-address/prefix-length | ipv6-address | ipv6-prefix-list prefix-list-name}
src-port {lt | gt | eq} src-port-number
src-port range src-port-number src-port-number
Example:
config>filter>ipv6-except# entry 1 create
config>filter>ipv6-except>entry# match
config>filter>ipv6-except>entry>match# src-ip 2001:db8::1/128
config>filter>ipv6-except>entry>match# dst-ip 2001:db8::2/128
config>filter>ipv6-except>entry>match# exit

The following example displays a matching configuration.

A:domain1>config>filter>ipv6-exception# info
----------------------------------------------
            description "exception-main"
            entry 1
                match
                    dst-ip 2001:db8::1/128
                    src-ip 2001:db8::2/128
                exit
            exit
----------------------------------------------
A:domain1>config>filter>ipv6-except#

4.2.1.6. Creating a Match List for Filter Policies

To create a match list you must:

  1. Specify a type of a match list (for example, an IPv4 address prefix list).
  2. Define a unique match list name (for example, an IPv4-Deny-List).
  3. Specify at least one entry in the list (for example, a valid IPv4 prefix).

The following example shows an IPv4 prefix list configuration and its usage in an IPv4 filter policy:

*A:ala-48>config>filter# info
----------------------------------------------
      match-list
        ip-prefix-list "IPv4-Deny-List"
           description "IPv4 deny-list"
           prefix 10.0.0.0/21
           prefix 10.254.0.0/24
        exit
     exit
     ip-filter 10 name "ip-edge-filter"
        scope template
        entry 10
           match
              src-ip ip-prefix-list IPv4-Deny-List
           exit
           action drop
        exit
      exit
---------------------------------------------

4.2.1.7. Applying Filter Policies

Filter policies can be associated with the entities listed in Table 10.

Table 10:  Applying Filter Policies 

IPv4 and IPv6 Filter Policies

MAC Filter Policies

Epipe SAP, spoke SDP

Epipe SAP, spoke SDP

Fpipe SAP, spoke SDP

IES interface SAP, spoke SDP, R-VPLS

Ipipe SAP, spoke SDP

VPLS mesh SDP, spoke SDP, SAP

VPLS mesh SDP, spoke SDP, SAP

VPRN interface SAP, spoke SDP, R-VPLS, network ingress

Network interface

4.2.1.7.1. Applying IPv4/IPv6 and MAC Filter Policies to a Service

IP and MAC filter policies are applied by associating them with a SAP and/or spoke-sdp in ingress and/or egress direction as needed. Filter ID is used to associate an existing filter policy, or if defined, a Filter Name for that filter policy can be used in the CLI.

The following output displays IP and MAC filters assigned to an ingress and egress SAP and spoke SDP:

A:ALA-48>config>service>epipe# info
----------------------------------------------
            sap 1/1/1.1.1 create
                ingress
                    filter ip 10
                exit
                egress
                    filter mac 92
                exit
            exit
            spoke-sdp 8:8 create
                ingress
                    filter ip “epipe sap default filter”
                exit
                egress
                    filter mac 91
                exit
            exit
            no shutdown
----------------------------------------------
A:ALA-48>config>service>epipe#

The following output displays an IPv6 filters assigned to an IES service interface:

A:ALA-48>config>service>ies# info
----------------------------------------------
            interface "testA" create
                address 192.22.1.1/24
                sap 2/1/3:0 create
                exit
                ipv6
          ingress
            filter ipv6 100
          egress
            filter ipv6 100
                exit
            exit
...
----------------------------------------------
A:ALA-48>config>service>ies#

4.2.1.7.2. Applying IPv4/IPv6 Filter Policies to a Network Port

IP filter policies can be applied to network IPv4 and IPv6 interfaces. MAC filters cannot be applied to network IP interfaces or to routable IES services. Similarly to applying filter policies to service, IPv4/IPv6 filter policies are applied to network interfaces by associating a policy with ingress and egress direction as desired. Filter ID is used to associate an existing filter policy, or if defined, a filter name for that filter ID policy can be used in the CLI.

The following displays an IP filter applied to an interface at ingress.

A:ALA-48>config>router# info
#------------------------------------------
# IP Configuration
#------------------------------------------
...
        interface "to-104"
            address 10.0.0.103/24
            port 1/1/1
            ingress
                filter ip 10
            exit
            egress
                filter ip “default network egress policy”
            exit
        exit
...
#------------------------------------------
A:ALA-48>config>router# 

The following displays IPv4 and IPv6 filters applied to an interface at ingress and egress.

A:config>router>if# info
----------------------------------------------
            port 1/1/1
            ipv6
                address 3FFE::101:101/120
            exit
            ingress
                filter ip 2
                filter ipv6 1
            exit
            egress
                filter ip 2
                filter ipv6 1
            exit 
----------------------------------------------
A:config>router>if#

4.2.1.8. Creating a Redirect Policy

Configuring and applying redirect policies is optional. Each redirect policy must have the following:

  1. A destination IP address
  2. A priority (default is 100)

Configuring a ping test is recommended.

The following displays a redirection policy configuration:

A:ALA-7>config>filter# info
----------------------------------------------
        redirect-policy "redirect1" create
            destination 10.10.10.104 create
                priority 105
                exit
                no shutdown
            exit
            destination 10.10.10.105 create
                priority 95
                ping-test
                    timeout 30
                    drop-count 5
                exit
                no shutdown
            exit
            destination 10.10.10.106 create
                priority 90
                exit
                no shutdown
            exit
...
----------------------------------------------
A:ALA-7>config>filter#

4.2.1.9. Configuring Filter-Based GRE Tunneling

Traffic matching an IP filter can be tunneled with GRE using the following mechanisms.

  1. Configure a GRE tunnel template.
  2. Associate the GRE tunnel template with the forwarding action of an IPv4 or IPv6 filter using the forward gre-tunnel gre-tunnel-template command.

The gre-tunnel-template defines the parameters to create the GRE header used to encapsulate matching IP traffic.

  1. One or more destination IP addresses must be defined in the gre-tunnel-template.
    1. If more than one destination is configured, then traffic is hashed across all available destinations.
    2. Traffic is routed to the selected destination address based on the route table in the forwarding context of the IP filter.
  2. The source address can be configured to any value and is not validated against a local IP address on the local router.
  3. The optional gre-key field can be populated with the ifIndex of the ingress interface on which the matching IP packet was received.
  4. An optional template parameter, skip-ttl-decrement, allows the TTL of the encapsulated IP packet to be not decremented when encapsulated into the GRE header.

The following is an example configuration:

*A:Nokia-C>config>filter>ip-filter$ default-action 
        gre-tunnel-template "test" create 
            description "10.20.1.5" 
            ipv4 
                source-address 10.20.1.3 
                destination-address 9.9.9.9 
                destination-address 10.20.1.5 
                destination-address 13.13.13.13 
            exit 
        exit 
        ip-filter 1 name "1" create 
            entry 1 create 
                action 
                exit 
                pbr-down-action-override forward 
            exit  
            entry 2 create 
                action 
                    forward gre-tunnel "test" 
                exit 
            exit  
        exit 

4.3. Filter Management Tasks

This section describes filter policy management tasks.

4.3.1. Renumbering Filter Policy Entries

The system exits the matching process when the first match is found and then executes the actions in accordance with the specified action. Because the ordering of entries is important, the numbering sequence may need to be rearranged. Entries should be numbered from the most explicit to the least explicit.

The following example shows renumbering of filter entries.

Example:
config>filter>ip-filter# renum 10 15
config>filter>ip-filter# renum 20 10
config>filter>ip-filter# renum 40 1

The following displays the original filter entry order, followed by the reordered filter entries:

A:ALA-7>config>filter# info
----------------------------------------------
...
        ip-filter 11 create
            description "filter-main"
            scope exclusive
            entry 10 create
                description "no-91"
                filter-sample
                interface-disable-sample 
                match
                    dst-ip 10.10.10.91/24
                    src-ip 10.10.10.103/24
                exit
                action forward redirect-policy redirect1
            exit
            entry 20 create
                match
                    dst-ip 10.10.10.91/24
                    src-ip 10.10.0.100/24
                exit
                action drop
            exit
            entry 30 create
                match
                    dst-ip 10.10.10.91/24
                    src-ip 10.10.0.200/24
                exit
                action forward
            exit
            entry 40 create
                match
                    dst-ip 10.10.10.91/24
                    src-ip 10.10.10.106/24
                exit
                action drop
            exit
        exit
...
----------------------------------------------
A:ALA-7>config>filter#
 
A:ALA-7>config>filter# info
----------------------------------------------
...
        ip-filter 11 create
            description "filter-main"
            scope exclusive
            entry 1 create
                match
                    dst-ip 10.10.10.91/24
                    src-ip 10.10.10.106/24
                exit
                action drop
            exit
            entry 10 create
                match
                    dst-ip 10.10.10.91/24
                    src-ip 10.10.0.100/24
                exit
                action drop
            exit
            entry 15 create
                description "no-91"
                filter-sample
                interface-disable-sample 
                match
                    dst-ip 10.10.10.91/24
                    src-ip 10.10.10.103/24
                exit
                action forward redirect-policy 
                     redirect1
            exit
            entry 30 create
                match
                    dst-ip 10.10.10.91/24
                    src-ip 10.10.0.200/24
                exit
                action forward
            exit
        exit
...
----------------------------------------------
A:ALA-7>config>filter#

4.3.2. Modifying a Filter Policy

There are several ways to modify an existing filter policy. A filter policy can be modified dynamically as part of subscriber management dynamic insertion or removal of filter policy entries (see the 7450 ESS, 7750 SR, and VSR Triple Play Service Delivery Architecture Guide for details). A filter policy can be modified indirectly by configuration change to a match list the filter policy uses (as described earlier in this guide). In addition, a filter policy can be directly edited as described below.

To access a specific IP (v4/v6), or MAC filter, you must specify the filter ID, or if defined, filter name. Use the no form of the command to remove the command parameters or return the parameter to the default setting.

Example:
config>filter>ip-filter# description "New IP filter info"
config>filter>ip-filter# entry 2 create
config>filter>ip-filter>entry$ description "new entry"
config>filter>ip-filter>entry# action drop
config>filter>ip-filter>entry# match dst-ip 10.10.10.104/32
config>filter>ip-filter>entry# exit
config>filter>ip-filter#

The following output displays the modified IP filter output:

 
A:ALA-7>config>filter# info
----------------------------------------------
...
        ip-filter 11 create
            description "New IP filter info"
            scope exclusive
            entry 1 create
                match
                    dst-ip 10.10.10.91/24
                    src-ip 10.10.10.106/24
                exit
                action drop
            exit
            entry 2 create
                description "new entry"
                match
                    dst-ip 10.10.10.104/32
                exit
                action drop
            exit
            entry 10 create
                match
                    dst-ip 10.10.10.91/24
                    src-ip 10.10.0.100/24
                exit
                action drop
            exit
            entry 15 create
                description "no-91"
                match
                    dst-ip 10.10.10.91/24
                    src-ip 10.10.10.103/24
                exit
                action forward
            exit
            entry 30 create
                match
                    dst-ip 10.10.10.91/24
                    src-ip 10.10.0.200/24
                exit
                action forward
            exit
        exit
..
----------------------------------------------
A:ALA-7>config>filter#
 

4.3.3. Deleting a Filter Policy

Before deleting a filter, the filter associations must be removed from all the applied ingress and egress SAPs and network interfaces by executing no filter command in all context where the filter is used.

Example:
config>service# epipe 5
config>service>epipe# sap 1/1/2:3
config>service>epipe>sap# ingress
config>service>epipe>sap>ingress# no filter

After you have removed the filter from the SAPs network interfaces, you can delete the filter as shown in the following example.

Example:
config>filter# no ip-filter 11

4.3.4. Modifying a Redirect Policy

To access a specific redirect policy, the policy name must be specified. Use the no form of the command to remove the command parameters or return the parameter to the default setting.

Example:
config>filter# redirect-policy redirect1
config>filter>redirect-policy# description "New redirect info"
config>filter>redirect-policy# destination 10.10.10.104
config>filter>redirect-policy>dest# priority 105
config>filter>redirect-policy>dest# ping-test timeout 20
config>filter>redirect-policy>dest# ping-test drop-count 7
A:ALA-7>config>filter# info
----------------------------------------------
...
        redirect-policy "redirect1" create
            description "New redirect info"
            destination 10.10.10.104 create
                priority 105
                ping-test
                    timeout 20
                    drop-count 7
                exit
                no shutdown
            exit
            destination 10.10.10.105 create
                priority 95
                ping-test
                    timeout 30
                    drop-count 5
                exit
                no shutdown
            exit
            no shutdown
        exit
...
----------------------------------------------
A:ALA-7>config>filter#

4.3.5. Deleting a Redirect Policy

Before a redirect policy can be deleted from the filter configuration, the policy association must be removed from the IP filter.

The following example shows the command usage to replace the configured redirect policy (redirect1) with a different redirect policy (redirect2) and then removing the redirect1 policy from the filter configuration.

Example:
config>filter>ip-filter 11
config>filter>ip-filter# entry 1
config>filter>ip-filter>entry# action forward redirect-policy redirect2
config>filter>ip-filter>entry# exit
config>filter>ip-filter# exit
config>filter# no redirect-policy redirect1
A:ALA-7>config>filter>ip-filter# info
----------------------------------------------
            description "This is new"
            scope exclusive
            entry 1 create
               filter-sample
               interface-disable-sample 
                match
                    dst-ip 10.10.10.91/24
                    src-ip 10.10.10.106/24
                exit
                action forward redirect-policy redirect2
            exit
            entry 2 create
                description "new entry"
...
----------------------------------------------
A:ALA-7>config>filter>ip-filter#
 

4.3.6. Copying Filter Policies

When changes are to be made to an existing filter policy applied to a one or more SAPs or network interfaces, Nokia recommends to first copy the applied filter policy, then modify the copy and then overwrite the applied policy with the modified copy. This ensures that a policy being modified is not applied when partial changes are done as any filter policy edits are applied immediately to all services where the policy is applied.

New filter policies can also be created by copying an existing policy and renaming the new filter.

The following displays the command usage to copy an existing IP filter (11) to create a new filter policy (12) that can then be edited. And once edits are completed, it can be used to overwrite existing policy (11).

Example:
config>filter# copy ip-filter 11 to 12
A:ALA-7>config>filter# info
----------------------------------------------
...
        ip-filter 11 create
            description "This is new"
            scope exclusive
            entry 1 create
                match
                    dst-ip 10.10.10.91/24
                    src-ip 10.10.10.106/24
                exit
                action drop
            exit
            entry 2 create
...
        ip-filter 12 create
            description "This is new"
            scope exclusive
            entry 1 create
                match
                    dst-ip 10.10.10.91/24
                    src-ip 10.10.10.106/24
                exit
                action drop
            exit
            entry 2 create
...
----------------------------------------------
A:ALA-7>config>filter#