01-10-2021 01:22 AM
I have 2 routers in 2 different AS. R1 is learning routes from the ospf 1 process. Some of these routes are tagged as 604 in OSPF. So, what I want to do it’s to advertise these tagged routes to R2 via BGP.
I thought it would be just as simple as to create a route map with the match tag 604 statement in one of its entries and then append this route map to the neighbour statement in the BGP process. However, I just discover, the match tag command is not supported in BGP (at least not in VIRL) because when I apply the route map to the neighbour statement in R1 I get the following message and notice that I am still receiving the whole of the ospf routing table from R1 when I check in R2 (192.168.125.34).
% "TAGGED" used as BGP outbound route-map, tag match not supported
% not supported match will behave as route-map with no match
Can someone suggest a way to advertise the ospf tagged routes to the neighbour R2 via BGP? I will also need to advertise a few more routes which are learnt from other BGP neighbours and the same OSPF process, but they are not tagged. These other routes are not many and can advertise them to the neighbour using a prefix-list or ACL.
R1 BGP process
router bgp 65321
bgp router-id 192.168.1.1
bgp log-neighbor-changes
timers bgp 10 30
neighbor 192.168.125.34 remote-as 65322
neighbor 192.168.126.81 remote-as 65323
!
address-family ipv4
redistribute connected
redistribute static
redistribute ospf 1 match external 1 route-map RTM-4_REDISTRIBUTE_OSPF-1
neighbor 192.168.125.34 activate
neighbor 192.168.125.34 soft-reconfiguration inbound
neighbor 192.168.126.81 activate
neighbor 192.168.126.81 soft-reconfiguration inbound
neighbor 192.168.126.81 route-map ROUTES_IN_19216812681 in
neighbor 192.168.126.81 route-map ROUTES_OUT_19216812681 out
default-information originate
exit-address-family
This route map, has various entries, one of which has the match tag 604. However, it also has other entries matc hing other tags and ACLs taht I do not want to send to the neighbour.
route-map RTM-4_REDISTRIBUTE_OSPF-1
Thank you in advance for your time.
01-10-2021 03:45 AM - edited 01-10-2021 03:45 AM
Hello
My understanding you cannot redistribute an igp prefix into bgp with a tag as bgp doesn't support it, However I am aware by default bgp redistribution into ospf does advertise bgp prefixes with the as-path asn as route tags.
After bgp redistribution into ospf -
sh ip ospf database topology | in TAG
01-10-2021 10:49 AM
Thank you Paul for your response.
I did explore this possibility after reading another post (before posting mine) but the problem is, all routes are tagged with the same asn numbe. I do not fin a way to filter out the routes that I do not want to install in the bgp table of the receiving router
Or is there something else that I am missing?
01-10-2021 07:25 AM
here some good example help you :
01-10-2021 09:11 AM
Hello @balaji.bandi
bgp automatic and set as-path tag feature was what i was adhering to however this is for originated bgp prefixes redistributed into ospf and then re-redistributing those same prefixes back into bgp from ospf
It won’t however solve redistributing originated ospf prefixes into bgp with tags this as far as i understand ( i could be wrong !) isn't applicable.
01-10-2021 10:54 AM
@paul driver agreed - I was just referring the original poster to check how that works in terms of process.
But we still do not have information as OP mentioned other routers and we do not know the content of "RTM-4_REDISTRIBUTE_OSPF-1"
good to see the output what it was supposed to what is not able to achieve need from the OP to submit here to understand the issue.
01-10-2021 10:50 AM
Thank you Balaji,
I will see the article and get back to you.
01-10-2021 09:42 AM - edited 01-10-2021 09:52 AM
You do right,
AS X
route-map use in redistribute ospf into bgp only that prefix with tag 604,
NOW, add community with NO_ADVERT "COMM_LIST" route-map OUT to AS Y
note:- only the prefix with tag will set community
AS Y
route-map IN from AS X match community "COMM_LIST" redistribute bgp into OSFP and set tag here 604.
try this way
01-10-2021 10:51 AM
Yes! I am sure this will work and it is a very good idea. However, I am not too sure how likely it's to implement it in production.
I will give it a thought and come back to you.
01-10-2021 11:10 AM
i will do lab and send the command ASAP, hop tonight
01-10-2021 12:12 PM - edited 01-10-2021 03:27 PM
I do lab it was easy
R1-R2-R3-R4
R1 static route 1.1.1.1/32 null0
R1-R2 ospf
R2-R3 BGP
R3-R4 ospf
R2
route ospf 100
net 10.0.0.0 0.0.0.255 area 0
!
router bgp 100
redistribute ospf 100 route-map OSPF-TAG-1000
neighbor 100.0.0.2 remote-as 200
neighbor 100.0.0.2 send-comm both
!
route-map OSPF-TAG-1000 permit 10
match tag 1000
set comm 100:1000
R3
router ospf 100
redistribute bgp 200 subnet route-map OSPF-TAG-1000
network 11.0.0.0 0.0.0.255 area 0
!
router bgp 200
neighbor 100.0.0.1 remote-as 100
!
ip community-list 10 permit 100:1000
!
route-map OSPF-TAG-1000 permit 10
match comm 10
set tag 1000
good luck friend
01-10-2021 09:46 AM
Hello,
I wonder if you could redistribute the tagged routes into either another OSPF process or another routing protocol, and redistribute THAT into BGP.
route-map OSPF_1_TAG_INTO_OSPF_2
match tag 101
!
router ospf 2
!
router bgp
redistribute ospf 2
or
route-map OSPF_1_TAG_INTO_EIGRP
match tag 101
!
router eigrp 1
!
router bgp
redistribute eigrp 1
01-10-2021 10:53 AM
The partial config in the original post shows 3 route maps. And we have no detail about any of the route maps. To be able to understand the situation and to offer any helpful advice, at a minimum we need details of each of the route maps and of any access lists that they reference.
The error message shown in the original post seems to indicate that the match tag is used on an outbound BGP route map. I would not expect the match tag to be on an outbound BGP route map but would expect to find the match tag on the route map for redistribution. Please provide the details that we need to understand this situation.
01-11-2021 08:48 AM
Hi Richard,
These are the contents of the route-map referenced in the BGP process of the router.
redistribute ospf 1 match external 1 route-map RTM-4_REDISTRIBUTE_OSPF-1
route-map RTM-4_REDISTRIBUTE_OSPF-1 permit 10
match tag 613
!
route-map RTM-4_REDISTRIBUTE_OSPF-1 permit 20
match tag 614
!
route-map RTM-4_REDISTRIBUTE_OSPF-1 permit 25
match tag 604
!
route-map RTM-4_REDISTRIBUTE_OSPF-1 permit 26
match ip address 8
!
route-map RTM-4_REDISTRIBUTE_OSPF-1 deny 30
!
Out of all those prefixes from ospf 1 included in the route-map above, I only want to advertise the ones tagged as 604
route-map TAGGED permit 10
match tag 604
!
But when I apply it to this neighbor I get the message below.
neighbor 192.168.125.34 route-map TAGGED out
% "TAGGED" used as BGP outbound route-map, tag match not supported
% not supported match will behave as route-map with no match
The result of this is that all the prefixes included in the following commands, get sent to the neighbor 192.168.125.34. Which I do not want.
address-family ipv4
redistribute connected
redistribute static
redistribute ospf 1 match external 1 route-map RTM-4_REDISTRIBUTE_OSPF-1
Please disregard the information related to neighbor 192.168.126.81 and let me know if you require more information.
01-11-2021 09:33 AM
Thank you for the additional information. It does help to clarify the issue. It might help if we remember that some actions are supported for some functions but that action might not be supported for other functions. Your output confirms that match tag is supported when the route map is used to control redistribution. But match tag is not supported if the route map is used to control advertisement to a neighbor.
The solution that I wold suggest would be to select a community that you will use for BGP. In the route map statement for redistribution when you match 604
route-map RTM-4_REDISTRIBUTE_OSPF-1 permit 25
match tag 604
you would add a statement to set the BGP community to the value that you selected. Then in the route map to control what is advertised to the neighbor you would match on the BGP community rather than trying to match the tag.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide