cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2963
Views
14
Helpful
4
Replies

Routing with Tags

ccannon88567
Level 1
Level 1

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

t-yamashita
Level 7
Level 7

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

View solution in original post

4 Replies 4

lamav
Level 8
Level 8

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

Giuseppe Larosa
Hall of Fame
Hall of Fame

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

t-yamashita
Level 7
Level 7

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

All very helpfull.

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

Thank you all very much.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Innovations in Cisco Full Stack Observability - A new webinar from Cisco