Saturday, 27 October 2012

RIP: Filtering using distribute-list


RIP: Filtering using distribute-list

 

·         We can filter the routes in RIP using distribute-list

 

·         Let me take a small topology to configure route filtering in RIP

 

R1------S1/0-------------s1/0----R2

10.1.12.1--------------10.1.12.2

 

R1(config-router)#do show run | sec router

router rip

 version 2

 network 1.0.0.0

 network 10.0.0.0

 network 11.0.0.0

 network 111.0.0.0

 no auto-summary

R1(config-router)#

 

R2#show run | sec router

router ospf 1

 log-adjacency-changes

router rip

 version 2

 network 2.0.0.0

 network 10.0.0.0

 no auto-summary

R2#

 

R1(config-router)#do show ip route

Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

       E1 - OSPF external type 1, E2 - OSPF external type 2

       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

       ia - IS-IS inter area, * - candidate default, U - per-user static route

       o - ODR, P - periodic downloaded static route

 

Gateway of last resort is not set

 

     1.0.0.0/32 is subnetted, 1 subnets

C       1.1.1.1 is directly connected, Loopback0

     2.0.0.0/32 is subnetted, 1 subnets

R       2.2.2.2 [120/1] via 10.1.12.2, 00:00:18, Serial1/0

     111.0.0.0/32 is subnetted, 1 subnets

C       111.111.111.111 is directly connected, Loopback2

     10.0.0.0/24 is subnetted, 1 subnets

C       10.1.12.0 is directly connected, Serial1/0

     11.0.0.0/32 is subnetted, 1 subnets

C       11.11.11.11 is directly connected, Loopback1

R1(config-router)#

 

R2#show ip route

Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

       E1 - OSPF external type 1, E2 - OSPF external type 2

       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

       ia - IS-IS inter area, * - candidate default, U - per-user static route

       o - ODR, P - periodic downloaded static route

 

Gateway of last resort is not set

 

     1.0.0.0/32 is subnetted, 1 subnets

R       1.1.1.1 [120/1] via 10.1.12.1, 00:00:04, Serial1/0

     2.0.0.0/32 is subnetted, 1 subnets

C       2.2.2.2 is directly connected, Loopback0

     111.0.0.0/32 is subnetted, 1 subnets

R       111.111.111.111 [120/1] via 10.1.12.1, 00:00:04, Serial1/0

     10.0.0.0/24 is subnetted, 1 subnets

C       10.1.12.0 is directly connected, Serial1/0

     11.0.0.0/8 is variably subnetted, 2 subnets, 2 masks

R       11.11.11.11/32 [120/1] via 10.1.12.1, 00:00:04, Serial1/0

C       11.1.23.0/24 is directly connected, Serial1/1

R2#

 

Observation:

·         RIP is configured between R1 and R2

·         R1 has advertised its loopback0 1.1.1.1/32 into RIP

·         R1 has advertised its loopback0 11.11.11.11/32 into RIP

·         R1 has advertised its loopback0 111.111.111.111/32 into RIP

·         R2 has advertised its loopback0 2.2.2.2/32 into RIP

 

·         Now, If R2 wants only 111.111.111.111/32 route??

·         Let me configure this in R2

·         Prefix-list should match only 111.111.111.111/32

 

R2(config)#ip prefix-list 111 seq 5 permit 111.111.111.111/32

R2(config)#router rip

R2(config-router)#distribute-list prefix 111 in serial 1/0

R2(config-router)#

 

R2#show ip route

Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

       E1 - OSPF external type 1, E2 - OSPF external type 2

       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

       ia - IS-IS inter area, * - candidate default, U - per-user static route

       o - ODR, P - periodic downloaded static route

 

Gateway of last resort is not set

 

     2.0.0.0/32 is subnetted, 1 subnets

C       2.2.2.2 is directly connected, Loopback0

     111.0.0.0/32 is subnetted, 1 subnets

R       111.111.111.111 [120/1] via 10.1.12.1, 00:00:24, Serial1/0

     10.0.0.0/24 is subnetted, 1 subnets

C       10.1.12.0 is directly connected, Serial1/0

     11.0.0.0/24 is subnetted, 1 subnets

C       11.1.23.0 is directly connected, Serial1/1

R2#

 

Observation:

·         R2 sees only 111.111.111.111/32 from R1 now.

 

No comments:

Post a Comment