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

NE40E V800R010C10SPC500 Configuration Guide - IP Routing 01

This is NE40E 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).
Overview of XPL

Overview of XPL

This section describes the concept of XPL, the paragraph editing interface, set and route-filter configuration steps, and XPL clauses.

Definition

Extended routing-policy language (XPL) is a language used to filter routes and modify route attributes. By modifying route attributes (including reachability), XPL changes the path through which network traffic passes. XPL provides the same functions as routing policies do, but it uses different editing and filtering methods from routing policies. Therefore, XPL can meet different customer requirements.

Table 13-1 compares XPL and routing policies.

Table 13-1 Comparison between XPL and routing policies

Item

Key Functions

Editing Method

Filtering Method

User Experience

XPL

Filters routes and modifies route attributes.

Line-by-line or paragraph-by-paragraph editing

Uses sets or single elements to filter routes.

Users can configure or modify policies as required in a text editor.

Routing policies

Filter routes and modify route attributes.

Line-by-line editing

Use filters or single elements to filter routes.

Users must follow strict command configuration rules.

NOTE:

For details about routing policies, see "Routing Policies" in HUAWEI NetEngine40E Universal Service Router Feature Description — IP Routing.

Line-by-Line and Paragraph-by-Paragraph Editing

XPL supports line-by-line editing and paragraph-by-paragraph editing, whereas routing policies support line-by-line editing only. Line-by-line editing is a traditional configuration method, whereas paragraph-by-paragraph editing is an innovative configuration method. Table 13-2 compares the two methods.

Table 13-2 Line-by-line and paragraph-by-paragraph editing comparison

Item

Applicable to

Differences

Help and Error Correction Mechanisms

Line-by-line editing

Users who are used to the traditional configuration method or unfamiliar with XPL Each command is run in a command view, and one command is presented in one line, which is considered a configuration unit.

The desired command can be suggested using the command association function.

If any configuration error occurs, it is reported after the command is configured.

Paragraph-by-paragraph editing

Users who are familiar with XPL clause configuration and want to simplify the configuration process The paragraph editing UI functions as a text editor, in which users edit XPL clauses. The XPL clauses are committed after a paragraph of them are configured, and each paragraph is considered a configuration unit.

The command association function is not supported, and complete clauses must be entered in the paragraph editing UI.

If any configuration error occurs, it is reported after the configurations of the whole paragraph are committed.

Paragraph Editing Interface

This section does not detail the line-by-line editing. For details about it, see the set or route-filter configuration process. During line-by-line editing of a set or route-filter, you can run the abort command to cancel the configurations that have not been committed in the current view and return to the system view or run the display this candidate command to check the configurations that have not been committed in the current view.

Paragraph-by-paragraph editing is described in terms of Paragraph Editing Interface and Configuration Procedures of Sets and Route-Filters Using the Paragraph Editing Mode. For details about XPL paragraph editing clauses, see XPL Paragraph Editing Clauses.

The paragraph editing interface functions as a text editor, in which users can edit XPL clauses to configure or modify sets and route-filters.

Common shortcut keys

Shortcut keys can be used in the paragraph editing interface. Table 13-3 lists common shortcut keys and their functions.

Table 13-3 Shortcut keys commonly used in the paragraph editing interface

Shortcut Key

Function

i

Enters the text editing mode. Sets or route-filters can be configured only in the text editing mode.

Esc

Exits from the text editing mode.

:q!
Exits from the paragraph editing interface view without saving configurations.
NOTE:

The shortcut key takes effect only after Enter is pressed.

:wq
Saves configurations and exits from the paragraph editing interface view.
NOTE:

The shortcut key takes effect only after Enter is pressed.

Paragraph editing interface views

The following lists the different paragraph editing interface views and the commands used to access them:

  • Global variable set: Run the edit xpl global-value command.
  • IPv4 prefix set: Run the edit xpl ip-prefix-list ip-prefix-list-name command.
  • IPv6 prefix set: Run the edit xpl ipv6-prefix-list ipv6-prefix-list-name command.
  • AS_Path set: Run the edit xpl as-path-list as-path-list-name command.
  • Community set: Run the edit xpl community-list community-list-name command.
  • Route-filter: Run the edit xpl route-filter route-filter-name command.

Configuration Procedures of Sets and Route-Filters Using the Paragraph Editing Mode

Sets and route-filters can be configured as follows:
  • To configure a global variable set:
    1. Configure a start clause (xpl global-value) for a global variable set.
    2. Configure set elements in the format of variable name+'value' in the global variable set view.
      • The variable value range is The value is a string of 1 to 200 case-sensitive characters, spaces not supported. The string can contain letters, digits, underscores (_), hyphens (-), and dots (.). It must start with a letter or digit.The variable name must not be abort, display, end-global-value, or any abbreviation of the keywords, for example, a, ab, abo, di, e, or end.
      • Separate every two neighboring elements with a comma (,), for example, aaa '12', bbb '34', aaa '1.2.3.4'.
    3. Configure an end clause (end-global-value) for the global variable set.
  • To configure an IPv4 prefix set:
    1. Configure a start clause (xpl ip-prefix-list ip-prefix-list-name) for an IPv4 prefix set.
    2. Configure elements (IPv4 addresses with masks, 1.1.1.0 24 for example) for the set and separate every two neighboring elements with a comma (,). You can use eq, ge, or le to specify the mask length. For example, 1.1.1.0 24 ge 26 le 30 matches the routes in network segment 1.1.1.0/24 with the mask length ranging from 26 to 30 bits.
    3. Configure an end clause (end-list) for the IPv4 prefix set.
  • To configure an IPv6 prefix set:
    1. Configure a start clause (xpl ipv6-prefix-list ipv6-prefix-list-name) for an IPv6 prefix set.
    2. Configure elements (IPv6 addresses with masks, 2001:db8:0:1:: 64 for example) for the set and separate every two neighboring elements with a comma (,). You can use eq, ge, or le to specify the mask length. For example, 2001:db8:0:1:: 64 ge 96 le 100 matches the routes in network segment 2001:db8:0:1::/64 with the mask length ranging from 96 to 100 bits.
    3. Configure an end clause (end-list) for the IPv6 prefix set.
  • To configure an AS_Path set:
    1. Configure a start clause (xpl as-path-list as-path-list-name) for an AS_Path set.
    2. Configure elements for the set and separate every two neighboring elements with a comma (,). The elements can be configured in any of the following formats:
      • length { eq | ge | le } as-length: matches BGP routes with AS_Path length equal to (eq), greater than or equal to (ge), or less than or equal to (le) as-length. The value of as-length is an integer ranging from 0 to 2047.
      • unique-length { eq | ge | le } as-length: matches BGP routes with AS_Path length equal to (eq), greater than or equal to (ge), or less than or equal to (le) as-length (duplicate AS numbers are counted as one). The value of as-length is an integer ranging from 0 to 2047.
      • origin as-path [ whole-match ]: matches BGP routes with AS_Path whose rightmost AS numbers are the same as as-path. The as-path parameter is enclosed in single quotation marks, with every two neighboring AS numbers separated with a space. Duplicate AS numbers are counted as one unless whole-match is configured.
      • peer-is as-path [ whole-match ]: matches BGP routes with AS_Path whose leftmost AS numbers are the same as as-path. The as-path parameter is enclosed in single quotation marks, with every two neighboring AS numbers separated with a space. Duplicate AS numbers are counted as one unless whole-match is configured.
      • pass as-path [ whole-match ]: matches BGP routes with AS_Path whose contiguous AS numbers match as-path. The as-path parameter is enclosed in single quotation marks, with every two neighboring AS numbers separated with a space. Duplicate AS numbers are counted as one unless whole-match is configured.
      • regular regular-expression: matches BGP routes with AS_Path in the specified regular expression. For detailed description about regular expressions, see NE40E Configuration Guide – Basic Configuration.
    3. Configure an end clause (end-list) for the AS_Path set.
  • To configure a community set:
    1. Configure a start clause (xpl community-list community-list-name) for a community set.
    2. Configure elements in the format of aa:nn (100:1 for example), a community number, or a known community (internet, no-export-subconfed, no-advertise, or no-export) for the community set and separate every two neighboring elements with a comma (,). An asterisk (*) can be used to match any character. If an asterisk (*) is used in an element, such as 100:*, the element matches all communities with the AS number 100.
    3. Configure an end clause (end-list) for the community set.
  • To configure a route-filter:
    1. Configure a start clause in the format of xpl route-filter route-filter-name($var1,$var2,...) for a route-filter. A maximum of eight parameters can be configured in a start clause, and the parameters can be used in condition or action clauses.
    2. 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).

    3. 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.
    4. (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.
    5. 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.

    6. Configure an end clause (end-filter) for the route-filter.

NOTE:

The easiest method to configure route-filters to reference route attribute sets is to use the format {element A, element B...}, if ip route-source in { 1.1.1.0 24, 2.2.2.2 32 } then for example. However, if a route-filter needs to reference a set multiple times, configure named route attribute sets.

Purpose

When advertising, receiving, or importing routes, the router can use XPL based on actual networking requirements to filter routes and modify route attributes. XPL serves the following purposes:

  • Controls route advertisement.

    Only routes that match the rules specified in the XPL are advertised.

  • Controls route acceptance.

    Only necessary and valid routes are accepted, which reduces the routing table size and improves network security.

  • Filters and controls imported routes.

    A routing protocol may import routes discovered by other routing protocols. XPL ensures that only the routes that meet certain conditions are imported and route attributes of the imported routes are modified to meet the requirements of the protocol.

  • Modifies route attributes.

    Attributes of the routes that match the specified route-filter can be modified as required.

Benefits

XPL offers the following benefits:
  • Saves system resources by controlling the routing table size.
  • Improves network security by controlling route advertisement and acceptance.
  • Improves network performance by modifying route attributes for effective traffic planning.
  • Simplifies routing policy configurations.
Translation
Download
Updated: 2019-01-03

Document ID: EDOC1100055018

Views: 54350

Downloads: 209

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