cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
8415
Views
25
Helpful
9
Replies

BGP and prepending

ramilocaluag
Level 1
Level 1

Hi,

I would like to know how does prepending works in BGP environment but before that what is prepending?

could you please explain how does BGP works.

9 Replies 9

mheusinger
Level 10
Level 10

Hello,

AS path prepending will allow you to prolong the AS path by inserting your AS number several times.

A shorter AS path is prefered in BGP path selection.

This means, that you can try to influence the path selection of other ASes in the internet to send traffic back to your AS through your prefered BGP router.

It only makes sense in case you have at least two BGP peerings/connections to the Internet.

I hope this helps! Please rate all posts.

Regards, Martin

rawatmohinder
Level 1
Level 1

Hi,

Prepending means nothing but just addition... IN BGP you can use prepending in case of attribute of AS_path..

IN BGP when a router advertise a route then it will aa its Autonomous system number in route, so in the same way when this route will pass through neighbor router,neighbor router prepend its AS number in the route..

For Examle:-- Router A belongs to AS no.1, Router B belongs to AS no.2 and router C belongs to AS no.3

When A advertise a route to B then in this route A will install its AS number in the AS_path attribute of the route. now the route is in Router B routing table. When B advertise this route to C then B will prepend its own AS number in this route( means add the AS number before the AS number of router A).

So in the route AS_path attribute will be like this...

IN router C

AS_path:-- 3,2,1

Advantage:-- When the same route reaches router 1 then router 1 will check its own as number in as_path attribute. when a will find its own AS number it will drop the packet. so no loops will be created.

Thanks

Mahi

If I am correct all AS-Prepnding does is simply add its own AS # again to the route out to other interfaces ex: Router a router b router c, router a will send a tcp packet on top of layer 3 (igp) in the following format (as number source)ex: router a 65001 router b 65002 router c 65003 so basically when a router (providing it has a peer relationship) will send a packet like the following (65001, 65002) and when c sends the route outbound the packet will look like this (65001,65002,65003) obviously there is more info here(just showing a simple example here).No when we set the bgp prpend option the same route out of router c will look like this(65001,65002,65003,65001).

The best application for this option is when you have one or more links to an internet isp

Hi,

Thanks for the feedback. If its not too much could you please illustrate in a schematic way or using a diagram for to visualized it better.

Thanks again.

br,

ramil

Hi ram,

AS Path prepending is a technique of deliberately extending the AS Path length of a prefix advertisement by adding additional AS numbers into the AS Path of an advertised prefix. Normally the form of AS Path prepending uses the local AS number to perform the prepending.

Just go thro. this link explaining with an example,

http://ispcolumn.isoc.org/2005-08/as1.html

Rate if it does,

Rgs

Hi Ramil,

I've done up a quick example for you which I have attached.

Hope that helps your understanding ...

Paresh

Thank you very much, it gave me more understanding about BG prepending

One quick question, if you configured prepending, is it permanent, I mean unles somebody changes the config, the same path will be taken as long as there is prepending?

Hi,

Well, the router will continue to advertise the pre-pended routes as long you don't change the config.

However, depending on how many times you prepend your AS, changes in the global internet could mean fluctuations in which path is taken to your AS by any particular AS out on the Internet.

Hope that helps - pls do remember to rate posts that help.

Paresh

Review Cisco Networking for a $25 gift card