cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3613
Views
15
Helpful
5
Replies

Prepending on import map

Peter Cresswell
Level 5
Level 5

Hi,

Is as-path prepending on an import map a tool that should be available?


I have found that on the IOS I'm testing that the prepending only applied if the same route-map is also setting local preference. Sounds like a bug to me but the bug toolkit is currently unavailable at time of posting.

The problem I wish to solve is to import overlapping routes with different route targets, with one route target's routes being preferred over another. Setting local preference would work, but I'd rather use as-path length as that is the metric we manipulate elsewhere.

If this a method that others have experience with?

Here's a test config:
ip vrf CMPA
rd 1:1
import map RM-CMPA-IMPORT
route-target export 1:1
route-target import 1:1
route-target import 1:2
!
ip vrf CMPB
rd 1:2
import map RM-CMPB-IMPORT
route-target export 1:2
route-target import 1:1
route-target import 1:2
!
router bgp 1
no synchronization
bgp log-neighbor-changes
no auto-summary
!
address-family ipv4 vrf CMPA
  no synchronization
  network 1.1.1.1 mask 255.255.255.255
exit-address-family
!
address-family ipv4 vrf CMPB
  no synchronization
  network 2.2.2.2 mask 255.255.255.255
exit-address-family
!
ip extcommunity-list standard CL-CMPA permit rt 1:1
ip extcommunity-list standard CL-CMPB permit rt 1:2
!
route-map RM-CMPA-IMPORT permit 10
match extcommunity CL-CMPB
set local-preference 100
set as-path prepend 65000 65000
!
route-map RM-CMPA-IMPORT permit 20
!
route-map RM-CMPB-IMPORT permit 10
match extcommunity CL-CMPA
set as-path prepend 65000 65000
!
route-map RM-CMPB-IMPORT permit 20
!
interface Loopback101
ip vrf forwarding CMPA
ip address 1.1.1.1 255.255.255.255
!
interface Loopback102
ip vrf forwarding CMPB
ip address 2.2.2.2 255.255.255.255
!
The following outputs show that RM-CMPA-IMPORT is applying prepending, but RM-CMPB-IMPORT is not:
GBLON-SQ41-LVG01#sh ip bgp vpnv4 vrf CMPA
BGP table version is 7, local router ID is 10.196.111.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
   Network          Next Hop            Metric LocPrf Weight Path
Route Distinguisher: 1:1 (default for vrf CMPA)
*> 1.1.1.1/32       0.0.0.0                  0         32768 i
*> 2.2.2.2/32       0.0.0.0                  0    100  32768 65000 65000 i
GBLON-SQ41-LVG01#sh ip bgp vpnv4 vrf CMPB
BGP table version is 7, local router ID is 10.196.111.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
   Network          Next Hop            Metric LocPrf Weight Path
Route Distinguisher: 1:2 (default for vrf CMPB)
*> 1.1.1.1/32       0.0.0.0                  0         32768 i
*> 2.2.2.2/32       0.0.0.0                  0         32768 i
GBLON-SQ41-LVG01#

Thanks,

Peter

5 Replies 5

Mahesh Gohil
Level 7
Level 7

Hi peter,

I have tried this scenario on two of platform (7600 and 10k) and I found i face similar problem,

without setting LP I do not see any path-prepending information in outputs.

but anyway let me try more on this , meanwhile if you can paste output of

sh ip bgp vpnv4 vrf CMPB 1.1.1.1/32     

Regards

Mahesh

Hi Mahesh,

Thank you very much for recreating the issue on those platforms. Here's the output you requested:

GBLON-SQ41-LVG01#sh ip bgp vpnv4 vrf CMPB 1.1.1.1/32
BGP routing table entry for 1:2:1.1.1.1/32, version 6
Paths: (1 available, best #1, table CMPB)
  Not advertised to any peer
  Local, imported path from 1:1:1.1.1.1/32
    0.0.0.0 (via CMPA) from 0.0.0.0 (10.196.111.3)
      Origin IGP, metric 0, localpref 100, weight 32768, valid, external, best
      Extended Community: RT:1:1
      mpls labels in/out nolabel/nolabel(CMPB)

I opened a TAC case about this last night and they are investigating too, i'll post their findings once I know. I have also found that setting a community value also allows the prepending to apply - which obviously is a much less intrusive workaround...

In your experience is changing routing metrics on an import map not a tool that is often used? Or worse, is it not advisable/supported?

Thanks,

Peter

Hi peter,

I always seen that doing something via. import-map is not functioning as per our requirement.

Sometimes we need to clear routes frequently to see affect . But we can't blame untill we have some insight outputs.

Unfortunately there is no more debug options available for troubleshooting.

Inbetween is it possible to try this with any external route. i am not able to create such scenario here.

also please let me know tac reply. i am eager to know that

regards

mahesh

aching02u
Level 1
Level 1

Hi all

I am in the same situation, do you have any info from the TAC?

thanks

regards

AC

Guys,

I believe the answer from TAC is:

CSCtj85371 Bug Details

import map with as-path prepend

Symptom:
AS_PATH prepend will only work if there is LOCAL PREF defined inside a outbound routemap. If there is only AS_PATH prepend and no LOCAL_PREF, BGP will not prepend the paths with defined AS values.
Conditions:
AS PATH prepend will not be pre-pended properly
Workaround:
Configure LOCAL_PREF along with AS_PATH prepend.

Fixed-In Fixed-in

15.0(1)M4.5

15.1(3.13)T

12.2(33)SRE3

12.2(33.2.20)SRE

15.1(1)S0.2

15.1(1.22)S

15.0(1.19)DPA12

15.1(3.8.3)PIB

15.2(0.0.12)PIL16

15.0(1)S2.3

15.1(2)T2.2

15.1(1)T2.4

15.1(3)T0.2

15.1(1)S1

15.0(1.19)DPB23

15.0(2.12)DPB1

15.0(1)SY

15.1(1)SG1.3

15.0(1)S3a

15.1(2)GC1

HTH,

Ivan.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: