03-09-2012 01:03 PM - edited 03-04-2019 03:36 PM
Hi all,
When using a route-map within a BGP peer-policy template, what does happen if you override this route-map ?
Suppose we have the following configuration on our router :
router bgp 1234
template peer-policy POLICY_TEMPLATE
route-map ROUTE_MAP_1 out
exit-peer-policy
!
neighbor 10.0.0.1 inherit peer-policy POLICY_TEMPLATE
neighbor 10.0.0.1 route-map ROUTE_MAP_2 out
Which route-map is going to be applied to the outgoing advertised prefixes ? Only ROUTE_MAP_2 ?
Thanks a lot for your help.
Sam
Solved! Go to Solution.
03-09-2012 02:36 PM
It's going to only use ROUTE_MAP_2
From my lab:
Using just peer-policy
router bgp 1
template peer-policy CISCO
route-map CISCO1 out
send-community both
exit-peer-policy
!
no synchronization
bgp log-neighbor-changes
network 1.1.1.1 mask 255.255.255.255
neighbor 192.168.1.2 remote-as 2
neighbor 192.168.1.2 inherit peer-policy CISCO
no auto-summary
route-map CISCO1 permit 10
set community local-AS
!
route-map CISCO2 permit 10
set as-path prepend 1 1
Verification
sh ip bgp 1.1.1.1
BGP routing table entry for 1.1.1.1/32, version 9
Paths: (1 available, best #1, table Default-IP-Routing-Table, not advertised outside local AS)
Flag: 0x820
Not advertised to any peer
1
192.168.1.1 from 192.168.1.1 (1.1.1.1)
Origin IGP, metric 0, localpref 100, valid, external, best
Community: local-AS
Now with the route-map directly applied to the neighbor
config)#router bgp 1
Router(config-router)#neighbor 192.168.1.2 route-map CISCO2 out
Router(config-router)#do clear ip bgp * out
Router#sh ip bgp 1.1.1.1
BGP routing table entry for 1.1.1.1/32, version 10
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Flag: 0x820
Not advertised to any peer
1 1 1
192.168.1.1 from 192.168.1.1 (1.1.1.1)
Origin IGP, metric 0, localpref 100, valid, external, best
03-09-2012 02:36 PM
It's going to only use ROUTE_MAP_2
From my lab:
Using just peer-policy
router bgp 1
template peer-policy CISCO
route-map CISCO1 out
send-community both
exit-peer-policy
!
no synchronization
bgp log-neighbor-changes
network 1.1.1.1 mask 255.255.255.255
neighbor 192.168.1.2 remote-as 2
neighbor 192.168.1.2 inherit peer-policy CISCO
no auto-summary
route-map CISCO1 permit 10
set community local-AS
!
route-map CISCO2 permit 10
set as-path prepend 1 1
Verification
sh ip bgp 1.1.1.1
BGP routing table entry for 1.1.1.1/32, version 9
Paths: (1 available, best #1, table Default-IP-Routing-Table, not advertised outside local AS)
Flag: 0x820
Not advertised to any peer
1
192.168.1.1 from 192.168.1.1 (1.1.1.1)
Origin IGP, metric 0, localpref 100, valid, external, best
Community: local-AS
Now with the route-map directly applied to the neighbor
config)#router bgp 1
Router(config-router)#neighbor 192.168.1.2 route-map CISCO2 out
Router(config-router)#do clear ip bgp * out
Router#sh ip bgp 1.1.1.1
BGP routing table entry for 1.1.1.1/32, version 10
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Flag: 0x820
Not advertised to any peer
1 1 1
192.168.1.1 from 192.168.1.1 (1.1.1.1)
Origin IGP, metric 0, localpref 100, valid, external, best
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