01-21-2012 01:51 PM
Dears,
Although I have always used this command ... today is the first time I ask myself how it works
It seems I miss something
How does "match tag" works with "export map"
I am asking this cause "tag" doesnot appear except with static routes .... and export map should match on BGP routes not static routes
cause simply static routes may not be redistributed into BGP
----------------------
ip route vrf test 10.0.0.0 255.255.255.0 se1/0 tag 80
ip vrf test
rd 10283:11004
export map VPN-export
route-target export 10283:1001
route-target import 10283:1001
route-map VPN-export permit 10
match tag 80
set community no-advertise
set extcommunity rt 10283:214000
01-21-2012 07:10 PM
Hi Sherif
You are correct that "match tag" will not work for routes learnt in the VRF via BGP process and being sent into the MP-iBGP cloud.
Route-Tag works for below cases:
1. Static Routes
2. Any Routes being redistributed into OSPF Process
3. Static Routes being redistributed into EIGRP Process
(In general route-tag does not works for ISIS also same as BGP)
So now if the config posted by you is applied then only the above mentioned routes can be exported to MP-iBGP. If PE-CE was BGP then definitely no route will be exported and only local static routes matching tag 80 will be exported.
However we can send both BGP as well local static routes based on "TAG" value by including one more permit statement under route-map which will permit all the remaining routes(BGP,Connected) which do not match TAG 80..
The export-map under VRF looks for all the routes present in the VRF and does a match on them based on the criteria provided. So the routes under VRF will be connected,static ( if any) and the PE-CE routing protocol used.
Hope this helps to provide some insight in your query.
Regards
Varma
01-21-2012 10:38 PM
Thanks Varma for your reply
Actually with this setup, all routes will be exported cause of "route-target export" however static route with tag 80 will be exported with another tag due to "export-map"
My question is how export-map works
Seems to me, it works as below
1- First routes should be found in BGP ; thus static routes should be redistributed into BGP
2- Then route-map check routes in routing table not BGP table !!
OR
Another explanation that tag in static route is conveyed in BGP route (although it does not appear in "show ip bgpv4 vrf") then route-map checks routes in BGP table & not routing table
BR,
Sherif Ismail
01-22-2012 04:31 AM
Hi Sherif
Yes you are correct for the export of routes under the VRF with respect to the export-map and "route-target export".I overlooked the export behaviour with being same as import.
In my understanding the export-map will match for the routes present in the Local VRF Routing Table against the match conditions provided.If we need to match based on TAG then there should be a local static route or an OSPF External ROute or an EIGRP External Route with the corresponding tag .Static Route when redistributed under BGP looses the TAG value and thats why its not seen under the "show ip bgp vpnv4 vrf" output.
Regards
Varma
01-22-2012 11:31 AM
A friend of mine told me an explanation ... and seems to be v.logic
during redistribution of static routes into BGP, route-map set of export-map is applied
Thx Varma for your assistance
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