Routing with Tags

Answered Question
Apr 7th, 2009

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.

Correct Answer by t-yamashita about 7 years 10 months ago

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

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 4.8 (4 ratings)
Loading.
lamav Tue, 04/07/2009 - 12:24

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 Tue, 04/07/2009 - 12:25

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

Correct Answer
t-yamashita Tue, 04/07/2009 - 22:21

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

ccannon88567 Tue, 04/07/2009 - 22:49

All very helpfull.

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

Thank you all very much.

Actions

This Discussion