cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
691
Views
15
Helpful
5
Replies

BGP scenario Problem:- Network prefixes should learn from both routers

Naive
Level 1
Level 1

Hello Team,

One interview question, There are 4 routers- R1, R2, R3 and R4 Connected as per below diagram

  1. Questions:- How 1.1.1.1 network reached to R3 and need to make sure 1.1.1.1 network reached through R4 if R3 will get down.[As a backup path]
  2. How 2.2.2.2 network reached to R4 and need to make sure 2.2.2.2 network reached through R3 if R4 will get down.[As a backup path]

We need to use BGP attribute

 

 

BGP.png

1 Accepted Solution

Accepted Solutions

Hello

As stated if left to default then you would accomplish failover as it is. However if you wish to apply say as-path prepending from ASN 100 towards ASN200 then below should be applicable.

 

Example1
router 1

access-list 1 permit host 2.2.2.2
route-map AS-path permit 10
match ip address 1
set as-path prepend 100 100 100

route-map AS-path permit 99

router bgp 100
neighbour 3.3.3.3 route-map As-path out


router 2

access-list 1 permit host 1.1.1.1

route-map AS-path permit 10
match ip address 1
set as-path prepend 100 100 100

route-map AS-path permit 99

router bgp 100
neighbour 4.4.4.4 route-map As-path out

 

 

Example2
As for ASN200 - ASN100  then below should be applicable using local-preference.

router 3

access-list 1 permit host 1.1.1.1

route-map Local-Pref permit 10
match ip address 1
local-preference 110

route-map Local-Pref permit 99

 

router bgp 100
neighbour 1.1.1.1 route-map Local-Pref in

 

router 4

access-list 1 permit host 2.2.2.2

route-map Local-Pref permit 10
match ip address 1
local-preference 110

route-map Local-Pref permit 99

 

router bgp 100
neighbour 2.2.2.2 route-map Local-Pref in




Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

View solution in original post

5 Replies 5

Jon Marshall
Hall of Fame
Hall of Fame

 

Question doesn't really make sense. 

 

For R1 to be able to use R2 as a backup path then they must be exchanging routes between themselves and presumably these are IBGP routes with an AD of 200. 

 

So R1 will use the routes from R3 (EBGP - AD 20) unless the link goes down then it will use R2 (AD 200) so you don't need to use any BGP attribute. 

 

If however you wanted R1 to use R2 as the main path and only use R3 as the backup path then you would use the local preference attribute to achieve that. 

 

Jon

 

Hello John,

Thank you for your reply. Just want to clarify regarding below point.

 

If however you wanted R1 to use R2 as the main path and only use R3 as the backup path then you would use the local preference attribute to achieve that. 

 

  • Instead of LP we can't use weight as it is local specific, will not travel to ibgp peer. Right ?
  • I believe we need to apply LP on Ibgp neighbor from R1 towards R2, do we require to do some other configuration. i believe we also require next-hop-self between R4 to R3. Just trying to understand complete flow from R1-R2-R4-R3 for 1.1.1.1 N/w?

 

Hello
All things being equal (default)
R3 will reach 1.1.1.1  via R1
R4 will reach 2.2.2.2  via R2

If either R1-R2 fail reachability would go via the alternative rtr that is directly connected

However you can manipulate the default by as-path/local preference attributes


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

Hello Paul,

Thank you for your reply, Could you please help to understand how we can apply Local preference/AS path attributes as per this scenario..

Hello

As stated if left to default then you would accomplish failover as it is. However if you wish to apply say as-path prepending from ASN 100 towards ASN200 then below should be applicable.

 

Example1
router 1

access-list 1 permit host 2.2.2.2
route-map AS-path permit 10
match ip address 1
set as-path prepend 100 100 100

route-map AS-path permit 99

router bgp 100
neighbour 3.3.3.3 route-map As-path out


router 2

access-list 1 permit host 1.1.1.1

route-map AS-path permit 10
match ip address 1
set as-path prepend 100 100 100

route-map AS-path permit 99

router bgp 100
neighbour 4.4.4.4 route-map As-path out

 

 

Example2
As for ASN200 - ASN100  then below should be applicable using local-preference.

router 3

access-list 1 permit host 1.1.1.1

route-map Local-Pref permit 10
match ip address 1
local-preference 110

route-map Local-Pref permit 99

 

router bgp 100
neighbour 1.1.1.1 route-map Local-Pref in

 

router 4

access-list 1 permit host 2.2.2.2

route-map Local-Pref permit 10
match ip address 1
local-preference 110

route-map Local-Pref permit 99

 

router bgp 100
neighbour 2.2.2.2 route-map Local-Pref in




Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card