No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

ME60 V800R010C10SPC500 Configuration Guide - IP Routing 01

This is ME60 V800R010C10SPC500 Configuration Guide - IP Routing
Rate and give feedback :
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Configuring a Route-Filter

Configuring a Route-Filter

A route-filter can use its condition clause to filter routes and use its action clause to set or modify route attributes of the routes that match the condition clause. This section describes how to configure route-filters.

Usage Scenario

Route-filters include various matching rules and apply to a variety of scenarios. Route-filters consist of condition clauses and action clauses, use condition clauses to filter routes based on sets or a single element, and use action clauses to modify route attributes of the routes that meet matching rules.
  • Condition clause: A condition clause is defined based on a set or single element, beginning with an introductory condition clause in most cases. The action specified in the action clause is applied only to the routes that match the conditions specified in the condition clause.
  • Action clause: An action clause specifies an action to be applied to the routes that match the conditions specified in the condition clause. An action clause determines whether the routes match the route-filter or modifies their route attributes.

Pre-configuration Tasks

Before configuring route-filters, complete the following tasks:
  • Determine whether to configure route attribute sets.
  • Configure a global variable set if some values need to be frequently used.

Procedure

  • Configure a route-filter using the paragraph editing mode.
    1. Run the edit xpl route-filter route-filter-name command to enter the route-filter paragraph editing interface view.
    2. Press i to enter the text editing mode.

      NOTE:

      Sets or route-filters can be configured only in the text editing mode. If you exit from the text editing mode, you can perform shortcut key operations only.

    3. Configure a start clause in the format of xpl route-filter route-filter-name($var1,$var2,...) for a route-filter.and the parameters can be used in condition or action clauses.
    4. Configure a condition clause in the format of if+condition clause+then and connect the conditions in the clause with the Boolean operator NOT, AND, or OR. For details about condition clauses, see Condition Clauses.

      NOTE:

      Route-filters can have only action clauses and can also be empty (configured with only a start clause and an end clause).

    5. Configure an action clause. For details about action clauses, see Action Clauses.

      NOTE:
      • Multiple action clauses can be configured if they do not conflict with each other.
      • Action clauses (excluding approve, refuse, finish, break, and call route-filter route-filter-name) must follow apply.

    6. (Optional) Configure elseif+condition clause+then to filter the routes that fail to match the conditions specified in the if clause and specify an action clause for the elseif clause. You can configure multiple elseif clauses to filter the routes that fail to meet the previous matching rule or configure an else clause to match the routes that fail to meet all the previous matching rules. Each if, elseif, or else clause must be followed by an action clause.
    7. Configure a conclusive condition clause (endif).

      NOTE:

      Steps 2 to 5 describe how to configure an if condition branch. One route-filter can have multiple if condition branches, and the if condition branches can be configured as follows:

      • One if condition branch is followed by another.
      • The if+condition clause+then or elseif+condition clause+then is followed by another if condition branch. Such a configuration further filters routes that match if+condition clause+then or elseif+condition clause+then against the second if condition branch.

      Regardless of the configuration mode, route filtering continues until finish, break, refuse, or the last if condition branch.

    8. Configure a conclusive clause (end-filter) for the route-filter.
    9. Press Esc to exit from the text editing mode.
    10. Press :wq and Enter to save the configurations and exit from the global variable set paragraph editing interface view.

      NOTE:

      A message is displayed for you to confirm whether to commit the configurations when you attempt to exit from the global variable set paragraph editing interface view. To commit the configurations, press Y.

      To exit from the global variable set paragraph editing interface view without saving the configurations, press :q! and Enter.

  • Configure a route-filter using the line editing mode.
    1. Run the system-view command to enter the system view.
    2. Run the xpl route-filter route-filter-name command to enter the route-filter view.
    3. Run the if [ not ] condition-clause [ { and | or } [ not ] condition-clause ] * then command to configure matching rules for the route-filter.

      NOTE:

      Route-filters can have only action clauses and can also be empty (only configured with xpl route-filter and end-filter).

    4. Configure an action using any of the following command for the routes that meet matching rules:

      • apply action-clause: sets a route attribute for the routes that meet matching rules.
      • approve: further filters the routes that meet the matching rules of the current if condition branch against the next if condition branch.
      • refuse: denies routes that meet matching rules.
      • finish: completes route filtering and allows the routes that meet matching rules to match the route-filter.
      • call route-filter route-filter-name: further matches the routes that meet the matching rules of the current route-filter against the specified route-filter.
      • break: enables the device to exit from the current route-filter. If the current route-filter is referenced by a parent route-filter, the device keeps implementing remaining condition and action clauses of the parent route-filter.
      NOTE:

      Multiple action clauses can be configured if they do not conflict with each other.

    5. Run the elseif [ not ] condition-clause [ { and | or } [ not ] condition-clause ] * then command to filter the routes that fail to meet the rules specified in the if command and specify an action for the routes. You can run the elseif command multiple times to filter the routes that fail to meet the previous matching rules or run the else command to match the routes that fail to meet all the previous matching rules.
    6. Run the endif command to conclude the configuration of the current if condition branch.

      NOTE:

      An if condition branch begins with if and ends with endif. One route-filter can have multiple if condition branches, and the if condition branches can be configured as follows:

      • One if condition branch is followed by another.
      • The if or elseif clause of one if condition branch is followed by another if condition branch. Such a configuration further filters routes that match if or elseif clause against the second if condition branch.

      Regardless of the configuration mode, route filtering continues until finish, break, refuse, or the last if condition branch.

    7. Run the end-filter command to conclude the configuration of the route-filter.
    8. Run the commit command to commit the configuration.

Example

NOTE:

If only paragraph editing is used as an example, the corresponding line editing is similar. To use the line editing mode, perform the operations described in paragraph editing.

For detailed set and route-filter configuration steps, see Set and Route-Filter Configuration Steps. For details about XPL clauses, see XPL Paragraph Editing Clauses.

Objective

Configure a route-filter to set the priorities of the BGP routes destined for 1.1.1.1 to 200.

Configuration Example 1
<HUAWEI> edit xpl route-filter r1

xpl route-filter r1
if ip route-destination in { 1.1.1.1 32 } then
apply preference 200
endif
end-filter

The IPv4 prefix set used by the route-filter r1 includes only one element. In this situation, use the format of {element A} to present the IPv4 prefix set.

Objective

Create a route-filter named para with a pre-defined variable and configure another route-filter named r2 to reference para.

Configuration Example 2
<HUAWEI> edit xpl route-filter para

xpl route-filter para($var)
apply med $var
end-filter
<HUAWEI> edit xpl route-filter r2

xpl route-filter r2
if ip route-destination in aaa then
call route-filter para(20)
elseif ip route-destination in bbb then
call route-filter para(30)
endif
end-filter

aaa and bbb specified in r2 are IPv4 prefix sets, and a maximum of eight parameters can be referenced by each route-filter.

Objective Configure a route-filter to set the priorities of the BGP routes carrying destination IP address 1.1.1.1 and MPLS labels to 50.
Configuration Example 3
<HUAWEI> edit xpl route-filter r3

xpl route-filter r3
if ip route-destination in { 1.1.1.1 32 } and mpls-label exist then
apply preference 50
endif
end-filter

The conditions in a condition clause can be connected with the Boolean operator NOT, AND, or OR.

Checking the Configurations

After configuring route-filters, check the configurations.

  • Run the display xpl route-filter [ route-filter-name [ verbose | used-object | expanded ] ] command to check XPL route-filter configurations or references.

  • Run the display xpl route-filter state [ attached | unattached ] [ verbose ] command to check information about route attribute set configurations and references.

  • Run the display xpl statistics command to check XPL line and route-filter specifications and current statistics.

# Run the display xpl route-filter [ route-filter-name [ verbose | used-object | expanded ] ] command to view XPL route-filter configurations or references.

<HUAWEI> display xpl route-filter r1 verbose
Service   attachPoint         ReferCnt      BoundBy
bgp       bgpPeerExport       1             r1                                                               
 ----------------------------------------------------------
xpl route-filter r1
 if ip route-destination in prefix1 then
  approve
 else
  refuse
 endif
 end-filter

# Run the display xpl route-filter state verbose command to view detailed information about route attribute set configurations and references.

<HUAWEI> display xpl route-filter state verbose
Attached :Applied by at least one attach point
Unattached : Not applied by any attach point

Attached
---------------------------------------------------------------
xpl route-filter r1
  if med eq $var1 then
    apply community {200:1} additive
  elseif ip next-hop in aaa then
    apply community {100:1} overwrite
  else
    refuse
  endif
  end-filter
#

Unattached
---------------------------------------------------------------

# Run the display xpl statistics command to view XPL line and route-filter specifications and current statistics.

<HUAWEI> display xpl statistics
Statistics Item    Current Supported      Current Configurated
Total line                     65536                         0
Filter Number                   3500                         0
Translation
Download
Updated: 2019-01-04

Document ID: EDOC1100059437

Views: 20297

Downloads: 15

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next