Changing Administrative Distances
Problem
You want to change the administrative distance for an external network.
Solution
You use the distance command to adjust the administrative distance for a particular routing protocol. The precise syntax depends on the routing protocol. This example uses RIP:
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z. Router(config)#router rip
Router(config-route)#network
Router(config-route)#
192.168.15.0
distance
Router(config-route)#
15 192.168.15.1 0.0.0.0
distance
Router(config-route)#
200 192.168.15.0 0.0.0.255
distance
Router(config-route)#
255
end
Router#
For EIGRP, you can specify the distance for routes learned from both internal and external neighbors:
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z. Router(config)#router eigrp
Router(config-route)#
111
network
Router(config-route)#
192.168.16.0
distance eigrp
Router(config-route)#
55 200
end
Router#
With OSPF, you can also control the distance, depending on whether the neighboring router is in the same area:
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z. Router(config)#router ospf
Router(config-route)#
66
distance ospf inter-area
Router(config-route)#
115
distance ospf intra-area
Router(config-route)#
105
distance ospf external
Router(config-route)#
125
end
Router#
And you can configure BGP distances for internal, external, and local routes:
Router#configure terminal
Enter configuration commands, ...
Get Cisco IOS Cookbook, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.