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 both IP and MAC filter configurations and provides the CLI commands.

4.2.1.1. Creating an IPv4 Filter Policy

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

  1. The filter type specified (IP)
  2. A filter policy ID
  3. A default action, either drop or forward
  4. Filter policy scope specified, either exclusive or template
  5. At least one filter entry with matching criteria specified
  6. Optionally, an existing filter policy can have a Filter Name assigned, that can then be used in CLI to reference that filter policy including assigning it to SAPs and/or network interfaces.

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}
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, or network traffic is matched. The action specified in the entry determine 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 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
                no action
            exit
----------------------------------------------
A:ALA-7>config>filter>ip-filter#

4.2.1.1.1.1. Configuring the HTTP-Redirect Option

If http-redirect is specified as an action, a corresponding forward entry must be specified before the redirect. Http-redirect is not supported on the 7450 ESS-1 model.

The following displays an http-redirect configuration example:

A:ALA-48>config>filter>ip-filter# info
----------------------------------------------
            description "Captive Portal Filter"
            scope template
            entry 10 create
                description "Allow DNS"
                match protocol udp
                    dst-port eq 53
                exit
                action forward
            exit
            entry 20 create
                description "Allow Captive Portal"
                match protocol tcp
                    dst-ip 100.0.0.2/32
                    dst-port eq 80
                exit
                action forward
            exit
            entry 30 create
                description "HTTP Redirect to Captive Portal"
                match protocol tcp
                    dst-port eq 80
                exit
                action http-redirect "http://100.0.0.2/login.cgi?mac=$MAC$sap=$S
AP&ip=$IP&orig_url=$URL"
            exit
----------------------------------------------
A:ALA-48>config>filter>ip-filter#

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

Configuring and applying IPv6 filter policies is optional. IPv6 filter policies must be configured separately from IP (IPv4) filter policies. The configuration mimics IP filter policy configuration. See Creating an IPv4 Filter Policy.

4.2.1.3. Creating a MAC Filter Policy

Configuring and applying filter policies is optional. 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 IP Exception Filter Policy

Configuring and applying IP 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 a Match List for Filter Policies

IP filter policies support usage of match lists as a single match criteria. To create a match list you must:

  1. Specify a type of a match list (IPv4 address prefix for example).
  2. Define a unique match list name (IPv4PrefixBlacklist for example).
  3. Specify at least one list argument (a valid IPv4 address prefix for example).

Optionally, a description can also be defined.

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

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

4.2.1.6. Applying Filter Policies

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

Table 48:  Applying Filter Policies 

IPv4 and IPv6 Filter Policies

MAC Filter Policies

Epipe SAP, spoke SDP

Epipe SAP, spoke SDP

Fpipe SAP, spoke SDP

N/A

IES interface SAP, spoke SDP, R-VPLS

N/A

Ipipe SAP, spoke SDP

N/A

VPLS mesh SDP, spoke SDP, SAP

VPLS mesh SDP, spoke SDP, SAP

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

N/A

Network interface

N/A

4.2.1.6.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.6.2. Applying IPv4/IPv6 Filter Policies to a Network Port

IP filter policies can be applied to network IPv4/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/or 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.7. 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)
  3. At least one of the following tests must be enabled:
    1. Ping test
    2. SNMP test
    3. URL test

The following displays a redirection policy configuration:

A:ALA-7>config>filter# info
----------------------------------------------
        redirect-policy "redirect1" create
            destination 10.10.10.104 create
                description "SNMP_to_104"
                priority 105
                snmp-test "SNMP-1"
                    interval 30
                    drop-count 30 hold-down 120
                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
                url-test "URL_to_106"
                    url "http://aww.alcatel.com/ipd/"
                    interval 60
                    return-code 2323 4567 raise-priority 96
                exit
                no shutdown
            exit
...
----------------------------------------------
A:ALA-7>config>filter#

4.2.1.8. 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/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 you can delete a filter, you must remove the filter association 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, you must specify the policy name. 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.106
config>filter>redirect-policy>dest# no url-test "URL_to_106"
config>filter>redirect-policy>dest# url-test "URL_to_Proxy"
config>filter>redirect-policy>dest>url-test$ url http:// www.alcatel.com
config>filter>redirect-policy>dest>url-test# interval 10
config>filter>redirect-policy>dest>url-test# timeout 10
config>filter>redirect-policy>dest>url-test# return-code 1
4294967295 raise-priority 255
A:ALA-7>config>filter# info
----------------------------------------------
...
        redirect-policy "redirect1" create
            description "New redirect info"
            destination 10.10.10.104 create
                description "SNMP_to_104"
                priority 105
                snmp-test "SNMP-1"
                    interval 30
                    drop-count 30 hold-down 120
                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
                url-test "URL_to_Proxy"
                    url "http://www.alcatel.com"
                    interval 10
                    timeout 10
                    return-code 1 4294967295 raise-priority 255
                exit
                no shutdown
            exit
            no shutdown
        exit
...
----------------------------------------------
A:ALA-7>config>filter#

4.3.5. Deleting a Redirect Policy

Before you can delete a redirect policy from the filter configuration, you must remove the policy association 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/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#