Command:

distance ospf


Mode:

Router(config-router)#


Syntax:

distance ospf {[intra-area dist1] [inter-area dist2] [external dist3]}
no distance ospf

 

Syntax Description:

intra-area dist1 (Optional) Sets the distance for all routes within an area. The default value is 110.
inter-area dist2 (Optional) Sets the distance for all routes from one area to another area. The default value is 110.
external dist3 (Optional) Sets the distance for routes from other routing domains, learned by redistribution. The default value is 110.

 

Command Description:

To define OSPF route administrative distances based on route type, use the distance ospf command in router configuration mode. To restore the default value, use the no form of this command.

Defaults:

dist1: 110

dist2: 110

dist3: 110

You must specify at least one of the keyword-argument pairs.

This command performs the same function as the distance command used with an access list. However, the distance ospf command allows you to set a distance for an entire group of routes, rather than a specific route that passes an access list.

A common reason to use the distance ospf command is when you have multiple OSPF processes with mutual redistribution, and you want to prefer internal routes from one over external routes from the other.


Example:

The following example changes the external distance to 200, making the route less reliable:

Router A Configuration

Router(config)# router ospf 1
Router(config-router)# redistribute ospf 2 subnet
Router(config-router)# distance ospf external 200
!
Router(config)# router ospf 2
Router(config-router)# redistribute ospf 1 subnet
Router(config-router)# distance ospf external 200

Router B Configuration

Router(config)# router ospf 1
Router(config-router)# redistribute ospf 2 subnet
Router(config-router)# distance ospf external 200
!
Router(config)# router ospf 2
Router(config-router)# redistribute ospf 1 subnet
Router(config-router)# distance ospf external 200


Misconceptions:

None


Related Commands:

None

� Cisco Systems, Inc. 2001, 2002, 2003
World Wide Education

Converted from CHM to HTML with chm2web Pro 2.85 (unicode)