Configuring a Route-Policy

A route-policy is used to match routes or route attributes, and to change route attributes when the matching rules are met.

Context

A route-policy is used to match routes or route attributes, and to change route attributes when the matching rules are met.

A route-policy consists of multiple nodes, and each node can comprise the following clauses:

  • if-match clauses

    The clauses define the matching rules of a route-policy. The matching objects are route attributes.

  • apply clauses

    The clauses specify actions. Configuration commands are run after a route meets the matching rules specified by the if-match clauses. The apply clauses can change certain route attributes.

This section describes only the BGP4+ route-policy. For detailed information about route-policy configurations, see "Routing Policy Configuration."

Procedure

  • Create a route-policy.
    1. Run system-view

      The system view is displayed.

    2. Run route-policy route-policy-name { permit | deny } node node

      The node of a route-policy is created, and the view of the route-policy is displayed.

    3. Run commit

      The configuration is committed.

  • Configure if-match clauses.
    1. Run system-view

      The system view is displayed.

    2. Run route-policy route-policy-name { permit | deny } node node

      The route-policy view is displayed.

    3. Run the following command to configure the if-match clause for the current node in the route-policy as required:

      • To use the AS_Path attribute of BGP4+ routes as a match criterion, run if-match as-path-filter { as-path-filter-number | as-path-filter-name } &<1-16>

      • To use the community attribute of BGP4+ routes as a match criterion, run:

      • To match BGP4+ routes against the Large-community attribute, run the if-match large-community-filter large-comm-filter-name [ whole-match ] command.
      • To match BGP4+ routes against the VPN-Target extended community attribute, run the if-match extcommunity-filter { { basic-extcomm-filter-num | adv-extcomm-filter-num } &<1-16> | extcomm-filter-name } command.
      • To match BGP4+ routes against the SoO extended community attribute, run the if-match extcommunity-list soo extcomm-filter-name command.

      The commands in Step 3 can be configured in random order. A node may have multiple or no if-match clauses.

      • The relationship between the if-match clauses for a node of a route-policy is "AND". A route must meet all the matching rules before the action defined by the apply clause is performed.

      • If no if-match clause is specified, all the routes are matched.

    4. Run commit

      The configuration is committed.

  • Configure the apply clause.
    1. Run system-view

      The system view is displayed.

    2. Run route-policy route-policy-name { permit | deny } node node

      The route-policy view is displayed.

    3. Run the following command as needed to configure the apply clause for the current node in the route-policy:

      • To configure BGP4+ to overwrite or add the specified AS number for the AS_Path attribute of matched routes, run the apply as-path { as-number-plain | as-number-dot } &<1-128> { additive | overwrite | delete } or apply as-path asValues { additive | overwrite | delete } command.

      • To delete the specified community attribute of BGP4+ routes, run the apply comm-filter comm-filter-number delete command.

        The apply comm-filter delete command deletes the specified community attribute from routes. Running the ip community-filter command specifies only one community attribute each time. To delete more than one community attribute, run the ip community-filter command multiple times. If multiple community attributes are specified in one filter, none of them can be deleted. For example, see the HUAWEI NetEngine 8000 F Series Router Command Reference.

      • To delete the community attribute of BGP4+ routes, run the apply community none command.
      • To set the community attribute for BGP4+ routes, run the apply community { { community-number | aa:nn } &<1-32> | internet | no-advertise | no-export | no-export-subconfed }* [ additive ] command.

        Before running the apply community community-list community-list-name command, you need to run the ip community-list command to configure a BGP community list and run the community command to configure community attributes for the list.

      • To delete the Large-Community attribute of BGP4+ routes, run the apply large-community none command.
      • To set the Large-Community attribute of BGP4+ routes, run the apply large-community { aa:bb:cc } &<1-16> { additive | overwrite | delete } or apply large-community-list large-community-list-name { additive | overwrite | delete } command.
      • To set the VPN-Target extended community attribute for BGP4+ routes, run the apply extcommunity { rt { as-number:nn | ipv4-address:nn } } &<1-16> [ additive ] command.
      • To set the SoO extended community attribute for BGP4+ routes, run the apply extcommunity soo { site-of-origin } &<1-16> additive command.
      • To set a MED value for BGP4+ routes, run the apply cost { [ apply-type ] cost | inherit | none } command.
      • To set the MED value of BGP4+ routes as the IGP cost of the next hop, run the apply cost-type internal command.
      • To set the VPN-Target extended community attribute for BGP4+ routes, run the apply extcommunity { rt { as-number:nn | ipv4-address:nn } } &<1-16> [ additive ] command.
      • To set the local preference for BGP4+ routes, run the apply local-preference [ + | - ] preference command.
      • To set the Origin attribute for BGP4+ routes, run the apply origin { igp | egp { as-number-plain | as-number-dot } | incomplete } command.
      • To set the preferred value for BGP4+ routes, run the apply preferred-value preferred-value command.
      • To set dampening parameters for EBGP routes, run the apply dampening half-life-reach reuse suppress ceiling command.

      The commands in Step 3 can be configured in random order.

    4. Run commit

      The configuration is committed.

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