01-20-2024 08:45 AM
Hello!!
In my network, I have four routers (R1, R2, R3, and R4), and I am utilizing BGP for routing.
The objective is to ensure that all traffic from R4 to the destination 8.8.8.8 follows the path through R3 as the primary route, with R2 acting as the backup route.
I am attempting to achieve this goal by modifying the AS-Path attribute.
Current Scenario:
-----------------------------
R4#traceroute 8.8.8.8 source 4.4.4.4
Type escape sequence to abort.
Tracing the route to 8.8.8.8
VRF info: (vrf in name/id, vrf out name/id)
1 24.24.24.2 0 msec 2 msec 1 msec
2 12.12.12.1 0 msec 1 msec *
-----------------------------
I am seeking guidance on how to modify the AS-Path attribute on R4 to accomplish this goal. Additionally, if there are alternative methods to achieve the same objective, such as configuring static routes, please provide insights.
I appreciate any assistance or suggestions you can provide.
Thank you!
01-20-2024 09:04 AM
this done in R1
ip prefix-list 8.8.8.8 seq 5 permit 8.8.8.8/32
ip prefix-list 4.4.4.4 seq 5 permit 4.4.4.4/32
route-map MHM permit 10
match ip address prefix 8.8.8.8
set as-path prepend 100 100
route-map MHM2 permit 10
match ip address prefix 4.4.4.4
set weight 1000
router bgp 100
neighbor R3 route-map MHM2 in
neighbor R2 route-map MHM out
MHM
01-22-2024 09:57 AM
Thank you for your reply. I will try to configure the instructions you provided. If there are any further questions, please guide me. Thank you.
01-22-2024 09:58 AM
you are so welcome
MHM
01-22-2024 10:04 AM
Additionally, I would like to ask for your assistance. If I am operating from the R1 router (with the network topology modeled from the perspective of my company), how should I configure the commands? Kindly provide guidance, and I sincerely appreciate your help!
01-20-2024 09:51 AM
To influence the path selection in BGP, you can manipulate the AS-Path attribute. AS-Path attribute is a list of AS numbers that the route has traversed, and routers tend to prefer paths with fewer AS hops. To achieve your goal of making R3 the primary path and R2 the backup path, you can artificially lengthen the AS-Path through R2.
R4(config)# ip prefix-list PREFIX-LIST-R8 seq 5 permit 8.8.8.8/32
R4(config)# router bgp YOUR_ASN
R4(config-router)# neighbor 12.12.12.1 route-map MODIFY-AS-PATH out
R4(config)# route-map MODIFY-AS-PATH permit 10
R4(config-route-map)# match ip address PREFIX-LIST-R8
R4(config-route-map)# set as-path prepend 2 2 2 2 2 2 2
01-22-2024 10:00 AM
Thank you for your reply. I will attempt to configure the instructions you provided. I have a question to ask: in the instructions you provided, should it be "R4(config-router)# neighbor 24.24.24.2 route-map MODIFY-AS-PATH out" instead of "R4(config-router)# neighbor 12.12.12.1 route-map MODIFY-AS-PATH out"?
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