Distance Command on CISCO Router/Switch

Other Cisco Other Cisco Material Original source

Command

Distance

Use

Modifies the administrative distance for RIP routes.

Syntax

Router(config-router)#distance <1-255>
OR
Router(config-router)#distance <1-255> <wildcard
bits> 

Options

The IP from which the routes are comming from
The wildcard mask
Access list

Example

First, the administrative distance for all rip routes is changed by issuing the command distance 100.

Copy

R1#conf t

Enter configuration commands, one per line. End with CNTL/Z.

R1(config)#router rip

R1(config-router)#distance 100

The rip route tables are displayed, showing the newly changed adminstrative distance.

Copy

R1(config-router)#do show ip route rip

2.0.0.0/32 is subnetted, 1 subnets

R 2.2.2.2 [100/1] via 10.1.1.2, 00:00:25, FastEthernet0/0

10.0.0.0/24 is subnetted, 2 subnets

R 10.2.2.0 [100/1] via 10.1.1.2, 00:00:25, FastEthernet0/0

Next, we’ll be changing the administrative distance of 1.1.1.1 to 80. To do this, an access list must be created first.

Copy

R2(config-router)#access-list 66 permit 1.1.1.1

R2(config-router)#distance 80 10.1.1.1 0.0.0.0 66

Here’s the rip route displaying the changed administrative distance of 1.1.1.1.

Copy

R2(config-router)#do show ip route rip

1.0.0.0/32 is subnetted, 3 subnets

R 1.1.1.1 [80/1] via 10.1.1.1, 00:00:19, FastEthernet0/0

R 1.3.3.3 [100/1] via 10.1.1.1, 00:00:19, FastEthernet0/0

R 1.2.2.2 [100/1] via 10.1.1.1, 00:00:19, FastEthernet0/0
← All Other Cisco articles Home