Technical Tip: Configure OSPF route tag for redistributed prefixes
Description
This article describes how to tag routes distributed by OSPF.
Solution
The example below shows commands used for redistributing static routes with a tag of 1003.
Create an access list for the prefix(s).
Before.
This article describes how to tag routes distributed by OSPF.
Solution
The example below shows commands used for redistributing static routes with a tag of 1003.
Create an access list for the prefix(s).
# config router access-listCreate a route map to match the prefix list configured above and set the tag.
edit "static_redistribute"
# config rule
edit 1
set prefix 10.147.7.49 255.255.255.255
set exact-match enable
next
end
next
end
# config router route-mapConfigure the route map under the redistribute statement.
edit "Static_redistribute"
# config rule
edit 1
set match-ip-address "static_redistribute"
set set-tag 1003
next
end
next
end
# config router ospfTo verify the tag, use the command below.
# config redistribute "static"
set status enable
set routemap "Static_redistribute"
end
end
Before.
Vigneshp # get router info ospf database self-originateAfter.
Link ID ADV Router Age Seq# CkSum Flag Route Tag
10.147.7.49 10.5.20.66 3 80000218 3853 0021 E2 10.147.7.49/32 0 <-----
Vigneshp # get router info ospf database self-originate
AS External Link States
Link ID ADV Router Age Seq# CkSum Flag Route Tag
10.147.7.49 10.5.20.66 1169 80000217 0499 0031 E2 10.147.7.49/32 1003 <-----
