Allows you to filter routes from the routing table. For CCNA purposes, this is usually done through access lists.
Router(config-router)#distance <AD> <source IP> <wildcard mask> <access-list>
|<Administrative Distance>||Sets the administrative distance for the selected routes|
|<source IP>||Source IP the route is received from|
|<wildcard mask>||Specifies a wildcard mask, allows you to specify multiple source IP addresses|
|<access-list>||Specifies an access-list that selects what routes will have their AD changed|
In this example, we will apply a change to the administrative distance for OSPF to 123 for any route that starts with 126.96.36.199. First, we’ll look at the routing table.
R2(config)#do show ip route ospf
Now, we will configure the distance command on R2’s OSPF process.
R2(config)#access-list 25 permit 188.8.131.52 0.255.255.255
Finally, we see routes starting with 184.108.40.206 now have an administrative distance of 123.
R2(config-router)#do show ip route ospf