Command
Distribute-List
Use
Allows you to filter routes from the routing table. For CCNA purposes, this is usually done through access lists.
Syntax
Router(config-router)#distribute-list <list> <in/out>
OR
Router(config-router)#distribute-list <list> <in/out> <interface>
Options
<list> | Access list |
<in/out> | Whether the router is receiving or sending the route |
Example

In this example, we will apply a distribute-list to R2. First, we will see what OSPP routes we have on R2.
R2(config)#do show ip route ospf |
Next, we will set an access-list to only allow 1.2.2.2 and use it in a distribute-list.
R2(config)#access-list 25 permit 1.2.2.2 |
Finally, we see only 1.2.2.2 is in the routing table.
R2(config-router)#do show ip route ospf |