Saturday, 24 January 2026

Route Map Redistribution and configuration

 

Why use a route map for redistribution?


Without a route-map, you redistribute everything. That's often a bad idea. You might leak routes you shouldn't, cause routing loops, or create security risks. By default, all the routes are redistributed with the metric and metric-type defined when we configure redistribution. When we want to assign different metrics, metric-type or security, we use a route-map. 

 The simple idea of using a route map in redistribution 

  • Filter: only redistribute specific prefixes
  • Modify: change metrics, tag, or route types during the exchange 
  • Control: apply logic with permit or deny statements 


 Let's see the configuration:-

Topology:-


Goal: 

  • Configure the topology as per the diagram
  • Configure the IP addresses as per the topology
  • Configure OSPF as per the topology in area 0
  • Configure RIPv2 on router 3 and advertise loopbacks interfaces
  • Configure ACL permit 192.168.31.0 192.168.32.0 192.168.33.0
  • Configure route map set metric 2000 for 192.168.31.0
  • Configure route map set metric 1000 and metric-type 1
  • Redistribute RIPv2 into OSPF with a route-map 


R1(config)#interface serial 5/0
R1(config-if)#ip address 12.1.1.1 255.0.0.0
R1(config-if)#no shutdown
R1(config-if)#exit

R1(config)#interface fastethernet 0/0
R1(config-if)#ip address 10.1.1.1 255.0.0.0
R1(config-if)#no shutdown
R1(config-if)#no keepalive
R1(config-if)#exit

R1(config)#interface loopback 1
R1(config-if)#ip address 192.168.11.1 255.255.255.0
R1(config-if)#exit
R1(config)#interface loopback 2
R1(config-if)#ip address 192.168.12.1 255.255.255.0
R1(config-if)#exit
R1(config)#interface loopback 3
R1(config-if)#ip address 192.168.13.1 255.255.255.0
R1(config-if)#exit
R1(config)#interface loopback 4
R1(config-if)#ip address 192.168.14.1 255.255.255.0
R1(config-if)#exit
R2(config)#interface serial 5/0
R2(config-if)#ip address 12.1.1.2 255.0.0.0
R2(config-if)#no shutdown
R2(config-if)#exit

R2(config)#interface serial 5/1
R2(config-if)#ip address 23.1.1.1 255.0.0.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface fastethernet 0/0
R2(config-if)#ip address 20.1.1.1 255.0.0.0
R2(config-if)#no shutdown
R2(config-if)#no keepalive
R2(config-if)#exit

R2(config)#interface loopback 1
R2(config-if)#ip address 192.168.21.1 255.255.255.0
R2(config-if)#exit
R2(config)#interface loopback 2
R2(config-if)#ip address 192.168.22.1 255.255.255.0
R2(config-if)#exit
R2(config)#interface loopback 3
R2(config-if)#ip address 192.168.23.1 255.255.255.0
R2(config-if)#exit
R2(config)#interface loopback 4
R2(config-if)#ip address 192.168.24.1 255.255.255.0
R2(config-if)#exit


R3(config)#interface fastethernet 0/0
R3(config-if)#ip address 30.1.1.1 255.0.0.0
R3(config-if)#no shutdown
R3(config-if)#no keepalive
R3(config-if)#exit

R3(config)#interface serial 5/1
R3(config-if)#ip address 23.1.1.2 255.0.0.0
R3(config-if)#no shutdown
R3(config-if)#exit

R3(config)#interface loopback 1
R3(config-if)#ip address 192.168.31.1 255.255.255.0
R3(config-if)#exit
R3(config)#interface loopback 2
R3(config-if)#ip address 192.168.32.1 255.255.255.0
R3(config-if)#exit
R3(config)#interface loopback 3
R3(config-if)#ip address 192.168.33.1 255.255.255.0
R3(config-if)#exit
R3(config)#interface loopback 4
R3(config-if)#ip address 192.168.34.1 255.255.255.0
R3(config-if)#exit


R1(config)#router ospf 1
R1(config-router)#router-id 10.1.1.1
R1(config-router)#network 0.0.0.0 0.0.0.0 area 0
R1(config-router)#exit

*Jan 24 11:24:24.267: %OSPF-5-ADJCHG: Process 1, Nbr 20.1.1.1 on Serial5/0 from LOADING to FULL, Loading Done

R2(config)#router ospf 1
R2(config-router)#router-id 20.1.1.1
R2(config-router)#network 12.0.0.0 0.255.255.255 area 0
R2(config-router)#network 23.0.0.0 0.255.255.255 area 0
R2(config-router)#network 20.0.0.0 0.255.255.255 area 0
R2(config-router)#network 192.168.21.0 255.0.0.0 area 0
R2(config-router)#network 192.168.22.0 255.0.0.0 area 0
R2(config-router)#network 192.168.23.0 255.0.0.0 area 0
R2(config-router)#network 192.168.24.0 255.0.0.0 area 0
R2(config-router)#exit

*Jan 24 11:24:24.167: %OSPF-5-ADJCHG: Process 1, Nbr 10.1.1.1 on Serial5/0 from LOADING to FULL, Loading Done

R3(config)#router ospf 1
R3(config-router)#router-id 30.1.1.1
R3(config-router)#network 23.0.0.0 0.255.255.255 area 0
R3(config-router)#network 30.0.0.0 0.255.255.255 area 0
R3(config-router)#exit

*Jan 24 11:35:25.335: %OSPF-5-ADJCHG: Process 1, Nbr 20.1.1.1 on Serial5/1 from LOADING to FULL, Loading Done

R3(config)#router rip
R3(config-router)#version 2
R3(config-router)#network 192.168.31.0
R3(config-router)#network 192.168.32.0
R3(config-router)#network 192.168.33.0
R3(config-router)#network 192.168.34.0
R3(config-router)#exit

R3(config)#access-list 10 permit 192.168.31.0 255.0.0.0
R3(config)#access-list 20 permit 192.168.32.0 255.0.0.0
R3(config)#access-list 30 permit 192.168.33.0 255.0.0.0


R3#show access-lists
Standard IP access list 10
    10 permit 0.168.31.0, wildcard bits 255.0.0.0 (1 match)
Standard IP access list 20
    10 permit 0.168.32.0, wildcard bits 255.0.0.0 (1 match)
Standard IP access list 30
    10 permit 0.168.33.0, wildcard bits 255.0.0.0

R3(config)#route-map OSPF permit 10
R3(config-route-map)#match ip address 10
R3(config-route-map)#set metric 2000
R3(config-route-map)#exit

R3(config)#route-map OSPF permit 20
R3(config-route-map)#match ip address 20
R3(config-route-map)#set metric 1000
R3(config-route-map)#set metric-type type-1
R3(config-route-map)#exit

R3(config)#route-map OSPF permit 30
R3(config-route-map)#exit

R3(config)#router ospf 1
R3(config-router)#redistribute rip subnets route-map OSPF
R3(config-router)#exit
R3(config)#end

R3#show route-map OSPF
route-map OSPF, permit, sequence 10
  Match clauses:
    ip address (access-lists): 10
  Set clauses:
    metric 2000

  Policy routing matches: 0 packets, 0 bytes
route-map OSPF, permit, sequence 20
  Match clauses:
    ip address (access-lists): 20
  Set clauses:
    metric 1000
    metric-type type-1

  Policy routing matches: 0 packets, 0 bytes
route-map OSPF, permit, sequence 30
  Match clauses:
  Set clauses:
  Policy routing matches: 0 packets, 0 bytes


R1#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

C    192.168.12.0/24 is directly connected, Loopback2
C    192.168.13.0/24 is directly connected, Loopback3
C    192.168.14.0/24 is directly connected, Loopback4
O E2 192.168.31.0/24 [110/2000] via 12.1.1.2, 00:46:06, Serial5/0
     192.168.24.0/32 is subnetted, 1 subnets
O       192.168.24.1 [110/65] via 12.1.1.2, 00:46:06, Serial5/0
O    20.0.0.0/8 [110/65] via 12.1.1.2, 00:46:06, Serial5/0
O    23.0.0.0/8 [110/128] via 12.1.1.2, 00:46:06, Serial5/0
C    192.168.11.0/24 is directly connected, Loopback1
     192.168.21.0/32 is subnetted, 1 subnets
O       192.168.21.1 [110/65] via 12.1.1.2, 00:46:06, Serial5/0
C    10.0.0.0/8 is directly connected, FastEthernet0/0
     192.168.23.0/32 is subnetted, 1 subnets
O       192.168.23.1 [110/65] via 12.1.1.2, 00:46:07, Serial5/0
     192.168.22.0/32 is subnetted, 1 subnets
O       192.168.22.1 [110/65] via 12.1.1.2, 00:46:07, Serial5/0
O E2 192.168.34.0/24 [110/20] via 12.1.1.2, 00:46:07, Serial5/0
C    12.0.0.0/8 is directly connected, Serial5/0
O E1 192.168.32.0/24 [110/1128] via 12.1.1.2, 00:46:07, Serial5/0
O E2 192.168.33.0/24 [110/20] via 12.1.1.2, 00:46:07, Serial5/0
O    30.0.0.0/8 [110/129] via 12.1.1.2, 00:46:07, Serial5/0



IF YOU LIKE THIS BLOG, PLEASE VISIT MY YOUTUBE CHANNEL 

No comments:

Route Map Redistribution and configuration

  Why use a route map for redistribution? Without a route-map, you redistribute everything. That's often a bad idea. You might leak rout...