Command:

distance


Mode:

Router(config-router)#


Syntax:

distance weight {source ip-address {source wildcard}} [ip standard access list number] | [ip standard access list name]

no distance weight {source ip-address {source wildcard}} [ip standard access list number] | [ip standard access list name]


Syntax Description:

weight

The weight argument is used to set a routing protocol's administrative distance. This can be an integer from 1 to 255. The higher the value, the lower the trust rating. Used alone, the argument weight specifies a default administrative distance that the Cisco IOS software uses when no other specification exists for a routing source. Routes with a distance of 255 are not installed in the routing table.

source ip address

(Optional) Routing source's IP address in four-part, dotted decimal notation.

source wildcard

Source wildcard mask in four-part, dotted decimal format. A bit set to 1 in the wildcard mask argument instructs the software to ignore the corresponding bit in the ip address value. A bit set to 0 in the wildcard mask instructs the software to look for a match in the corresponding bit.

ip standard access list number, ip standard access list name

Number or name of a standard IP access list to be applied to incoming routing updates.


Command Description:

The distance command is used to prioritize routing information from different sources, because some pieces of routing information may be more accurate than others. An administrative distance is a rating of the trustworthiness of a routing information source, such as an individual router or a group of routers. In a large network, some routing protocols and some routers can be more reliable than others as sources of routing information. Also, when multiple routing processes are running in the same router for IP, it is possible for the same route to be advertised by more than one routing process. By specifying administrative distance values, you enable the router to intelligently discriminate between sources of routing information. The router will always pick the route whose routing protocol has the lowest administrative distance.

Table: Default Administrative Distances

Route Source

Default Distance

Connected interface

0

Static route

1

EIGRP summary route

5

External BGP

20

Internal EIGRP

90

IGRP

100

OSPF

110

IS-IS

115

RIP

120

EGP

140

External EIGRP

170

Internal BGP

200

Unknown

255

Example:

Router(config-router)#distance 255
Router(config-router)#distance 90 192.31.7.0 0.0.0.255
Router(config-router)#distance 120 128.88.1.3 0.0.0.0

The first distance router configuration command sets the default administrative distance to 255, which instructs the router to ignore all routing updates from routers for which an explicit distance has not been set. The second distance command sets the administrative distance to 90 for all routers on the Class C network 192.31.7.0. The third distance command sets the administrative distance to 120 for the router with the address 128.88.1.3.  

Misconceptions:

The distance command does not get sent in routing updates. The command only affects routes on the local router.


Related Commands:

 

access-list

 

ip access-list standard

 

distribute-list

 

redistribute


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

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