Configuring a Policy for Advertising BGP4+ Routes

If BGP4+ is configured to filter imported routes, only the routes that meet the matching rules are added to the local BGP4+ routing table and advertised to BGP4+ peers.

Context

BGP4+ can also apply a routing policy to all the routes to be advertised or only the routes to be advertised to a certain peer (group). If multiple filter policies are configured, BGP advertises only routes that match all the filter policies.

Procedure

  • Configure BGP to filter all the routes to be advertised.
    1. Run system-view

      The system view is displayed.

    2. Run bgp as-number

      The BGP view is displayed.

    3. Run ipv6-family unicast

      The IPv6 unicast address family view is displayed.

    4. Run filter-policy { acl6-number | acl6-name acl6-name | ipv6-prefix ipv6-prefix-name } export [ direct | isis process-id | ospfv3 process-id | ripng process-id | static | unr ]

      The routes to be advertised are filtered.

      BGP4+ filters the routes imported using the import-route command, and only the routes that meet the matching rules are added to the local BGP4+ routing table and advertised to BGP4+ peers.

      If protocol is specified, only the routing information of a specified protocol is filtered. If protocol is not specified, all BGP routes to be advertised are filtered, including the routes imported using the import-route and network commands.

    5. Run commit

      The configuration is committed.

  • Apply a routing policy to the routes to be advertised to a certain peer (group).
    1. Run system-view

      The system view is displayed.

    2. Run bgp as-number

      The BGP view is displayed.

    3. Run ipv6-family unicast

      The IPv6 unicast address family view is displayed.

    4. Run the following command as needed to configure BGP4+ to use a specified filter to filter the routes to be advertised to a peer.

      • To filter routes based on a basic ACL, perform the following steps:
        1. Run the peer { ipv4-address | ipv6-address | group-name } filter-policy { acl6-number | acl6-name acl6-name } export command to filter routes to be advertised based on an ACL.
        2. Run the quit command to return to the BGP view.

        3. Run the quit command to return to the system view.

        4. Run the acl ipv6 { name basic-acl6-name basic | [ number ] basic-acl6-number } [ match-order { config | auto } ] command to enter the ACL view.

        5. Run the rule [ rule-id ] [ name rule-name ] { deny | permit } [ fragment | source { source-ipv6-address { prefix-length | source-wildcard } | source-ipv6-address/prefix-length | any } | time-range time-name | [ vpn-instance vpn-instance-name | vpn-instance-any ] ] * command to configure a rule for the basic ACL.

          When the rule command is run to configure rules for a named ACL, only the source address range specified by source and the time period specified by time-range are valid as the rules.

          When a filtering policy of a routing protocol is used to filter routes:
          • If the action specified in an ACL rule is permit, a route that matches the rule will be received or advertised by the system.

          • If the action specified in an ACL rule is deny, a route that matches the rule will not be received or advertised by the system.

          • If a route has not matched any ACL rules, the route will not be received or advertised by the system.

          • If an ACL does not contain any rules, all routes matching the route-policy that references the ACL will not be received or advertised by the system.

          • In the configuration order, the system first matches a route with a rule that has a smaller number and then matches the route with a rule with a larger number. Routes can be filtered using a blacklist or a whitelist:

            Route filtering using a blacklist: Configure a rule with a smaller number and specify the action deny in this rule to filter out the unwanted routes. Then, configure another rule with a larger number in the same ACL and specify the action permit in this rule to receive or advertise the other routes.

            Route filtering using a whitelist: Configure a rule with a smaller number and specify the action permit in this rule to permit the routes to be received or advertised by the system. Then, configure another rule with a larger number in the same ACL and specify the action deny in this rule to filter out unwanted routes.

      • To use an AS_Path filter to filter routes, run the peer { ipv4-address | ipv6-address | group-name } as-path-filter { number | name } export command.

      • To use an IP prefix list to filter routes, run the peer { ipv4-address | ipv6-address | group-name } ipv6-prefix ipv6-prefix-name export command.

      • To use a route-policy for route filtering, run peer { ipv4-address | ipv6-address | group-name } route-policy route-policy-name export

      • To use an IPv6 address list to filter routes, run the peer { peerIpv4Addr | peerIpv6Addr | groupName } advertise dependent-filter dependent-filter-list outDependType [ condition-filter condition-filter-list ] command.

      A peer group and its members can use different export policies when advertising routes. This means that each member in a peer group can select its own policy when advertising routes.

    5. Run commit

      The configuration is committed.

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