Configuration Example 5: Redistributing Subnet Routes into OSPF as Type 1 Routes Using a Specific Metric and Route Tag
A route tag is a 32-bit value that is attached to the redistributed routes. Every route that is redistributed will be assigned the same route tag unless a route map is used (see Section 14-6). OSPF itself does not use the route tag, but you can use the tag value to implement policy decisions. For example, in Section 14-6, the tag value is used to determine which routes will be redistributed into OSPF based on their tag values. This example presents only the mechanics of assigning the tag. Modify the configuration on Router B to redistribute the EIGRP routes with a tag value of 555.
Router B router ospf 1 redistribute eigrp 1 metric 66 metric-type 1 subnets tag 555
The tag value can be verified by examining a particular route in the IP routing table on Router A.
rtrA#show ip route 188.8.131.52 Routing entry for 184.108.40.206/8 Known via "ospf 1", distance 110, metric 1628 Tag 555, type extern 1 Last update from 10.1.1.2 on Serial0/1, 00:03:57 ago Routing Descriptor Blocks: * 10.1.1.2, from 220.127.116.11, 00:03:57 ago, via Serial0/1 Route metric is 1628, traffic share count is 1
The tag value can also be verified by inspecting the external routes in the OSPF database on either Router A or B.
rtrA#show ip ospf database external 18.104.22.168 OSPF Router with ID (22.214.171.124) (Process ID 1) Type-5 AS External Link States Routing Bit Set on this LSA LS age: 313 Options: (No TOS-capability, DC) LS Type: AS External Link Link State ID: 126.96.36.199 (External Network Number ) Advertising Router: 188.8.131.52 LS Seq Number: 8000002A Checksum: 0x8D02 Length: 36 Network Mask: /8 Metric Type: 1 (Comparable directly to link state metric) TOS: 0 Metric: 66 Forward Address: 0.0.0.0 External Route Tag: 555
rtrB#show ip ospf database external 184.108.40.206 OSPF Router with ID (220.127.116.11) (Process ID 1) Type-5 AS External Link States LS age: 373 Options: (No TOS-capability, DC) LS Type: AS External Link Link State ID: 18.104.22.168 (External Network Number ) Advertising Router: 22.214.171.124 LS Seq Number: 8000002A Checksum: 0x2ECF Length: 36 Network Mask: /16 Metric Type: 1 (Comparable directly to link state metric) TOS: 0 Metric: 66 Forward Address: 0.0.0.0 External Route Tag: 555
Verify that there is a neighbor relationship between the OSPF routers by using the show ip ospf neighbors command.
Verify that the redistribute command is referencing the correct routing process and process number (if applicable).
Remember the defaults: metric = 20 (1 for BGP), metric type = 2, tag = 0.
To avoid problems associated with mutual redistribution, either use a distribute list (see Sections 7-5, 7-10, and 7-15) or a route map (see Section 14-6) to allow only routes that originated in the routing process domain.
For example, if on the same router, EIGRP is redistributed into OSPF and OSPF is redistributed into EIGRP, then OSPF routes will be redistributed back into OSPF from EIGRP and EIGRP routes will be redistributed back into EIGRP from OSPF. Use a route map or distribute list to prevent this from occurring.