In Cisco IOS, if I have a route-map entry as follows:

route-map redistribute deny 10
 match tag 65000 100

Is there a 'show' command that will give me a list of all routes that will match that stanza?

EDIT: To those thinking about using 'show ip route' and 'inc', the summary form of show ip route doesn't include tag information:

Router>show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is x.x.x.x to network

B [20/2948] via, 1d19h
B [20/0] via, 1d19h
B [20/0] via, 1d19h

It is only displayed when you provide a prefix as an argument:

route-views.oregon-ix.net>show ip route
Routing entry for
  Known via "bgp 6447", distance 20, metric 2948
  Tag 3549, type external
  Last update from 1d19h ago
  Routing Descriptor Blocks:
  *, from, 1d19h ago
      Route metric is 2948, traffic share count is 1
      AS Hops 2
      **Route tag 3549**

So one 'show ip route' command doesn't let you get information about all routes tagged with a specific tag.

  • Can you add some sample output with the standard "show ip route" command? Perhaps a properly crafted command with the "include" switch will get what you want.
    – Dave K
    May 11, 2009 at 15:30

6 Answers 6


I haven't fully tried this, but it occurs to me that you could create a dummy route process with a route-map that redistributes matches into it.

something like:

router ospf 99

redistribute bgp 6447 subnets route-map tagtest


route-map tagtest permit 10

match tag 3549


This then should show you all of the tagged routes:

router# sh ip ospf 99 database

  • 1
    Nice approach; didn't even occur to me. In fact, a 'show ip route ospf 99' would get you a normal show ip route output. I'm a little loathe to kick off a new routing process in production just for diagnostic purposes, but I think this is probably the only way to do it. May 15, 2009 at 10:07
  • 1
    As long as you don't neighbor it with anything (which would defeat the purpose and generally be a bad idea) the overhead should be minimal. Always use caution when messing with production though.
    – Peter
    May 15, 2009 at 10:59

I'm assuming OSPF here, but I beleive it's part of the show ip ospf database commands. I think the tag in the following commands is the same one you're referrign to with you're route-map.

Router# show ip ospf summary-address
OSPF Process 2, Summary-address Metric -1, Type 0, Tag 0 Metric -1, Type 0, Tag 10
  • I was thinking more in terms of BGP. In either case, I've yet to find a way that doesn't involve doing a 'show ip route' on every entry in the RIB and looking at the detailed output. :( May 9, 2009 at 21:51

Your output shows BGP, which is the only protocol I know that does this:

show ip bgp route-map redistribute

Will effectively issue a "show ip bgp" but filtered by that route-map. For the IGPs, Peter's suggestion of a dummy-process is the best I can think of.


When you want to see the route tags you need to do sh ip route and the tag will be displayed. Using a separate route map to display tags is a waste of CPU cyclyes and adds unnecessary complication.


If you are running NXOS on a Nexus rather than a more traditional IOS or IOS XE variant, you can pipe through sed in addition to the usual include, exclude, begin, and whatnot. This allows you to create the following filter to show tagged routes:

show ip route | sed -n 's/^([0-9])/\n\1/g;/\n[0-9]/{:a;N;/\n[^\w]/!ba;{/tag /p}}'

You can also modify this to show specific tags as well. For example, if I want to see routes redistributed from BGP AS 65216:

show ip route | sed -n 's/^([0-9])/\n\1/g;/\n[0-9]/{:a;N;/\n[^\w]/!ba;{/tag 65216$/p}}'

  • Additionally, you can create cli aliases on the Nexus switches. For example: cli alias name showtags show ip route | sed -n 's/^([0-9])/\n\1/g;/\n[0-9]/{:a;N;/\n[^\w]/!ba;{/tag $1/p}}' Aug 16, 2018 at 5:00

Link to Cisco IOS IP Command Reference also see Table 62 same page

The following is sample output from the show route-map command:

Router# show route-map

route-map abc, permit, sequence 10

Match clauses:

tag 1 2

Set clauses:

metric 5

route-map xyz, permit, sequence 20

Match clauses:

tag 3 4

Set clauses:

metric 6
  • That shows me the configuration of the route-map; I'm looking for a way to find all routes that match the 'match tag' statement. May 6, 2009 at 9:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.