02-04-2022 11:48 PM
Hello Team,
One interview question, There are 4 routers- R1, R2, R3 and R4 Connected as per below diagram
We need to use BGP attribute
Solved! Go to Solution.
02-07-2022 02:31 AM - edited 02-07-2022 02:32 AM
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
02-05-2022 03:55 AM - edited 02-05-2022 04:05 AM
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
02-06-2022 09:21 PM
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.
02-06-2022 12:33 PM - edited 02-06-2022 12:35 PM
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
02-06-2022 09:13 PM
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..
02-07-2022 02:31 AM - edited 02-07-2022 02:32 AM
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide