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:
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:
Above we have 3 routers. R1 and R3 are both in AS 1 advertising the same network (184.108.40.206/24) to R2. We can use AS Path prepending to make R2 prefer a certain path.