[go: up one dir, main page]

0% found this document useful (0 votes)
190 views3 pages

BGP AS Path Prepending: Lab Topology

The document describes a lab exercise on configuring BGP AS path prepending. The lab topology includes 3 routers - R1, R2, and R3. R2 and R3 are advertising the same network 8.8.8.8/32 to R1. Initially, R1 prefers the path through R2. To change this, AS path prepending is configured on R2 to prepend additional AS numbers to the path, making the path through R3 preferred by increasing its length. Route maps are used to set the AS path prepending on R2 for routes advertised to R1.

Uploaded by

Sukanda EduTech
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
190 views3 pages

BGP AS Path Prepending: Lab Topology

The document describes a lab exercise on configuring BGP AS path prepending. The lab topology includes 3 routers - R1, R2, and R3. R2 and R3 are advertising the same network 8.8.8.8/32 to R1. Initially, R1 prefers the path through R2. To change this, AS path prepending is configured on R2 to prepend additional AS numbers to the path, making the path through R3 preferred by increasing its length. Route maps are used to set the AS path prepending on R2 for routes advertised to R1.

Uploaded by

Sukanda EduTech
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Download PNETLab Platform

PNETLAB Store
PNETLab.com

BGP AS Path Prepending


Lab Topology:
The lab network topology is illustrated below:

Lab Objective:
The objective of this lab exercise is for you to learn and understand how to configure BGP AS Path
Prepending.
Task:
Above we have 3 routers. R2 and R3 are both in AS 2 advertising the same network (8.8.8.8/32)
to R1. We can use AS Path prepending to make R1 prefer a certain path.

Solution

1
Download PNETLab Platform
PNETLAB Store
PNETLab.com

Basic Configuration:

Router R1 R2
Configuration interface Loopback0 interface Loopback0
no shutdown no shutdown
ip address 1.1.1.1 255.255.255.255 ip address 8.8.8.8 255.255.255.255
! !
interface Ethernet0/0 interface Ethernet0/0
no shutdown no shutdown
ip address 10.1.12.1 255.255.255.0 ip address 10.1.12.2 255.255.255.0
! !
interface Ethernet0/1 router bgp 2
no shutdown network 8.8.8.8 mask 255.255.255.255
ip address 10.1.13.1 255.255.255.0 neighbor 10.1.12.1 remote-as 1
! !
router bgp 1
network 1.1.1.1 mask
255.255.255.255
neighbor 10.1.12.2 remote-as 2
neighbor 10.1.13.3 remote-as 2
!

Router R3
Configuration interface Loopback0
no shutdown
ip address 8.8.8.8 255.255.255.255
!
interface Ethernet0/0
no shutdown
ip address 10.1.13.3 255.255.255.0
!
router bgp 2
network 8.8.8.8 mask
255.255.255.255
neighbor 10.1.13.1 remote-as 1
!

Let’s check route 8.8.8.8/32 on R1

R1#show ip bgp
BGP table version is 3, local router ID is 1.1.1.1

2
Download PNETLab Platform
PNETLAB Store
PNETLab.com

Network Next Hop Metric LocPrf Weight Path


*> 1.1.1.1/32 0.0.0.0 0 32768 i
* 8.8.8.8/32 10.1.13.3 0 02i
*> 10.1.12.2 0 02i

In the table above you can see that it prefers 10.1.12.2 as its path. Because everything is the
same it boils down to the router ID. Let’s change the AS path so that we’ll use 10.1.13.3 as the
preferred path.

R2(config)#route-map PREPEND permit 10


R2(config-route-map)#set as-path prepend 2 2 2 2 2
R2(config-route-map)#exit
R2(config)#router bgp 2
R2(config-router)#neighbor 10.1.12.1 route-map PREPEND out

First create a route-map and use set as-path prepend to add your own AS number multiple
times. Don’t forget to add the route-map to your BGP neighbor configuration and since you are
sending this to your remote neighbor it should be outbound!

R1#show ip bgp
BGP table version is 4, local router ID is 1.1.1.1

Network Next Hop Metric LocPrf Weight Path


*> 1.1.1.1/32 0.0.0.0 0 32768 i
* 8.8.8.8/32 10.1.12.2 0 0222222i
*> 10.1.13.3 0 02i

Now we see that 10.1.13.3 is the next hop IP address that we use. You can also see that the AS Path
has become longer for the second entry.

You might also like