route target rewrite behaviour

I haven't really played around with these on a Cisco much, only other vendors and I see some unusual behaviour.  Can someone clarify please?

R1 ---- R2 ---- R3 ---- R4

|--as12--|       |--as34--|

I am announcing loopback1s on each of these routers with R1/2 setting RT of 1:2 and R3/4 setting 3:4

On R2 I have the following policy:

router bgp 12 

neighbor 3.3.3.3 route-map extcommin in
ip extcommunity-list 1 permit rt 3:4
route-map extcommin permit 10
 match extcommunity 1
 set extcomm-list 1 delete
 set extcommunity rt  1:2 additive

When I clear the BGP session on R2 I see the prefixes from AS34 being denied due to ext comm not supported so I though maybe the rewrite doesnt occur until the prefix is accepted as this is generally an ASBR type set up. I configured 'no bgp default route-target filter' on R2 and cleared the session. low and behold the prefixes come in and are rewritten correctly.  The documentation isn't hugely detailed on this.  Do you need to configure the no bgp default route-target filter command or have I missed something? The doc says its configurable on PEs too so I dont see why it should require this command given the logic of a PE and keeping memory usage to a minimum

Comments

  • Do you have a VRF configured with the route-target import 3:4 on R2?  

     

    In order to prevent the route target filtering I believe you must either be importing the RT or you must disable the filtering of all route targets.  It sounds like you solved it by disabling filtering for all RTs but I think you could have also configured a VRF which was importing that specific RT value.

  • OK I think that answers it, thanks. So the ASBR if not importing via RT filter or local VRF will not alter the comm value and forward on to its internal peers?

  • I do not believe you can change the RT filtering decision with an extcommunity-list.  The router must be importing the RT before it can be acted on.

  • I do not believe you can change the RT filtering decision with an extcommunity-list.  The router must be importing the RT before it can be acted on.

    I think that's right. I could be wrong but the RT filtering logic applies first before route-map. In XR, you can configure extcommunity-set and associate in "retain route-target" command; haven't tried in IOS.

    Regards,

    AB.

Sign In or Register to comment.