Got it

AS_Path

Created: Jan 17, 2021 15:35:41Latest reply: Jun 9, 2021 12:35:48 599 7 2 0 0
  Rewarded HiCoins: 0 (problem resolved)

Hi all,

Can someone tell me what is AS Path? please explain me with example of it?

Appreciate all comments


Featured Answers

Recommended answer

DDSN
Admin Created Jan 18, 2021 07:28:55

  • x
  • convention:

All Answers

Hello,


An AS path is the autonomous systems that routing information passed through to get to a specified router. It indicates the origin of this route. The AS path is used to prevent routing loops in BGP. You can use this routing information to prefer one path to a destination network over another.


Example for Applying the AS-Path Attribute to a Route-Policy

Applicability

This example applies to all models of AR routers in all versions.

Networking Requirements

As shown in Figure 8-28, four routers belong to different ASs and establish EBGP connections. When RouterD sends routes to RouterA, the AS-Path attribute needs to be changed so that route from RouterA to 192.168.6.1/24 is changed.

Figure 8-28 Networking diagram of applying the AS-Path attribute to a route-policy
download?uuid=8a556240ee6a48128d5b0065194a5c58

Procedure

  1. Configure RouterA.


    #  sysname RouterA # interface GigabitEthernet1/0/0  ip address 192.168.1.1 255.255.255.0 # interface GigabitEthernet2/0/0  ip address 192.168.2.1 255.255.255.0 # interface LoopBack0  ip address 1.1.1.1 255.255.255.255 # bgp 100  router-id 1.1.1.1  //Set the router ID. You are advised to set the IP address of Loopback 0 as the router ID.  peer 192.168.1.2 as-number 200  //Specify the peer IP address and AS number.  peer 192.168.2.2 as-number 400  #  ipv4-family unicast   undo synchronization   peer 192.168.1.2 enable   peer 192.168.2.2 enable #


  2. Configure RouterB.


    #  sysname RouterB # interface GigabitEthernet1/0/0  ip address 192.168.3.1 255.255.255.0 # interface GigabitEthernet2/0/0  ip address 192.168.2.2 255.255.255.0 # interface LoopBack0  ip address 2.2.2.2 255.255.255.255 # bgp 200  router-id 2.2.2.2  peer 192.168.2.1 as-number 100  peer 192.168.3.2 as-number 300  #  ipv4-family unicast   undo synchronization   peer 192.168.2.1 enable   peer 192.168.3.2 enable #


  3. Configure RouterC.


    #  sysname RouterC # interface GigabitEthernet1/0/0  ip address 192.168.3.2 255.255.255.0 # interface GigabitEthernet2/0/0  ip address 192.168.4.2 255.255.255.0 # interface LoopBack0  ip address 3.3.3.3 255.255.255.255 # bgp 300  router-id 3.3.3.3  peer 192.168.3.1 as-number 200  peer 192.168.4.1 as-number 400  #  ipv4-family unicast   undo synchronization   peer 192.168.3.1 enable   peer 192.168.4.1 enable #


  4. Configure RouterD.


    #  sysname RouterD # interface GigabitEthernet1/0/0  ip address 192.168.1.2 255.255.255.0 # interface GigabitEthernet2/0/0  ip address 192.168.4.1 255.255.255.0 # interface GigabitEthernet3/0/0  ip address 192.168.6.1 255.255.255.0 # interface LoopBack0  ip address 4.4.4.4 255.255.255.255 # bgp 400  router-id 4.4.4.4  peer 192.168.1.1 as-number 100  peer 192.168.4.2 as-number 300  #  ipv4-family unicast   undo synchronization   network 192.168.6.0 255.255.255.0  //Configure BGP to advertise local routes.   peer 192.168.1.1 enable   peer 192.168.1.1 route-policy t1 export  //Apply a route-policy to the advertised routes.   peer 192.168.4.2 enable # route-policy t1 permit node 5  //Create a route-policy.  apply as-path 400 400 400 additive  //Add AS number 400 400 400 to the AS-Path list. #


  5. Verify the configuration.


    # Before a route-policy is applied to RouterD, run the display bgp routing-table command on RouterA. You can see that there are two BGP routes destined for 192.168.6.0/24. A route with next-hop address 192.168.2.2 has AS-Path 200 300 400, and the other route with next-hop address 192.168.1.2 has AS-Path 400. Then run the display ip routing-table command. You can see that the route with next-hop address 192.168.1.2 is preferred.

    # After a route-policy is applied to RouterD, run the display bgp routing-table command on RouterA. You can see that there are two BGP routes destined for 192.168.6.0/24. A route with next-hop address 192.168.2.2 has AS-Path 200 300 400, and the other route with next-hop address 192.168.1.2 has AS-Path 400,400,400,400. Then run the display ip routing-table command. You can see that the route with next-hop address 192.168.2.2 is preferred.


Configuration Notes

  • If no mask or mask length is specified in the network command, the IP address in the network command is considered as a classful address.

  • By default, IGP-BGP synchronization is disabled.

  • By default, peers are automatically enabled in the BGP-IPv4 unicast address family view.




Detail

https://support.huawei.com/enterprise/en/doc/EDOC1000138063/217a9db/example-for-applying-the-as-path-attribute-to-a-route-policy


Thanks


View more
  • x
  • convention:

Dear User,

- AS_Path is a list of ASs that a BGP route passes through.
- AS_Path is a very important well-known mandatory attribute in BGP.
- BGP does not accept the routes whose AS_Path attribute contains the local AS number.

path

path1


Have a good day!

View more
  • x
  • convention:

S_Noch
S_Noch Created Jun 9, 2021 08:10:28 (0) (0)
good  
DDSN
DDSN Admin Created Jan 18, 2021 07:28:55

  • x
  • convention:

Thanks everyone
View more
  • x
  • convention:

hemin88
hemin88 Moderator Author Created Jun 9, 2021 08:13:50

Good explanation from colleagues
View more
  • x
  • convention:

andersoncf1
andersoncf1 MVE Author Created Jun 9, 2021 12:35:48

Good answer from friend AS_Path-3963933-1
View more
  • x
  • convention:

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.