Technical Tip: Configure OSPF route tag for default route originated by OSPF
Description
This article describes how to tag the default route originated by OSPF.
Solution
The example below shows commands used for redistributing the default route with a tag of 1002.
Create an access list for the prefix(s):
config router access-list
edit "Default_originate"
config rule
edit 1
set prefix 0.0.0.0 0.0.0.0
set exact-match enable
next
end
next
end
Create a route map to match the prefix list configured above and set the tag.
config router route-map
edit "Default_tag"
config rule
edit 1
set match-ip-address "Default_originate"
set set-tag 1002
next
end
next
end
Configure the route map under OSPF.
config router ospf
set default-information-originate enable
set default-information-route-map "Default_tag"
end
To verify the tag, it is possible to use the command below:
Before.
Vigneshp # get router info ospf database self-originate
AS External Link States
Link ID ADV Router Age Seq# CkSum Flag Route Tag
0.0.0.0 10.5.20.66 3 8000021b 70d6 0021 E2 0.0.0.0/0 0 <-----
After.
Vigneshp # get router info ospf database self-originate
AS External Link States
Link ID ADV Router Age Seq# CkSum Flag Route Tag
0.0.0.0 10.5.20.66 439 8000021a 2a30 0021 E2 0.0.0.0/0 1002 <-----
