Administrator Guide

Layer 3 Routing Commands 1741
distance ospf
The distance ospf command sets the preference values of OSPF route types
in the router. Lower route preference values are preferred when determining
the best route. The type of OSPF route can be intra, inter, external. All the
external type routes are given the same preference value. Use the no form of
this command to reset the preference values to the default.
Syntax
distance ospf {[
intra-area dist1
]
[
inter-area dist2
]
[
external dist3
]}
no distance ospf
{
intra-area
|
inter-area
|
external
}
intra-area dist1
—Used to select the best path within an area when there
are two or more routes to the same destination from two different routing
protocols (Range: 1–255).
inter-area dist2
—Used to select the best path from one area to another
area when there are two or more routes to the same destination from two
different routing protocols (Range: 1–255).
external dist3
—Used to select the best path for routes from other routing
domains, learned by redistribution when there are two or more routes to
the same destination from two different routing protocols (Range: 1–255).
Default Configuration
The default preference value is 110 for dist1, dist2 and dist3.
Command Mode
Router OSPF Configuration mode.
Router OSPFv3 Configuration mode.
User Guidelines
There are no user guidelines for this command.
Examples
The following examples set route preference values of OSPF in the router.
console(config-router)#distance ospf intra 4
console(config-router)#distance ospf type1 19
2CSNXXX_SWUM204.book Page 1741 Monday, January 25, 2016 1:25 PM