Configuration Condition
Before configuring BGP route control, ensure that:
- BGP is enabled.
- IPv6 BGP neighbors are configured and a session is set up successfully.
Configure BGP to Advertise Aggregated Routes
In a large-scale BGP network, to decrease the number of routes that are advertised to neighbors or effectively control BGP routing, you can configure a BGP aggregated route.
Table 13-12 Configure BGP to advertise aggregated routes
Step
|
Command
|
Description
|
Enter the global configuration mode.
|
configure terminal
|
-
|
Enter the BGP configuration mode.
|
router bgp autonomous-system
|
-
|
Enter the BGP IPv6 unicast configuration mode
|
address-family ipv6 unicast
|
-
|
Configure BGP to advertise aggregated routes.
|
aggregate-address ipv6-prefix [ as-set / summary-only / route-map rtmap-name ]
|
Mandatory.
By default, BGP does not aggregate routes.
|
-
When configuring BGP to advertise aggregated routes, you can specify the summary-only option so that BGP advertises only aggregated routes. This decreases the number of routes that are advertised.
- You can specify the as-set option to generate aggregation routes with the AS_PATH property.
- You can also apply a route map to the aggregation routes so as to set more abundant properties for the aggregation routes.
Configure the Administrative Distance of BGP Routes
In the IP route table, each protocol controls the administrative distance of routing. The smaller the administrative distance is, the higher the priority is .BGP affects routing by specifying the administrative distances of specified network segments. The administrative distances of the routes that cover the specified network segments will be modified. Meanwhile, ACL is applied to filter the network segments that are covered by the routes, that is, only the administrative distances of the network segment that are allowed by the ACL can be modified.
The distance bgp command is used to modify the management distances of external, internal, and local BGP routes. The distance command is only used to modify the administrative distances of specified network segments. The distance command has a higher priority than the distance bgp command. The network segments that are covered by the distance command use the administrative distance that is specified by the command, while the network segments that are not covered by the distance command use the administrative distance that is specified by the distance bgp command.
Table 13-13 Configure the administrative distance of a BGP route
Step
|
Command
|
Description
|
Enter the global configuration mode.
|
configure terminal
|
-
|
Enter the BGP configuration mode.
|
router bgp autonomous-system
|
-
|
Enter the BGP IPv6 unicast configuration mode
|
address-family ipv6 unicast
|
-
|
Configure BGP to modify the default administrative distance.
|
distance bgp external-distance internal-distance local-distance
|
Optional.
By default, the administrative distance of EBGP routes is 20, the administrative distance of IBGP routes is 200, and the administrative distance of local routes is 200.
|
Configure the administrative distance of a specified network segment.
|
distance administrative-distance ipv6-prefix [ acl-num | acl-name ]
|
Configure Routing Policies in the Outgoing Direction of a BGP Neighbor
BGP route advertising or routing is implemented based on the powerful routing properties. When advertising routes to neighbors, you can apply routing policies to modify route properties or filter some routes. Currently, the routing policies that can be applied in the outgoing direction include:
- distribute-list: Distribution list.
- filter-list: AS_PATH property filtration list.
- prefix-list: IP prefix list.
- route-map: Route map.
Table 13-14 Configure routing policies in the outgoing direction of a BGP neighbor
Step
|
Command
|
Description
|
Enter the global configuration mode.
|
configure terminal
|
-
|
Enter the BGP configuration mode.
|
router bgp autonomous-system
|
-
|
Enter the BGP IPv6 unicast configuration mode
|
address-family ipv6 unicast
|
-
|
Apply the distribution list in the outgoing direction.
|
neighbor { neighbor-address | peer-group-name } distribute-list {access-list-num | access-list-name } out
|
You can select multiple options. (However, the distribution list and the IP prefix list cannot be configured at the same time.)
By default, no routing policy is configured in the outgoing direction of a BGP neighbor.
|
Apply the AS_PATH property filtration list in the outgoing direction.
|
neighbor { neighbor-address | peer-group-name } filter-list aspath-list-name out
|
Apply the IP prefix list in the outgoing direction.
|
neighbor { neighbor-address | peer-group-name } prefix-list prefix-list-name out
|
Apply a route map in the outgoing direction.
|
neighbor { neighbor-address | peer-group-name } route-map rtmap-name out
|
-
After configuring the routing policy in the outgoing direction of a BGP neighbor, you need to reset the neighbor to validate the settings.
- If you apply a route map in the outgoing direction of a route reflector, this changes only the NEXT-HOP property.
- For how to configure a filtration list, refer to the "Configure AS-PATH" section of the "Routing Policy Tools" chapter.
- In configuring routing policies in the outgoing direction of a BGP neighbor, you can configure multiple policies at the same time. BGP applies routing policies in the sequence of distribute-list, filter-list, prefix-list, and route-map. If a former policy is rejected, the latter policies will not be applied. The routing information can be advertised only after it passes all the configured policies.
- The route map that is applied in the outgoing direction of a BGP route supports match options, including as-path, community, extcommunity, ipv6 address, ip nexthop, and metric, and it supports the set options, including as-path, comm-list, community, extcommunity, ipv6 next-hop, local-preference, metric, origin, and weight.
Configure Routing Policies in the Incoming Direction of a BGP Neighbor
BGP can apply routing policies to filter received routing information or modify route properties. Similar to the policies applied in the outgoing directions, four polices are applied in the incoming directions:
- distribute-list: Distribution list.
- filter-list: AS_PATH property filtration list.
- prefix-list: IPv6 prefix list.
- route-map: Route map.
Table 13-15 Configure Routing Policies in the Incoming Direction of a BGP neighbor
Step
|
Command
|
Description
|
Enter the global configuration mode.
|
configure terminal
|
-
|
Enter the BGP configuration mode.
|
router bgp autonomous-system
|
-
|
Enter the BGP IPv6 unicast configuration mode
|
address-family ipv6 unicast
|
-
|
Apply the distribution list in the incoming direction.
|
neighbor { neighbor-address | peer-group-name } distribute-list { access-list-num | access-list-name } in
|
You can select multiple options. (However, the distribution list and the IP prefix list cannot be configured at the same time.)
By default, no policy is applied in the incoming direction.
|
Apply the AS_PATH property filtration list in the incoming direction.
|
neighbor { neighbor-address | peer-group-name } filter-list aspath-list-name in
|
Apply the IP prefix list in the incoming direction.
|
neighbor { neighbor-address | peer-group-name } prefix-list prefix-list-name in
|
Apply a route map in the incoming direction.
|
neighbor { neighbor-address | peer-group-name } route-map rtmap-name in
|
-
After configuring the routing policy in the incoming direction of a BGP neighbor, you need to reset the neighbor to validate the settings.
- In configuring routing policies in the incoming direction of a BGP neighbor, you can configure multiple policies at the same time. BGP applies routing policies in the sequence of distribute-list, filter-list, prefix-list, and route-map. If a former policy is rejected, the latter policies will not be applied. A route can be added into the database after it passes all the configured policies.
- The routing policies applied in the incoming direction of a BGP route support match options, including as-path, community, extcommunity, ipv6 address, ipv6 nexthop, and metric, and they support the set options, including as-path, comm-list, community, extcommunity, ipv6 next-hop, local-preference, metric, origin, and weight.
Configure the Maximum Number of Routes that a BGP Receives from a Neighbor
You can limit the number of routes that a BGP receives from a specified neighbor. Once the number of routes the BGP receives from the neighbor reaches a threshold, an alarm is generated or the neighbor is disconnected.
Table 13-16 Configure the maximum number of routes that a BGP Receives from a neighbor
Step
|
Command
|
Description
|
Enter the global configuration mode.
|
configure terminal
|
-
|
Enter the BGP configuration mode.
|
router bgp autonomous-system
|
-
|
Enter the BGP IPv6 unicast configuration mode
|
address-family ipv6 unicast
|
-
|
Configure the maximum number of routes received by the neighbor.
|
neighbor { neighbor-address | peer-group-name } maximum-prefix prefix-num [ threshold-value ] [ warning-only ]
|
Mandatory.
By default, the number of routes received by the neighbor.
|
-
If the warning-only option is not specified, after the number of routes that the BGP receives from the neighbor reaches the maximum number, the BGP session is automatically disconnected.
- If the warning-only option is specified, after the number of routes that the BGP receives from the neighbor reaches the maximum number, a warning message is displayed, but route learning continues.
Configure the Maximum Number of BGP Load Balancing Routes
In a BGP networking environment, if several paths with the same cost are available to reach the same destination, you can configure the number of BGP load balancing routes for load balancing.
Table 13-17 Configure the Maximum number of BGP load balancing routes
Step
|
Command
|
Description
|
Enter the global configuration mode.
|
configure terminal
|
-
|
Enter the BGP configuration mode.
|
router bgp autonomous-system
|
-
|
Enter the BGP IPv6 unicast configuration mode
|
address-family ipv6 unicast
|
-
|
Configure the maximum number of IBGP load balancing routes.
|
maximum-paths ibgp number
|
Mandatory.
By default, IBGP does not support load balancing routes.
|
Configure the maximum number of EBGP load balancing routes.
|
maximum-paths number
|
Mandatory.
By default, EBGP does not support load balancing routes.
|
-
After the maximum number of EBGP load balancing routes is configured, load balancing takes effect only when EBGP routes are selected with priority.
- In different BGP configuration modes, the commands for configuring the maximum number of load balancing routes are different. For details, refer to the description of maximum-paths in the BGP technical manual.