cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1756
Views
5
Helpful
7
Replies

Applying a Route-Map Directly to BGP Network Statement

Alpha Rafael
Level 1
Level 1

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!

1 Accepted Solution

Accepted Solutions

Harold Ritter
Spotlight
Spotlight

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,

Regards,
Harold Ritter, CCIE #4168 (EI, SP)

View solution in original post

7 Replies 7

Harold Ritter
Spotlight
Spotlight

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,

Regards,
Harold Ritter, CCIE #4168 (EI, SP)

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.

Hi @Alpha Rafael ,

The configuration looks good. Please keep us posted.

Regards,

Regards,
Harold Ritter, CCIE #4168 (EI, SP)

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!

This is not real network it summary network toward null0 ?

If yes then use aggreate command' with aggreate command you can use

route-map

M02@rt37
VIP
VIP

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

 

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

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

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