Got it

BGP route selection

654 0 3 0 1

Hi all,

In this post, I will show how to select routes when the AS_Path attribute lengths of two BGP routes are the same but the AS numbers are different.

First, let's draw a conclusion. After BGP load balancing is configured on a Huawei router, if the router receives two routes with the same AS_Path length but different AS numbers, load balancing cannot be implemented between the two routes because the AS_Path attributes of the two routes are different, Huawei routers do not select the optimal route based on the AS number in the AS_Path attribute. Instead, Huawei routers select the route with the smallest router ID based on the router ID of the neighbor. In V800R009, the load-balancing as-path-relax command is added. After this command is run, the two routes with the same AS_Path length but different AS numbers are used for load balancing.

Experiment topology

203100rmndr1mcnn9akddk.png

Key Configuration

RT01

interface Ethernet1/0/0

undo shutdown

ip address 10.1.2.1 255.255.255.252

interface Ethernet1/0/1

undo shutdown

ip address 10.1.3.1 255.255.255.252

bgp 100

router-id 1.1.1.1

peer 10.1.2.2 as-number 200

peer 10.1.3.2 as-number 300

ipv4-family unicast

undo synchronization

maximum load-balancing 8

peer 10.1.2.2 enable

peer 10.1.3.2 enable

RT02

interface Ethernet1/0/0

undo shutdown

ip address 10.1.2.2 255.255.255.252

bgp 200

router-id 2.2.2.2

peer 10.1.2.1 as-number 100

ipv4-family unicast

undo synchronization

network 192.168.1.0 255.255.255.0

peer 10.1.2.1 enable

ip route-static 192.168.1.0 255.255.255.0 NULL0

RT03

interface Ethernet1/0/1

undo shutdown

ip address 10.1.3.2 255.255.255.252

bgp 300

router-id 3.3.3.3

peer 10.1.3.1 as-number 100

ipv4-family unicast

undo synchronization

network 192.168.1.0 255.255.255.0

peer 10.1.3.1 enable

ip route-static 192.168.1.0 255.255.255.0 NULL0

Observation and verification

Check the routing table on RT01. You can find that the route 192.168.1.0/24 has only one next hop and does not implement load balancing, as shown in the following figure.

203101cqw3k88usqqkj8qu.png

On RT01, check detailed information about the BGP route 192.168.1.0/24. The command output shows that router-id prefers the route sent by RT02, as shown in the following figure.

203101k9uu91c2l6gk4rhg.png

To verify that Huawei devices only compare router ID, but not the AS number. After the router ID of RT02 is changed to 4.4.4.4, RT01 prefers the route sent by RT03, as shown in the following figure.

 

203101e64xaw5cc6hcfc5q.png

After the load-balancing as-path-relaxcommand is run on RT01, the route 192.168.1.0/24 is used for load balancing, as shown in the following figure.

203102hr44649pa60b3llz.png

Summary

The BGP routes with the same AS_Path attribute can be used for load balancing. Note that the AS_Path attributes of the BGP routes with the same length and AS number must be the same. When the AS_Path attribute lengths of two BGP routes are the same but the AS numbers in the AS_Path attributes are different, the Huawei device does not select routes based on the AS number. That is, the Huawei device does not discriminate routes with a larger AS number. After all, in the BGP world, AS numbers are equal regardless of their sizes.


Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.