How to configure BGP AS Path Prepending

The fourth BGP attribute is called AS Path:

  • BGP prefers the shortest AS path to get to a destination. Less is more!
  • We can manipulate this by using AS path prepending.

Let me show you an example:

bgp as path prepend

In my example AS 1 wants to make sure traffic enters the autonomous system through R2. We can add our own autonomous system number multiple times, so the as-path becomes longer. Since BGP prefers a shorter AS path, we can influence our routing. This is called AS path prepending.


Let’s see what this looks like on Cisco routers. This is the topology that I will use:

bgp as path prepend lab

Above we have 3 routers. R1 and R3 are both in AS 1 advertising the same network ( to R2. We can use AS Path prepending to make R2 prefer a certain path.

We're Sorry, Full Content Access is for Members Only...

If you like to keep on reading, Become a Member Now! Here is why:

  • Learn any CCNA, CCNP and CCIE R&S Topic. Explained As Simple As Possible.
  • Try for Just $1. The Best Dollar You’ve Ever Spent on Your Cisco Career!
  • Full Access to our 791 Lessons. More Lessons Added Every Week!
  • Content created by Rene Molenaar (CCIE #41726)

1594 Sign Ups in the last 30 days

100% Satisfaction Guaranteed!
You may cancel your monthly membership at any time.
No Questions Asked!


Forum Replies

  1. It was a good article but got confusing when you mixed up Jack with John.

  2. Hi Tony,

    Thanks, I just fixed it…the names are now correct.


  3. nice explanation !!!

  4. Hello Rene,

    Thank you for yours articles, great job :wink: . I am beginner in learning of CCNP Routing so sorry for (probably) stupid question. In your articles missing the third attribute (Self-originated). Do you plan write about that? Thank you in advance.


  5. Great example. I do have one question: Are the prepending AS numbers arbitrary or do I have to coordinate this with my ISP. In other words, does it matter if I use random AS prepends are do they have to be reserved just as I reserved my own AS.

88 more replies! Ask a question or join the discussion by visiting our Community Forum