Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

Routing with Tags

Please could somebody explain why I would append a tag to static routes within a configuration.

I am using OSPF and the statics are redistributed throughout the OSPF network.

Example;

ip route 192.168.80.0 255.255.255.0 172.16.10.1 tag 7 name TEST

Is it something to do with how it is distributed or advertised?

Yet to do BSCI so I have no clue.

Many thanks,

Carlton.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Routing with Tags

if you specify a tag the command is easy to configuraion something like metric as follows.

--- R1 ----

router ospf 1

log-adjacency-changes

redistribute static subnets route-map TEST

network 192.168.1.0 0.0.0.255 area 0

!

ip route 1.1.1.0 255.255.255.0 Null0 tag 9

ip route 2.2.2.0 255.255.255.0 Null0 tag 8

!

route-map TEST permit 10

match tag 9

set metric 100000

!

route-map TEST permit 20

--- R2 ----

sh ip route

O E2 1.1.1.0 [110/100000] via 192.168.1.254, FastEthernet0/0

O E2 2.2.2.0 [110/20] via 192.168.1.254, FastEthernet0/0

HTH

4 REPLIES
Blue

Re: Routing with Tags

Carlton:

Typically, a route tag is used to mark a route and then apply policies to routes that bare that tag. It is usually used in a mutual redistribution topology to prevent routing loops.

So...

Lets say BGP is being redistributed into OSPF by two CE edge routers, as is done in a typical MPLS VPN environment.

Router R1 will learn the BGP prefixes and tag them as it redistributes them into OSPF.

R2, which sits on the same subnet and is an OSPF neighbor of R1, will learn about those OSPF external routes from R1 (O E2, by default). Those routes will carry a tag and R2's redistribution process will have a dependency statement that blocks the redistribution of those tagged routes back into the BGP domain.

R2, in turn, will also tag its redistributed BGP routes and R1 will deny redistribution back into the BGP domain to routes that bare that tag.

The purpose of doing all this is to prevent routing loops.

HTH

Victor

Hall of Fame Super Silver

Re: Routing with Tags

Hello Carlton,

a possible reason is that the route-tag configured in the static route is then carried in the route tag field of the OSPF LSA of type 5.

you can check this using

sh ip ospf database external 192.168.80.0

in this way in some other part of OSPF domain a decision about if it is wise to redistribute the route to another protocol or not can be taken using this route tag value

Hope to help

Giuseppe

Re: Routing with Tags

if you specify a tag the command is easy to configuraion something like metric as follows.

--- R1 ----

router ospf 1

log-adjacency-changes

redistribute static subnets route-map TEST

network 192.168.1.0 0.0.0.255 area 0

!

ip route 1.1.1.0 255.255.255.0 Null0 tag 9

ip route 2.2.2.0 255.255.255.0 Null0 tag 8

!

route-map TEST permit 10

match tag 9

set metric 100000

!

route-map TEST permit 20

--- R2 ----

sh ip route

O E2 1.1.1.0 [110/100000] via 192.168.1.254, FastEthernet0/0

O E2 2.2.2.0 [110/20] via 192.168.1.254, FastEthernet0/0

HTH

New Member

Re: Routing with Tags

All very helpfull.

As I suspected, more than one reason to apply tags.

Thank you all very much.

249
Views
14
Helpful
4
Replies