Route redistribution allows OSPF to exchange routing information with other routing protocols (RIP, EIGRP, BGP) or static routes.
The router performing redistribution becomes an Autonomous System Boundary Router (ASBR) and advertises external routes using Type-5 LSAs.
Key Concepts
External Route Types:
- E1 (Type-1 External) - Cost includes internal OSPF cost + external cost
- E2 (Type-2 External) - Only considers external cost (default)
Metric: OSPF doesn't automatically convert metrics from other protocols. Default redistributed metric is 20 (except BGP = 1).
Configuration Examples
Example 1: Redistributing RIP into OSPF
Topology:
RIP Domain (192.168.x.x) --- R1 (ASBR) --- OSPF Domain (10.x.x.x)
R1 Configuration:
R1(config)# router ospf 1
R1(config-router)# network 10.1.1.0 0.0.0.255 area 0
R1(config-router)# redistribute rip subnets metric 50 metric-type 1
R1(config-router)# exit
R1(config)# router rip
R1(config-router)# version 2
R1(config-router)# network 192.168.1.0
R1(config-router)# redistribute ospf 1 metric 5
Explanation:
subnetskeyword includes subnetted routes (essential!)metric 50sets seed metric for redistributed routesmetric-type 1makes routes E1 instead of E2- RIP receives OSPF routes with metric 5 (hop count)
Example 2: Redistributing Static Routes
R1 Configuration:
R1(config)# ip route 172.16.0.0 255.255.0.0 Null0
R1(config)# ip route 0.0.0.0 0.0.0.0 203.0.113.1
R1(config)# router ospf 1
R1(config-router)# network 10.0.0.0 0.0.0.255 area 0
R1(config-router)# redistribute static subnets
R1(config-router)# default-information originate always
Explanation:
redistribute staticinjects static routes into OSPFdefault-information originateadvertises default route (0.0.0.0/0)alwayskeyword advertises even if default route isn't in routing table
Example 3: Redistributing EIGRP into OSPF
R1 Configuration:
R1(config)# router ospf 1
R1(config-router)# network 10.1.1.0 0.0.0.255 area 0
R1(config-router)# redistribute eigrp 100 subnets metric 100 metric-type 2
R1(config-router)# exit
R1(config)# router eigrp 100
R1(config-router)# network 192.168.0.0
R1(config-router)# redistribute ospf 1 metric 1000 100 255 1 1500
Explanation:
- EIGRP requires 5 metric values: bandwidth, delay, reliability, load, MTU
- OSPF receives EIGRP routes with metric 100 as E2 routes
Example 4: Filtering During Redistribution
R1 Configuration:
R1(config)# access-list 10 permit 192.168.1.0 0.0.0.255
R1(config)# access-list 10 deny any
R1(config)# route-map RIP-TO-OSPF permit 10
R1(config-route-map)# match ip address 10
R1(config-route-map)# set metric 75
R1(config-route-map)# exit
R1(config)# router ospf 1
R1(config-router)# redistribute rip subnets route-map RIP-TO-OSPF
Explanation:
- Route-map filters which routes are redistributed
- Only 192.168.1.0/24 is redistributed with metric 75
Verification Commands
R1# show ip ospf
R1# show ip ospf database external
R1# show ip route ospf
R1# show ip protocols
Sample Output:
R1# show ip route ospf
O E1 192.168.1.0/24 [110/70] via 10.1.1.2
O E2 192.168.2.0/24 [110/20] via 10.1.1.2
Common Issues
- Missing
subnetskeyword - only classful networks redistributed - Routing loops - use distribute-lists or route-maps
- Suboptimal routing - choose appropriate metric-type
- Administrative distance conflicts
Best Practices
- Use route-maps for controlled redistribution
- Tag routes to prevent loops:
route-map TAG set tag 100 - Filter carefully - avoid redistributing everything
- Choose E1 vs E2 based on design requirements
- Document all redistribution points
Redistribution requires careful planning to avoid routing loops and ensure optimal path selection across protocol boundaries.
No comments:
Post a Comment