Configuring Large-Community Sets

Large-Community sets apply to BGP and are used to match the Large-Community attribute of BGP routes. This section describes how to configure Large-Community sets.

Procedure

  • Configure a Large-Community set using the paragraph-by-paragraph editing mode.
    1. Run the edit xpl large-community-list large-community-list-name command to enter the paragraph editing interface view of a Large-Community set.
    2. Press i to enter the text editing mode.

      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 (xpl large-community-list large-community-list-name) for the Large-Community set.
    4. Configure elements in the format of aa:bb:cc (100:1:1 for example) for the Large-Community set and separate every two neighboring elements with a comma (,). You can also configure elements in the regular regular-expression format to indicate that the Large-Community attribute of a route matches a specified regular expression, and regular-expression specifies a regular expression. An asterisk (*) in an element can be used to match any digit; for example, an element can be set to 100:1:*.

      Regular expression processing is computing-intensive. When a large number of regular expressions are configured in an XPL policy to match a BGP route attribute and the length of the route attribute is long, the processing performance of the XPL policy deteriorates. To improve the processing performance of the routing policy, decrease the number of regular expressions or use a non-regular expression matching command.

      It is recommended that a maximum of 100 regular expressions be configured for each policy.

    5. Configure an end clause (end-list) for the Large-Community set.
    6. Press Esc to exit from the text editing mode.
    7. Press :wq and Enter to save the configurations and exit from the global variable set paragraph editing interface view.

      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 Large-Community set using the line-by-line editing mode.
    1. Run the system-view command to enter the system view.
    2. Run the xpl large-community-list large-community-list-name command to enter the Large-Community set view.
    3. Configure elements in the format of aa:bb:cc (100:1:1 for example) for the Large-Community set and separate every two neighboring elements with a comma (,). You can also configure elements in the regular regular-expression format to indicate that the Large-Community attribute of a route matches a specified regular expression, and regular-expression specifies a regular expression. An asterisk (*) in an element can be used to match any digit; for example, an element can be set to 100:1:*.

      Regular expression processing is computing-intensive. When a large number of regular expressions are configured in an XPL policy to match a BGP route attribute and the length of the route attribute is long, the processing performance of the XPL policy deteriorates. To improve the processing performance of the routing policy, decrease the number of regular expressions or use a non-regular expression matching command.

      It is recommended that a maximum of 100 regular expressions be configured for each policy.

    4. Run the end-list command to conclude the configuration of the Large-Community set, exit the Large-Community set view, and return to the system view.
    5. Run the commit command to commit the configuration.

Example

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 details about how to configure sets and route-filters, see Configuration Procedures of Sets and Route-Filters Using the Paragraph Editing Mode. For details about XPL clauses, see XPL Paragraph Editing Clauses.

Objectives

Configure a Large-Community set to match Large-Community attribute values 100:1:1, 200:1:1, and 300:1:1.

Configuration Example 1

<HUAWEI> edit xpl large-community-list aaa

xpl large-community-list aaa
100:1:1,
200:1:1,
300:1:1
end-list

This Large-Community set includes three elements and matches Large-Community attribute values 100:1:1, 200:1:1, and 300:1:1.

Objectives

Configure a Large-Community set to match Large-Community attribute values 100:1:*, 200:1:*, and 300:1:1.

Configuration Example 2

<HUAWEI> edit xpl large-community-list bbb

xpl large-community-list bbb
regular 100:1:*,
regular 200:1:*,
300:1:1
end-list

This Large-Community set includes three elements and matches Large-Community attribute values 100:1:*, 200:1:*, and 300:1:1.

Objectives

Configure a route-filter to add Large-Community attribute values 100:1:1, 200:1:1, and 300:1:1 to the routes with a Local_Pref value less than or equal to 100.

Reference Example 1

<HUAWEI> edit xpl route-filter r1

xpl route-filter r1
if local-preference le 100 then
apply large-community aaa additive
endif
end-filter

This route-filter references the Large-Community set aaa and adds Large-Community attribute values 100:1:1, 200:1:1, and 300:1:1 to the routes with a Local_Pref value less than or equal to 100.

Objectives

Configure a route-filter to set the next hop addresses of the routes whose Large-Community attribute values compose a subset of the set bbb to 1.1.1.1.

Reference Example 2

<HUAWEI> edit xpl route-filter r2

xpl route-filter r2
if large-community matches-within bbb then
apply ip next-hop 1.1.1.1
endif
end-filter

This route-filter references the Large-Community set bbb and sets the next hop addresses of the routes whose Large-Community attribute values compose a subset of the set bbb to 1.1.1.1.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >