cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3047
Views
8
Helpful
19
Replies

BGP network command add extcommunity

ez9
Level 1
Level 1

Hello,

I am trying to "tag" with an extcomm a route via a route-policy in network command and I am getting the following error:

router bgp 65501
address-family ipv4 unicast
network 192.168.0.0/24 route-policy TAG_INBOUND(EXT_1, EXT_2, EXT_3)
!!% Could not find entry in list: Policy [TAG_INBOUND] uses 'add rt'. 'set' is not a valid operator for the 'rt' attribute at the bgp network-dflt attach point.

The command that I used is the following

router bgp 65501

address-family ipv4 unicast

network 192.168.0.0/24 route-policy TAG_INBOUND(EXT_1, EXT_2, EXT_3)

The route-policy is the following:

route-policy TAG_INBOUND($VAR1, $VAR2, $VAR3)
set extcommunity rt $VAR1 additive
set extcommunity rt $VAR2 additive
set extcommunity rt $VAR3 additive
end-policy

Any thoughts?

19 Replies 19

Harold Ritter
Spotlight
Spotlight

Hi @ez9 ,

the route target extended community is used in the l3vpn context. You can use an export route-policy under the vrf xxx configuration to set it. It is not valid in the context where you are trying to use it.

Regards,

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

Hi @MHM Cisco World ,

It is more common to configure it using an export route-policy under the VRF as follow:

RP/0/0/CPU0:ios#sh runn vrf
vrf test
address-family ipv4 unicast
import route-target
109:1
!
export route-policy test
export route-target
109:1
!
!
!

RP/0/0/CPU0:ios#sh runn route-policy test
route-policy test
set extcommunity rt test
end-policy
!

Regards,

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

SUPER ANSWER ALWAYS 

ez9
Level 1
Level 1

Hello,

Thank you for your answers. I don't have VRF configured and I am not using l3vpn. I just want the route target extended community to tag some routes. So, if I understand correctly I can't use the extended community in network command. I should only use standard communities.

Yes,
the VPNv4 is change only the protocol add RT to prefix.

sure you can use community but be sure to make routers send community (meaning add commend for send community).

Hi @ez9 ,

This is not really te purpose of extended communities. What are you trying to achieve? Why don't you use regular communities to tag the routes?

Regards,

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

Thanks for the answer. The use case is in an IXP where I should tag the prefixes with extended communities (because of 32bit ASN). 

eg: https://www.ams-ix.net/ams/documentation/ams-ix-route-servers

Hi @ez9 ,

Thanks for the additional information. It is really helpful. I just checked and although it is not possible to set the rt extended community using the network statement route-policy, it is possible to set it using and outbound policy. 

Also, according to the following statement from the page you sent, it looks like the preferred approach is to use the large community.

"Please note that AMS-IX is planning to drop the support for the Extended communities as their functionality is fully covered from the Large communities."

Large communities are supported in XR and they can even be applied using the network statement like in you original post.

route-policy test
set large-community (66000:65535:65535)
end-policy
!

router bgp xxx

address-family ipv4 unicast

network x.x.x.x/32 route-policy test

neighbor a.b.c.d

address-family ipv4 unicast

send-community-ebgp

Regards,

 

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

ez9
Level 1
Level 1

Are you sure that only VPNv4 af can add RT communities? I am using rpl that adding ext rt communities on inbound ipv4 af neighbors.

VPNv4 add RT to prefix if your need to advertise prefix from router to router 
also you can use RT in same router for VRF-leaking. 

Hi @MHM Cisco World ,

This is not a VPNv4 scenario. Please refer to the following document provided by @ez9 and to the solution I provided in this thread.

https://www.ams-ix.net/ams/documentation/ams-ix-route-servers

Regards,

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

if you have 
R1-R3-R2
in R1 you have multi VRF <<- between VRF in same router here RT use for leaking 
in R2 you have multi VRF <<- between VRF in same router here RT use for leaking 

NOW if he want to advertise VRF from R1 to R2, he need VPNv4 (which I called it neutral since no vrf config in VPNv4 but it carry prefix that it vrf-aware (via RT) 


the route server is only forward the prefix it have not effect how we config RT. 
so if he config R3 then he must config VPNv4 and R3 will forward any prefix from R1 to R2. 
so if the prefix is with RT then the R3 will forward it as it. 

Hi @MHM Cisco World ,

This is not a VPNv4 nor a VRF setup. The goal is to use the rt extended community to propagate the 4 byte ASN to the internet exchange route server, since regular communities only handle 2 byte ASN. What I found is that it is possible indeed to attach a rt to an "ipv4 unicast" advertisement, but this is just a workaround as I see it.

The better way to achieve the original poster's goal is to attach a large community (RFC8092) to the ipv4 unicast prefix. This is supported in XR.

Regards,

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