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-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)#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)#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
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 20 permit 192.168.32.0 255.0.0.0
R3(config)#access-list 30 permit 192.168.33.0 255.0.0.0
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)#match ip address 10
R3(config-route-map)#set metric 2000
R3(config-route-map)#exit
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)#exit
R3(config-router)#redistribute rip subnets route-map OSPF
R3(config-router)#exit
R3(config)#end
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

No comments:
Post a Comment