< Home

Configuring the Policy for Advertising BGP Routing Information

After a route advertisement policy is configured on a device, the device advertises only routes matching the policy to its peers.

Procedure

  • Configure BGP to filter the globally advertised routes.
    1. Access the system view.

      system-view

    2. Access the BGP view.

      bgp { as-number-plain | as-number-dot }

    3. Access the BGP IPv4 unicast address family view.

      ipv4-family unicast

    4. Filter the advertised routes.

      filter-policy { acl-number | ip-prefix ip-prefix-name } export [ protocol [ process-id ] ]

      After BGP filters the imported routes, only the routes that meet the matching rules are added to the local BGP routing table and advertised to BGP peers.

      If protocol is specified, you can filter the routes of a specific routing protocol. If protocol is not specified, all the routes to be advertised are filtered, including the routes imported and the local routes advertised with the network command.

      If the ACL is used in the filter-policy command and no VPN instance is specified in the ACL rules, BGP filters routes in all the address family views, including routes of the public network and the private network. If a VPN instance is specified, BGP filters data traffic from this VPN instance rather than the routes.

  • Apply a policy to the routes advertised by specified BGP peers.
    1. Access the system view.

      system-view

    2. Access the BGP view.

      bgp { as-number-plain | as-number-dot }

    3. Access the BGP IPv4 unicast address family view.

      ipv4-family unicast

    4. Configure the routing policy applied when routes are advertised.

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

  • Apply a filter to the routes advertised by specified BGP peers.
    1. Access the system view.

      system-view

    2. Access the BGP view.

      bgp { as-number-plain | as-number-dot }

    3. Access the BGP IPv4 unicast address family view.

      ipv4-family unicast

    4. Run the following commands as required:

      • Configure BGP to filter routes based on the ACL.

        peer { ipv4-address | group-name } filter-policy acl-number export

      • Configure BGP to filter routes based on the AS-Path filter.

        peer { ipv4-address | group-name } as-path-filter as-path-filter-number export

      • Configure BGP to filter routes based on the IP prefix list.

        peer { ipv4-address | group-name } ip-prefix ip-prefix-name export

        The members of a peer group and the peer group can use different outbound routing policies. That is, each peer group can select its policy when advertising routes.

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