Got it

BGP AS number override

Latest reply: Dec 19, 2018 08:38:06 4955 3 10 0 0

Hi there, all!

This post explains the procedure for BGP AS number override. Please read the below-displayed information.


If the AS_Path attribute of a route to be advertised to a peer contains the number of the AS where the peer resides, the local router substitutes the AS number of the peer with the local AS number before advertising the route. On a BGP network, two devices have the same AS number and the same EBGP peer. After one of the two devices learns a route of the other device from the EBGP peer, the route is discarded because it carries an AS number that is the same as the local one. To address this problem, run the peer substitute-as command on the EBGP peer.

In case of a customer has several sites, it belong to the same agency, it all of them using the same AS number. If there not substitute the AS number, the CE will drop the packet which have its own AS number.

Below is an example of a customer with two sites with the same AS number (AS65101):



The configuration template is as per below:


bgp 65001

ipv4-family { vpn-instance vpn-instance-name |      unicast }

peer { ipv4-address | group-name      } substitute-as



1. This command is only configured on the PE side.

2. You can send the BGP Community from the CE to PE to prevent the route back to the same site.

  • x
  • convention:

Created Dec 7, 2018 07:31:16

Hello Guys!
Yes, we can solve the problem with AS_PATH BUT we also loose the network visibility. So, If you have the topology with the same AS# scattered over many sites I would recommend you to take one step further and tag all routes you send to PE-routers with specific community in the outbound direction and filter that communities in the inbound direction from PE. In complex scenarios, on PE, providers may combine CEs routers running BGP from the same customer in the peer groups,  and can happen that you may receive your routes back. This protection can be easily done with route-policy or xpl-route-filter (for NE40E). And the last thing to add, if you want send the community to your BGP peers with route-policy or xpl-route-filter, do not forget to send community to your eBGP peer with  peer X.X.X.X advertise-community .

Take care guys! This post was last edited by ViktorG at 2018-12-07 07:34.
View more
  • x
  • convention:

Created Dec 7, 2018 08:28:53

Posted by ViktorG at 2018-12-07 07:31 Hello Guys!Yes, we can solve the problem with AS_PATH BUT we also loose the network visibility. So, ...
Thanks for your suggestion
View more
  • x
  • convention:

Created Dec 19, 2018 08:38:06

This is a new knowledge for me.
View more
  • x
  • convention:


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

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


Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Please bind your phone number to obtain invitation bonus.
Information Protection Guide
Thanks for using Huawei Enterprise Support Community! We will help you learn how we collect, use, store and share your personal information and the rights you have in accordance with Privacy Policy and User Agreement.