Route filtering using Distribute List

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\24



For 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.     


Route redistribution | RIP into OSPF | OSPF into RIP | Configuration lab :


Route redistribution has been become an integral part of IP network as the result of a growing need for disseminating certain routes across routing protocol boundaries.
What is route redistribution?

Route redistribution is used for communicating different routers running routing protocols with each other and advertises into another protocol.  By default, routers only advertise and share routes with other routers running the same routing protocol.  For example in figure you can see that we have two routing protocol RIP and OSPF running, without route redistribution R1 can’t reached to R3 and R4. In this article we shall learn how to make them communicate using redistribution.


Here are some basic configuration of all these routers.
R1(config)#int s1/0
R1 (config-if)#ip address 20.0.0.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#int loop 1
R1(config-if)#ip address 11.1.1.1 255.255.255.0
R1(config-if)#int loop 2
R1(config-if)#ip address 11.1.2.1 255.255.255.0
R1(config-if)#int loop 3
R1(config-if)#ip address 11.1.3.1 255.255.255.0
R1(config-if)#int loop 4
R1(config-if)#ip address 11.1.4.1 255.255.255.0
R1(config-if)#int loop 5
R1(config-if)#ip address 11.1.5.1 255.255.255.0

R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#no auto-summary
R1(config-router)#network 20.0.0.0
R1(config-router)#network 11.1.1.0
R1(config-router)#network 11.1.2.0
R1(config-router)#network 11.1.3.0
R1(config-router)#network 11.1.4.0
R1(config-router)#network 11.1.5.0

R2:
Router(config)#hostname R2
R2(config)#interface s1/0
R2(config-if)#ip address 20.0.0.2 255.255.255.0
R2(config-if)#interface s1/1
R2(config-if)#ip address 30.0.0.1 255.255.255.0
R2(config-if)#no sh
R2(config)#router rip
R2(config-router)#version 2
R2(config-router)#no auto-summary
R2(config-router)#network 20.0.0.0
R2(config)#router ospf 1
R2(config)#int s1/1
R2(config-if)#ip ospf 1 area 0

R3
Router(config)#hostname R3
R3(config)#int s1/0
R3(config-if)#ip address 30.0.0.2 255.255.255.0
R3(config-if)#no sh
R3(config-if)#int s1/1
R3(config-if)#ip address 100.0.0.1 255.255.255.0
R3(config-if)#no sh
R3(config)#router ospf 1
R3(config-router)#ex
R3(config)#int s1/1
R3(config-if)#ip ospf 1 area 0
R3(config-if)#int s1/0
R3(config-if)#ip ospf 1 area 0

R4
Router(config)#hostname R4
R4(config)#router ospf 1
R4(config)#int s1/0
R4(config-if)#ip address 100.0.0.2 255.255.255.0
R4(config-if)#no shu
R4(config)#router ospf 1
R4(config-router)#ex
R4(config)#int s1/0
R4(config-if)#ip ospf 1 area 0

Before redistribution you can see in figure that in R4’s routing table there are no RIP routes, here we need to choose the best appropriate router for redistribution that is R2 (ASBR) in this case. When we redistribute RIP route into OSPF we need to define matric values for that route. Following are the commands for redistributing RIP into OSPF.


R2(config)#router ospf 1
R2(config-router)#redistribute rip subnets metric 22222


When you redistribute other routing protocol in OSPF, they will appear in the OSPF routing table as type E2 routes.





End to end ping i.e. from R1 to R4 is not success full at this step. Because we need to redistribute OSPF into RIP as follow.

R2(config)#router rip
R2(config-router)#redistribute ospf 1 metric 3

UA-23728446-1