What is Distribute List?
Distribute List is Like an access-list, use to deny or permit the routing update to pass through a router/interface. Distribute List allow you apply an access list to a routing updates.
How to apply a Distribute List:
It can be apply on in or out bond of an interface under a routing process.
e.g in fig. R1 want to send a routing update to it neighbor, this update will go through from interface S0/0, router will check, is there some Distribute List apply to this interface. If there is a Distribute List which would contain the allow route to pass through this interface. In this list u may block 11.1.2.0, 11.1.3.0 etc.
Distribute List Configuration in GNS3:
Here in figure you can see a two routing domain. R2, R3 and R4 running “ospf area 1”
R1 have some RIP routes which are 11.1.1.0\24 to 11.1.5.0\24.
Objective1: some of networks behind the R1, we don’t want to get out the entire network.
11.1.1.0, 11.1.2.0 remain in this networks not accessed from R4.
Objective2: But other two networks 11.1.4.0\24 & 11.1.5.0\24 can’t cross from rip-network. They remains in RIP network, can’t go across the R3 & R4.
Note: For full Lab configuration you can visit Route redistribution configuration.
Step-1:
Create an Access-list
R1(config)# ip access-list standard route_filter
R1(config-)#Deny 11.1.2.0. 0.0.0.255
R1(config-)#Deny 11.1.1.0. 0.0.0.255
R1(config-)#Permit any
Step-2:
Apply distribute list under routing process using that acces-list
R1(config)#Router-rip
R1(config-router)#Distrib-list route_filter out serial 0\2
R2#clrear ip route *
R2#Show ip route
From above configuration objective1 is achieved. You can view the figure that in R4 routing table there are not 11.1.1.0\24 & 11.1.2.0\24For achieving the 2nd objective we need to do the same above steps and configurations. i.e.
R2(config)# Ip access-list standard route_filter2
R2(config)#Deny 11.1.3.0. 0.0.0.255
R2(config)#Deny 11.1.4.0. 0.0.0.255
R2(config)#Permit any
R2(config)#Router osfp 1
R2(config-router)#Distrib-list route_filter 2out rip
After completing above configuration you shall see that networks 11.1.3.0\24 & 11.1.4.0\24 disappear from R4’s routing table, but remains in R2 routing table.