Hà Nội: NTT03, Line 1, Thống Nhất Complex, 82 Nguyễn Tuân, Thanh Xuân, Hà Nội. ● HCM: Số 31B, Đường 1, Phường An Phú, Quận 2 (Thủ Đức), TP HCM. ===> Đơn Vị Hàng Đầu Trong Lĩnh Vực Cung Cấp Thiết Bị Security - Network - Wifi - CCTV - Conference - Máy chủ Server - Lưu trữ Storge.
Danh mục sản phẩm

Configure BGP Route Properties

Configuration Condition

Before configuring BGP route properties, ensure that:

  • BGP is enabled.
  • 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 12-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 routing 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 12-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 to compare 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 12-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

-

BGP sorts and selects MEDs according to the AS_PATH groups

bgp deterministic-med

Mandatory.

By default, do not enable BGP to sort and select MEDs according to the route AS_PATH groups.

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 12-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 12-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

-

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


  • 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-Technical 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 is. 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 12-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 12-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

-

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


  • 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-Technical 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 12-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 12-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

-

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 12-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

-

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 12-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 12-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

-

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

  • 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-Technical 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 12-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

-

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 IP address, and the next-hop property of the routes that are advertised to IBGP neighbors keeps unchanged.

note


  • When BGP is configured to use the local IP 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 IP 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 ip next-hop command to modify the next hop property.

Table 12-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

-

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


  • In configuring a route map to modify an NEXT-HOP property, you can use the set ip next-hop command to modify the NEXT-HOP property. For details, refer to Routing Policy Tools-Technical Manual-set ip 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 consists of 4 bytes, providing the properties such as NO_EXPORT, LOCAL_AS, NO_ADVERTISE, and INTERNET. The extended property consists 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 12-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

-

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


  • After neighbors are activated in VPNv4 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 12-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

-

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


  • 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-Technical Manual-set community.