Configuration Condition
Before configuring BGP route properties, ensure that:
- BGP is enabled.
- IPv6 BGP neighbors are configured and a session is set up successfully.
Configure the BGP Route Weight
In BGP routing, the first rule is to compare the weights of routes. The larger the weight of a route is, the higher the priority it has. The weight of a route is the local property of the device, and it cannot be transferred to other BGP neighbors. The value range of a route weight is 1-65535. By default, the weight of a route that has been learnt from a neighbor is 0, and the weights of all routes that are generated by the local device are all 32768.
Table 13-18 Configure the BGP route weight
Step
|
Command |
Description
|
Enter the global configuration mode.
|
configure terminal
|
-
|
Enter the BGP configuration mode.
|
router bgp autonomous-system
|
-
|
Configure the weight of a route of a neighbor or peer group.
|
neighbor { neighbor-address | peer-group-name } weight weight-num
|
Mandatory.
By default, the weight of a route of a neighbor is 0.
|
Configure the MED Property of a BGP Route
Multi-Exit Discriminator (MED) properties are used to select the optimal route for the traffic that enters an AS. If the other routing conditions are the same and BGP learns several routes with the same destination from different EBGP neighbors, BGP select the route with the minimum MED value as the optimal ingress.
MED sometimes is also called external metric. It is marked as a "metric" in the BGP route table. BGP advertises the MED properties of the routes that it has learnt from neighbors to IBGP neighbors, but BGP does not advertise the MED properties to EBGP neighbors. Therefore, MED properties are applicable to only adjacent ASs.
Configure BGP to allow comparing MEDs of neighbor routes from different ASs.
By default, BGP implements MED route selection only among the routes that are from the same AS. However, you can run the bgp always-compare-med command to let BGP ignore the limitation on the same AS in MED route selection.
Table 13-19 Configure BGP to allow comparing MEDs of neighbor routes from different ASs
Step
|
Command |
Description
|
Enter the global configuration mode.
|
configure terminal
|
-
|
Enter the BGP configuration mode.
|
router bgp autonomous-system
|
-
|
Configure BGP to allow comparing MEDs of neighbor routes from different ASs.
|
bgp always-compare-med
|
Mandatory.
By default, BGP allows only comparing MEDs of neighbor routes from the same AS.
|
Configure BGP to sort and select MEDs according to AS_PATH groups.
By default, BGP is not enabled to sort and select MEDs according to route AS_PATH groups. To enable the function, run the bgp deterministic-med command. In route selection, all routes are organized based on AS_PATHs. In each AS_PATH group, routes are sorted based MED values. The route with the minimum MED value is selected as the optimal route in the group.
Table 13-20 Configure BGP to sort and select MEDs according to AS_PATH groups
Step
|
Command |
Description
|
Enter the global configuration mode.
|
configure terminal
|
-
|
Enter the BGP configuration mode.
|
router bgp autonomous-system
|
-
|
Compare confederation MEDs in BGP route selection.
|
bgp deterministic-med
|
Mandatory.
By default, confederation MEDs are not compared in BGP route selection.
|
Configure to compare MEDs of routes in the local confederation.
By default, the MED values of EBGP routes from different ASs are not compared. The setting is valid for the EBGP routes of confederations. To enable comparison of MED values of routes of the local confederation, run the bgp bestpath med confed command.
Table 13-21 Configure BGP to compare MEDs of routes in the local confederation
Step
|
Command |
Description
|
Enter the global configuration mode.
|
configure terminal
|
-
|
Enter the BGP configuration mode.
|
router bgp autonomous-system
|
-
|
Configure BGP to compare MED values of routes in the local confederation.
|
bgp bestpath med confed
|
Mandatory.
By default, the MED values of routes in the local confederations will not be compared.
|
Configure a route map to modify MED properties.
In transmitting and receiving routes, you can apply a route map to modify MED properties.
Table 13-22 Configure a route map to modify MED properties
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
|
-
|
Configuring a route map to modify MED properties.
|
neighbor { neighbor-address | peer-group-name } route-map rtmap-name in | out
|
Mandatory.
By default, no route map is applied to any neighbor.
|
![note](/storage/images/Document/Maipu/note-icon.jpg)
-
In configuring a route map to modify an MED property, you can use the set metric command to modify the MED property. For details, refer to Routing Policy Tools-Command Manual-set metric.
- After the neighbor attribute-unchanged command is configured, the MED properties of neighbors cannot be changed by the route map that is applied.
Configure the Local-Preference Property of a BGP Route
Local-Preference properties are transferred only between IBGP neighbors. Local-Preference is used to select the optimal egress of an AS. The route with the maximum Local-Preference will be selected with priority.
The value range of Local-Preference is 0-4294967295. The larger the value is, the higher priority the route has. By default, the Local-Preference value of all the routes that are advertised to IBGP neighbors is 100. You can use the bgp default local-preference command or the route map to modify the Local-Preference property value.
Configure BGP to modify the default Local-Preference property.
Table 13-23 Configure BGP to modify the default local-preference property
Step
|
Command
|
Description
|
Enter the global configuration mode.
|
configure terminal
|
-
|
Enter the BGP configuration mode.
|
router bgp autonomous-system
|
-
|
Configure the default value of BGP Local-Preference property.
|
bgp default local-preference
local-value
|
Optional.
By default, the Local-Preference value is 100.
|
Configure the route map to modify the Local-Preference property.
Table 13-24 Configure the route map to modify the local-preference property
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 route map to modify the Local-Preference property.
|
neighbor { neighbor-address | peer-group-name } route-map rtmap-name in | out
|
Mandatory.
By default, the route map is not applied to any neighbor.
|
![note](/storage/images/Document/Maipu/note-icon.jpg)
-
In configuring a route map to modify the Local-Preference property, you can use the set local-preference command to modify the Local-Preference property. For details, refer to Routing Policy Tools-Command Manual-set local-preference.
Configure the AS_PATH Property of a BGP Route
Configure BGP to ignore AS_PATHs in route selection.
If the other conditions are the same, BGP selects the route with the shortest AS-PATH in route selection. To cancel route selection based on AS_PATHs, run the bgp bestpath as-path ignore command.
Table 13-25 Configure BGP to ignore AS_PATHs in route selection
Step
|
Command
|
Description
|
Enter the global configuration mode.
|
configure terminal
|
-
|
Enter the BGP configuration mode.
|
router bgp autonomous-system
|
-
|
Configure BGP to ignore AS_PATHs in route selection.
|
bgp bestpath as-path ignore
|
Mandatory.
By default, the AS_PATH values are compared in route selection.
|
Configure the number of local ASs that BGP allows to repeat.
To prevent routing loops, BGP checks the AS_PATH properties of the routes that are received from neighbors, and the routes containing the local AS number will be discarded. However, you can run the neighbor allowas-in command to allow the AS_PATH properties of the routes that the BGP receives to contain the local AS number, and you can configure the number of ASs that can be contained.
Table 13-26 Configure the number of local ASs that BGP allows to repeat
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 number of ASs that are allowed to repeat.
|
neighbor { neighbor-address | peer-group-name } allowas-in [ as-num ]
|
Mandatory.
By default, the AS_PATH properties of the routes that are received from neighbors do not allow the local AS number.
|
Configure BGP to remove the private AS number when advertising routes to neighbors.
In a large-scale BGP network, the AS_PATH properties of routes contain federation or community property. By default, BGP provides the private AS properties when it advertises routes to neighbors. To mask private network information, run the neighbor remove-private-AS command to remove the private AS number.
Table 13-27 Configure BGP to Remove the Private AS number when advertising routes to neighbors
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 remove the private AS number when advertising routes to neighbors.
|
neighbor { neighbor-address | peer-group-name } remove-private-AS
|
Mandatory.
By default, when BGP advertise routes to neighbors, it provides the private AS number.
|
Configure to check the validity of the first AS number of an EBGP route.
When BGP advertises a route to EBGP neighbors, it compresses the local AS number to the starting position of the AS_PATH, and the AS that advertises the route first is located at the end. Usually, the first AS of a route that EBGP receives must be the same as the neighbor AS number; otherwise, the route will be discarded.
Table 13-28 Configure to check the validity of the first AS number of an EBGP route
Step
|
Command |
Description
|
Enter the global configuration mode.
|
configure terminal
|
-
|
Enter the BGP configuration mode.
|
router bgp autonomous-system
|
-
|
Configure to check the validity of the first AS number of an EBGP route.
|
bgp enforce-first-as
|
Mandatory.
By default, BGP does not enable the mechanism for checking the first AS number.
|
Configure a route map to modify AS_PATH properties.
BGP supports configuring a route map to modify AS_PATH properties. You can run the set as-path prepend command to add more routing properties so as to affect neighbor routing. In using the set as-path prepend function, first use the local AS to add AS_PATH. If you use another AS, the AS must be emphasized to prevent the AS from rejecting routes that are advertised to it.
Table 13-29 Configure a Route map to modify AS_PATH properties
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 a route map to modify AS_PATH properties.
|
neighbor { neighbor-address | peer-group-name } route-map rtmap-name in | out
|
Mandatory.
By default, no route map is applied to any neighbor.
|
![note](/storage/images/Document/Maipu/note-icon.jpg)
-
In configuring a route map to modify an AS_PATH property, you can use the set as-path prepend command to modify the AS_PATH property. For details, refer to Routing Policy Tools-Command Manual-set as-path.
Configure the NEXT-HOP Property of a BGP Route
When BGP advertises routes to IBGP neighbors, it does not change the routing properties (including the NEXT-HOP property). When BGP advertises the routes that are learned from EBGP neighbors to IBGP neighbors, you can run the neighbor next-hop-self command to modify the next-hop property of the routes advertised to BGP neighbors to the local IP address. You can apply a route map to modify the next hop property.
Configure BGP to use the local IP address as the next hop of a route.
Table 13-30 Configure BGP to use the local IP address as the next hop of a 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 use the local IP address as the next hop when advertising routes.
|
neighbor { neighbor-address peer-group-name } next-hop-self
|
Mandatory.
By default, the next-hop property of the routes that are advertised to EBGP neighbors is set to the local IPv6 address, and the next-hop property of the routes that are advertised to IBGP neighbors keeps unchanged.
|
![note](/storage/images/Document/Maipu/note-icon.jpg)
-
When BGP is configured to use the local IPv6 address as the next hop of a route, if you run the neighbor update-source command to configure the source address of a TCP session, the source address is used as the next hop address; otherwise, the IP address of the output interface of the advertising device is selected as the local IPv6 address.
Configure a route map to modify NEXT-HOP properties.
BGP supports configuring a route map to modify NEXT-HOP properties. You can run the set ipv6 next-hop command to modify the next hop property.
Table 13-31 Configure a route map to modify NEXT-HOP properties
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 a route map to modify NEXT-HOP properties.
|
neighbor { neighbor-address | peer-group-name } route-map rtmap-name in | out
|
Mandatory.
By default, no route map is applied to any neighbor.
|
![note](/storage/images/Document/Maipu/note-icon.jpg)
-
In configuring a route map to modify an NEXT-HOP property, you can use the set ipv6 next-hop command to modify the NEXT-HOP property. For details, refer to Routing Policy Tools-Command Manual-set ipv6 next-hop.
Configure the Community Property of a BGP Route
When BGP advertises routes to neighbors, it can be configured to send the community property. You can apply a route map to a specified neighbor in the incoming and outgoing directions to match the community properties.
Community property is used to identify a group of routes so as to apply a routing policy to the group of routes. Two types of community property are available: standard and extended. The standard community property consist of 4 bytes, providing the properties such as NO_EXPORT, LOCAL_AS, NO_ADVERTISE, and INTERNET. The extended property consist of eight bytes, providing Route Target (RT) and Route Origin (RO) properties.
Configure BGP to advertise route community property to neighbors.
The neighbor send-community enables you to advertise standard community property or extended community property or both types of property to neighbors.
Table 13-32 Configure BGP to advertise route community property to neighbors
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 route community property to neighbors.
|
neighbor { neighbor-address | peer-group-name } send-community [ both | extended | standard ]
|
Mandatory.
By default, the community property is not advertised to any neighbor.
|
![note](/storage/images/Document/Maipu/note-icon.jpg)
-
After neighbors are activated in VPNv6 address family, standard and extended community properties are automatically advertised to neighbors.
Configure a route map to modify the community property.
BGP supports configuring a route map to modify the route community property. You can use the set communtiy to command to modify the community property.
Table 13-33 Configure a route map to modify the community property
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 a route map to modify the BGP route community property
|
neighbor { neighbor-address | peer-group-name } route-map rtmap-name in | out
|
Mandatory.
By default, no route map is applied to any neighbor.
|
![note](/storage/images/Document/Maipu/note-icon.jpg)
-
In configuring a route map to modify community property, you can use the set community command to modify the community property. For details, refer to Routing Policy Tools-Command Manual-set community.