Reset Search



How to specifically redistribute external routes as Type-1 or Type-2 in OSPF?

« Go Back


TitleHow to specifically redistribute external routes as Type-1 or Type-2 in OSPF?
To redistribute non-OSPF routes as Type-1 or Type-2 in OSPF
  • Summit and Blackdiamond Series
  • EXOS All
Option 1: If you need to redistribute non-OSPF routes into OSPF as Type-1 or 2 (as indicated by the "o1" or "o2" flag in the "show ip route" output), type in the following command-
  • enable ospf export <routing protocol> cost <cost> type ase-type-1 (or) ase-type-2
Option 2: If you want to redistribute specific routes into OSPF as type-2, you can call forth a policy file.
Note: If you do not mention the cost-type in the action modifier, it will default to a type-1 route.
Step 1: Create the policy file
vi ospfexport.pol
entry one {
if match all {
nlri; <-- Specific routes to be redistributed
} then {
cost-type ase-type-2;

Step 2: Call for the policy file in the ospf export command
enable ospf export <routing protocol> ospfexport
Additional notes
The explanations for Type-1 and Type-2 redistributed routes can be found in the following article -
What's the meaning for ase-type-1 and ase-type-2 when exporting OSPF routes?

Only any one command can be used at at time for a routing protocol. For example if you want to redistribute static routes into OSPF, you can either use the global command "enable ospf export static cost <cost> type ase-type-1 (or) -2" which will export all available static routes into OSPF, or you can call for the policy file using the "enable ospf export static <policy name>" command for redistributing specific routes.



Was this article helpful?



Please tell us how we can make this article more useful.

Characters Remaining: 255