In my last column, I offered an overview of the basics of using routing redistribution. Routing redistribution involves taking routes from one source (usually a routing protocol) and sending those routes to a different source (usually another routing protocol).
Now that we've discussed exactly what routing redistribution is, let's look at a practical, hands-on example of using routing redistribution. Last time, we discussed three situations in which one might use routing redistribution. One of those scenarios involved the use of devices that don't support the routing protocol of your network.
If you're using such devices, you'll likely want to bring routes from the devices into the routing protocol of your network. Let's drill down into this situation, and examine the proper configuration for each of the devices.
Let's say your organization's network has a firewall that only offers Routing Information Protocol (RIP) routing, and you want that firewall to be the default gateway for the network. However, the network is running Open Shortest Path First (OSPF) routing.
How do you get the RIP default route into your OSPF network? The answer is redistribution. First, let's look at a diagram of the network, as shown in Figure A.
The firewall is near the top of the diagram, and it connects to Router 1. Router 1 then connects to Router 2. (In a real-world network, it likely connects to other routers as well.)
Router 1 is our redistribution point, from which we'll redistribute the RIP routes we receive from the firewall into our OSPF network. So, Router 1 is running both RIP and OSPF; it runs RIP on the interface connecting to the firewall, and it runs OSPF on the interface connecting to Router 2.
When we're finished, we'll see the default route on Router 2, originally sent by the firewall. And Router 2 will only have the default route when Router 1 has the default route. Here's something important to note: While you could continually send the default route from Router 1 to Router 2 without redistribution, you only want Router 2 to have the default route if it's really available.
Here's the IP address configuration for Router 1:
interface Ethernet0 ip address 184.108.40.206 255.255.255.0 ! interface Serial0 ip address 220.127.116.11 255.255.255.0
Here's the routing configuration for Router 1:
router ospf 1 redistribute rip subnets network 18.104.22.168 0.0.0.255 area 0 default-information originate ! router rip network 22.214.171.124
This shows us that the router has OSPF enabled on the Serial interface and RIP enabled on the Ethernet interface. In addition, the following commands are particularly important to note.
- redistribute rip subnets: Under the OSPF routing process, this command sends any routes received from RIP to OSPF. The subnets keyword tells the router to redistribute all networks, including subnetted networks. By default, this command only redistributes classful networks.
- default-information originate: Under the OSPF process, this command allows OSPF to advertise a default route. By default, this command only advertises the default route if the router really has a default route. However, you can use the always keyword at the end of the command to tell the router to advertise a default route via OSPF no matter what.
Now, let's look at the IP address configuration for Router 2:
interface Ethernet0 ip address 10.1.1.1 255.255.255.0 ! interface Serial0 ip address 126.96.36.199 255.255.255.0 clockrate 250000
Here's the routing configuration for Router 2:
router ospf 1 network 10.1.1.0 0.0.0.255 area 0 network 188.8.131.52 0.0.0.255 area 0
Note that Router 2 is only running OSPF.
Next, let's use the show ip route command on Router 1. Here's a look at this command's output:
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 184.108.40.206 to network 0.0.0.0 220.127.116.11/24 is subnetted, 1 subnets C 18.104.22.168 is directly connected, Ethernet0 22.214.171.124/24 is subnetted, 1 subnets C 126.96.36.199 is directly connected, Serial0 10.0.0.0/24 is subnetted, 1 subnets O 10.1.1.0 [110/74] via 188.8.131.52, 00:13:19, Serial0 R* 0.0.0.0/0 [120/1] via 184.108.40.206, 00:00:03, Ethernet0
Notice that Router 1 is receiving the default route via RIP, as indicated by the R next to the 0.0.0.0/0 default route at the bottom of the output. In addition, notice that Router 1 is communicating with Router 2 via OSPF because it has the 10.1.1.0/24 route for the Ethernet LAN on Router 2.
Now, let's use the show ip route command on Router 2. Here's a look at this command's output:
R2# show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B – BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area E1 - OSPF external type 1, E2 - OSPF external type 2, E – EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default U - per-user static route Gateway of last resort is 220.127.116.11 to network 0.0.0.0 18.104.22.168/8 is subnetted, 1 subnets O E2 22.214.171.124 [110/20] via 126.96.36.199, 00:12:39, Serial0 188.8.131.52/8 is subnetted, 1 subnets C 184.108.40.206 is directly connected, Serial0 10.0.0.0/8 is subnetted, 1 subnets C 10.1.1.0 is directly connected, Ethernet0 O*E2 0.0.0.0/0 [110/1] via 220.127.116.11, 00:12:31, Serial0 R2#
Notice that Router 2 has the 0.0.0.0/0 default route pointing to Router 1 (in this case, 18.104.22.168) and that the route has the O designation, which indicates the OSPF route.
This is an external OSPF route, as indicated by E2. This shows that its source was not natively OSPF, and it also indicates redistribution via some other protocol.
Router 2 has no RIP routes because it isn't running RIP. Through redistribution, however, it can receive the RIP route, originally advertised by the firewall.
Miss a column?
Check out the Cisco Routers and Switches Archive, and catch up on David Davis' most recent columns.
Want to learn more about router and switch management? Automatically sign up for our free Cisco Routers and Switches newsletter, delivered each Friday!
David Davis has worked in the IT industry for 12 years and holds several certifications, including CCIE, MCSE+I, CISSP, CCNA, CCDA, and CCNP. He currently manages a group of systems/network administrators for a privately owned retail company and performs networking/systems consulting on a part-time basis.