05-10-2023
09:41 AM
- last edited on
05-14-2023
09:49 PM
by
Translator
Hello Everyone,
I am working on an issue involving redundant routing, where multiple sites are advertising routes to the same third-party vendor subnets via BGP, but pointing to different next-hop addresses for redundancy.
To make the backup routes less preferred than the primary routes, I want to apply a
route-map
to these third-party vendor subnets to prepend the site's AS number multiple times. While I know that a
route-map
can be applied to a BGP neighbor, in this case I only want to apply the
route-map
to the third-party vendor subnets advertised at this site, but not the LAN subnets at this site.
So the basic config looks like this:
router bgp 3
network 10.25.0.0 mask 255.255.0.0 route-map RM_EXAMPLE_1
network 10.27.0.0 mask 255.255.0.0 route-map RM_EXAMPLE_1
network 172.20.0.0 mask 255.255.255.0
route-map RM_EXAMPLE_1
set as-path prepend 3 3 3 3 3 3
Will this configuration apply the AS-path prepending to 10.25.0.0/16 and 10.27.0.0/16? Or would I have to use a match statement within the
route-map
configuration in order to do that, something like this?
router bgp 3
network 10.25.0.0 mask 255.255.0.0
network 10.27.0.0 mask 255.255.0.0
network 172.20.0.0 mask 255.255.255.0
route-map RM_EXAMPLE_1
match ip address 20
set as-path prepend 3 3 3 3 3 3
access-list 20 permit 10.25.0.0 0.0.255.255
access-list 20 permit 10.27.0.0 0.0.255.255
If the latter is the case, then why does the BGP network statement allow for including a
route-map
?
EXMPL_RTR(config-router)#network 10.25.0.0 mask 255.255.0.0 ?
backdoor Specify a BGP backdoor route
route-map Route-map
to modify the attributes
<cr>
The issue I'm facing is that I'm attempting this kind of configuration - specifying the
route-map
on the network statement, with no match statement in the
route-map
but it doesn't appear to be performing the prepending, when I believe it should.
Appreciate any insight!
Solved! Go to Solution.
05-10-2023
10:45 AM
- last edited on
05-14-2023
09:52 PM
by
Translator
Hi @Alpha Rafael ,
Setting the as-path prepending using a
route-map
applied to the network statement is not supported. You will need to apply the
route-map
on the neighbor statement as such.
> why does the BGP network statement allow for including a
route-map
?
There are many other parameters you can set through the
route-map
applied to the network statement, such as local preference, weight, communities, metric, etc.
Regards,
05-10-2023
10:45 AM
- last edited on
05-14-2023
09:52 PM
by
Translator
Hi @Alpha Rafael ,
Setting the as-path prepending using a
route-map
applied to the network statement is not supported. You will need to apply the
route-map
on the neighbor statement as such.
> why does the BGP network statement allow for including a
route-map
?
There are many other parameters you can set through the
route-map
applied to the network statement, such as local preference, weight, communities, metric, etc.
Regards,
05-11-2023
07:41 AM
- last edited on
05-14-2023
09:54 PM
by
Translator
Hi Harold,
Thanks for that explanation!
Based on that, I have an idea of how to accomplish my original goal - perform AS-path prepending on the third-party vendor subnets advertised at this site, but not the LAN subnets at this site.
access-list 20 permit 10.25.0.0 0.0.255.255
access-list 20 permit 10.27.0.0 0.0.255.255
route-map RM_EXAMPLE_1 permit 10
match ip address 20
set as-path prepend 3 3 3 3 3 3
route-map RM_EXAMPLE_1 permit 20
router bgp 3
network 10.25.0.0 mask 255.255.0.0
network 10.27.0.0 mask 255.255.0.0
network 172.20.0.0 mask 255.255.255.0
neighbor 1.2.3.4 remote-as 99
neighbor 1.2.3.4 route-map RM_EXAMPLE_1 out
neighbor 1.2.3.4
route-map RM_EXAMPLE_1
out will apply the
route-map
to this BGP neighbor. The
route-map
itself will be processed like an ACL, from top to bottom for each subnet. So the permit 10 statement, with the match statement set to reference ACL 20, will only perform the set operation to the third-party vendor subnets. The permit 20 statement will then catch all other subnets, namely my LAN subnets, so that they will still be advertised, but the prepending will not be performed on them.
I will attempt this configuration tonight and follow-up to let everyone know how it went.
05-11-2023 07:51 AM
Hi @Alpha Rafael ,
The configuration looks good. Please keep us posted.
Regards,
05-12-2023 06:05 AM
To follow up, this worked precisely as desired. The prepending is being performed on the third-party vendor subnets, but not on our LAN subnets at this site. After making the changes, I had to clear the BGP session, and they took effect after the session was restored.
Thanks again, Harold!
05-10-2023
10:50 AM
- last edited on
05-14-2023
09:56 PM
by
Translator
This is not real network it summary network toward null0 ?
If yes then use aggreate command' with aggreate command you can use
route-map
05-10-2023
11:11 AM
- last edited on
05-14-2023
09:58 PM
by
Translator
Hello @Alpha Rafael,
Manipulate BGP path attribute.
Traffic Control:
Route-map
applied in OUT with these bgp artributes:
-weight (Cisco proprietary)
-Local-Preference
Route-map
applied in IN with these bgp attributes:
-MED
-AS-PATH (prepend)
- Community
https://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/13753-25.html
05-12-2023
12:39 AM
- last edited on
05-14-2023
09:59 PM
by
Translator
Hello
You need to append the
route-map
within the bgp process to the neighboring peer and not on the network statement
Lastly you shouldn't need to specify a match statement , if you wish to catch all the prefixes to pre-prepend
router bgp xx
neighbor x.x.x.x route-map RM_EXAMPLE_1 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