Configuring Routing Policies on a BGP Route Sender

This section describes how to configure routing policies on a BGP route sender.

Context

Perform the following operations on a BGP route sender:

Procedure

  1. Run system-view

    The system view is displayed.

  2. (Optional) Configure an ACL rule.

    To configure a basic ACL:

    1. Run acl { name basic-acl-name { basic | [ basic ] number basic-acl-number } | [ number ] basic-acl-number } [ match-order { config | auto } ]

      A basic ACL is created and the view of the basic ACL is displayed.

    2. Run rule [ rule-id ] { deny | permit } [ fragment-type { fragment | non-fragment | non-subseq | fragment-subseq | fragment-spe-first } | source { source-ip-address { source-wildcard | 0 } | any } | time-range time-name | vpn-instance vpn-instance-name ] *

      A rule for the basic ACL is configured.

    The system processes the packets as follows:
    1. If packets match the ACL rule with the permit action, the system applies the action to the packets.
    2. If packets match the ACL rule with the deny action, the system drops the packets.
    3. If packets match no ACL rule, the system does not apply the action to the packets but forwards them.
    4. If a nonexistent ACL is referenced, or the referenced ACL exists, but no rule is configured for it, the system does not apply any action to the packets but forwards them.

  3. Run quit

    The system view is displayed.

  4. Run route-policy route-policy-name matchMode node node

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

  5. Run one of the following commands as required to configure a matching rule for the routing policy.

    • To match an ACL, run the if-match acl { acl-number | acl-name } command.

      Only rules of ACLs 2000 to 2999 can be configured as matching rules in the routing policy.

    • To match an AS_Path list, run the if-match as-path-filter { as-path-filter-number | as-path-filter-name } &<1-16> command.

    • To match the community attribute list, run the if-match community-filter { basic-comm-filter-num [ whole-match ] | adv-comm-filter-num }* &<1-16> or if-match community-filter comm-filter-name [ whole-match ] command.

    • To match a route cost, run the if-match cost cost command.

    • To match an IP prefix list, run the if-match ip-prefix ip-prefix command.

  6. Run one of the following commands as required to set route attributes.

    • To set an AS_Path attribute, run the apply as-path as-number &<1-128> [ additive ] command.

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

    • To set a route cost, run the apply cost { [ + | - ] cost | inherit } command.

    You can set one BGP attribute, such as the AS_Path, community attribute, or extended community attribute, for the matched BGP routes as required.

  7. Run quit

    The system view is displayed.

  8. Run bgp as-number

    The BGP view is displayed.

  9. Run peer { ipv4-address | group-name } route-policy route-policy-name export

    The routing policy is applied to the routes that are to be advertised to the peer.

    Ensure that BGP peer relationships have been set up before the routing policy is applied.

  10. Run peer peerIpv4Addr advertise-community

    The community attribute is advertised to the peer.

  11. Run commit

    The configuration is committed.

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