Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Webcast-Catalyst9k
New Member

BGP peer templates behavior

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


1 ACCEPTED SOLUTION

Accepted Solutions
Hall of Fame Super Bronze

Re: BGP peer templates behavior

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

1 REPLY
Hall of Fame Super Bronze

Re: BGP peer templates behavior

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

289
Views
0
Helpful
1
Replies
CreatePlease to create content