cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
690
Views
4
Helpful
6
Replies

export route-target

Okejo
Level 1
Level 1

Hi everyone,


On IOS-XR 24.2, I’d like to configure MP-BGP in such a way that routes redistributed into MP-BGP (static, direct, OSPF) are exported with different route-targets.

I have tried using an export policy, but the issue there is that I can't specify the protocol.
I also tried doing it under MP-BGP during redistribution into the VRF, but it doesn't allow me to configure extended community route-targets.


Could you help me figure out what the solution is?

1 Accepted Solution

Accepted Solutions

Hi @Okejo ,

You can achieve your requirement with the following approach.

1. set a different community when you redistribute the connected, static and ospf routes in BGP under the vrf. For example 1:1 for connected, 1:2 for static and 1:3 for ospf routes.

2. in the export policy set the rt based on the community as follow:

route-policy export-policy
if community matches-any (1:1) then
set extcommunity rt (1:1)
endif
if community matches-any (1:2) then
set extcommunity rt (1:2)
endif
if community matches-any (1:3) then
set extcommunity rt (1:3)
endif
end-policy

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

View solution in original post

6 Replies 6

M02@rt37
VIP
VIP

Hello @Okejo 

I also tried doing it under MP-BGP during redistribution into the VRF, but it doesn't allow me to configure extended community route-targets.

--Please share the config.

Thanks 

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

I quickly made two examples

-first case:

vrf test-1
address-family ipv4 unicast
import route-target
10:100
!
route-policy export-test-1-static
if protocol is static then
set extcommunity rt 100:10
endif
set extcommunity rt 100:20
end-policy

router bgp 100
vrf test-1
rd 10:100
address-family ipv4 unicast
redistribute static


show configuration failed

vrf test-1
address-family ipv4 unicast
export route-policy export-test-1-static
!!% Could not find entry in list: Policy [export-test-1-static] uses the 'protocol' attribute. There is no 'protocol' attribute at the bgp export attach point.

-------second case:


vrf test-1
address-family ipv4 unicast
import route-target
10:100
!

route-policy test-1-static
set extcommunity rt 100:10
end-policy

router bgp 100
vrf test-1
rd 10:100
address-family ipv4 unicast
redistribute static route-policy test-1-static

show configuration failed

router bgp 100
vrf test-1
address-family ipv4 unicast
redistribute static route-policy test-1-static
!!% Could not find entry in list: Policy [test-1-static] uses 'assign rt'. 'set' is not a valid operator for the 'rt' attribute at the bgp redistribution-vrf attach point.

Hi @Okejo ,

You can achieve your requirement with the following approach.

1. set a different community when you redistribute the connected, static and ospf routes in BGP under the vrf. For example 1:1 for connected, 1:2 for static and 1:3 for ospf routes.

2. in the export policy set the rt based on the community as follow:

route-policy export-policy
if community matches-any (1:1) then
set extcommunity rt (1:1)
endif
if community matches-any (1:2) then
set extcommunity rt (1:2)
endif
if community matches-any (1:3) then
set extcommunity rt (1:3)
endif
end-policy

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

Thank you!

You are very welcome @Okejo and thanks for the feedback

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