Redistributing Connected Routes

VN:F [1.9.6_1107]
Rating: 4.6/5 (7 votes cast)
By Marko Milivojevic on June 21st, 2010

Sometimes CCIE candidates have problems understanding complexities of route redistribution. One of the things that seems to have some levels of confusion associated with it is redistribution of connected routes and problems it may cause when combined with redistribution of other routing protocols. Let’s clear out that confusion.

Network Setup

As is customary in these brief blogs of ours, we’ll start with some pre-configuration. The diagram below is what we are going to use throughout this blog.

Diagram

Let’s say the goal is to have all addresses and networks fully reachable, but the “stub” networks should not be active in any routing protocol. Stub networks in our diagram are 1.1.1.0/24, 2.2.2.0/24, 3.3.3.0/24 and 4.4.4.0/24.

I have basic EIGRP, OSPF and RIP (version 2) configured on all listed devices. No redistribution has been done so far. Let’s see all that.

R1:

R1#show ip eigrp neighbors
EIGRP-IPv4 Neighbors for AS(12)
H   Address                 Interface       Hold Uptime   SRTT   RTO  Q  Seq
                                            (sec)         (ms)       Cnt Num
0   12.12.12.2              Se1/0             12 00:02:34   28   200  0  12

R2:

R2#show ip eigrp neighbors
EIGRP-IPv4 Neighbors for AS(12)
H   Address                 Interface       Hold Uptime   SRTT   RTO  Q  Seq
                                            (sec)         (ms)       Cnt Num
0   12.12.12.1              Se1/0             11 00:02:34   24   200  0  12

R2#show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
23.23.23.3        0   FULL/  -        00:00:37    23.23.23.3      Serial1/1

R3:

R3#show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
23.23.23.2        0   FULL/  -        00:00:35    23.23.23.2      Serial1/1

R3#debug ip rip events
  RIP: sending v2 update to 224.0.0.9 via Serial1/0 (34.34.34.3) - suppressing null update

R3#undebug all

R4:

R4#debug ip rip events
  RIP: sending v2 update to 224.0.0.9 via Serial1/0 (34.34.34.4) - suppressing null update

R4#undebug all

Basic Redistribution

So far, so good. Basic configuration is there. Let’s start with basic redistribution between protocols. We will need to mutually redistribute between EIGRP and OSPF on R2 and between OSPF and RIP on R3. There is no possibility of any loops forming, so this redistribution should be very straight forward. Let’s configure R2.

R2:

router eigrp 12
 redistribute ospf 1 metric 1 1 1 1 1500
!
router ospf 1
 redistribute eigrp 12 subnets
!

AFter performing any configuration, it’s a very good idea to verify the results. After performing this mutual redistribution, R1 should have the route 23.23.23.0/24 in its routing table. Similarly, R3 should have 12.12.12.0/24.

R1:

R1#show ip route eigrp | begin ^Gateway
Gateway of last resort is not set

      23.0.0.0/24 is subnetted, 1 subnets
D EX     23.23.23.0 [170/2560512256] via 12.12.12.2, 00:01:58, Serial1/0

R3:

R3#show ip route ospf | begin ^Gateway
Gateway of last resort is not set

      12.0.0.0/24 is subnetted, 1 subnets
O E2     12.12.12.0 [110/20] via 23.23.23.2, 00:02:17, Serial1/1

That worked as expected. Now, let’s proceed to configuration on R3.

R3:

router ospf 1
 redistribute rip subnets
!
router rip
 redistribute ospf 1 metric 5
!

At this point, all routers should have in their routing tables all routes used by dynamic routing protocols. To summarize, this is how the routing tables should look like.

  • R1:
    • EIGRP: 23.23.23.0/24 and 34.34.34.0/24
  • R2:
    • EIGRP: none
    • OSPF: 34.34.34.0/24
  • R3:
    • OSPF: 12.12.12.0/24
    • RIP: none
  • R4:
    • RIP: 12.12.12.0/24 and 23.23.23.0/24

Let’s see if our logic is right…

R1:

R1#show ip route eigrp | begin ^Gateway
Gateway of last resort is not set

      23.0.0.0/24 is subnetted, 1 subnets
D EX     23.23.23.0 [170/2560512256] via 12.12.12.2, 00:08:13, Serial1/0
      34.0.0.0/24 is subnetted, 1 subnets
D EX     34.34.34.0 [170/2560512256] via 12.12.12.2, 00:00:41, Serial1/0

R2:

R2#show ip route eigrp | begin ^Gateway
Gateway of last resort is not set

R2#show ip route ospf | begin ^Gateway
Gateway of last resort is not set

      34.0.0.0/24 is subnetted, 1 subnets
O E2     34.34.34.0 [110/20] via 23.23.23.3, 00:01:31, Serial1/1

R3:

R3#show ip route rip | begin ^Gateway
Gateway of last resort is not set

R3#show ip route ospf | begin ^Gateway
Gateway of last resort is not set

      12.0.0.0/24 is subnetted, 1 subnets
O E2     12.12.12.0 [110/20] via 23.23.23.2, 00:09:28, Serial1/1

R4:

R4#show ip route rip | begin ^Gateway
Gateway of last resort is not set

      12.0.0.0/24 is subnetted, 1 subnets
R        12.12.12.0 [120/5] via 34.34.34.3, 00:00:11, Serial1/0
      23.0.0.0/24 is subnetted, 1 subnets
R        23.23.23.0 [120/1] via 34.34.34.3, 00:00:11, Serial1/0

Redistributing Connected Routes

It looks like we’re still on good track. The time now is to start injecting those stubs. To make things interesting, here’s what I’m going to do on each router.

  • R1: Redistribute all connected routes to EIGRP
  • R2: Redistribute connected routes to EIGRP and OSPF allowing only Ethernet0/0 using route-map and “match interface”
  • R3: Redistribute connected routes to RIP and OSPF allowing only 3.3.3.0/24 using route-map and “match ip address”
  • R4: Redistribute connected routes to RIP allowing only 4.4.4.0/24 using route-map and “match ip address prefix-list”

After each redistribution step, I will provide verification steps. Let’s go then, on to R1!

R1:

router eigrp 12
 redistribute connected metric 1 1 1 1 1500
!

After this step, we should have 1.1.1.0/24 on R4.

R4:

R4#show ip route 1.1.1.0
Routing entry for 1.1.1.0/24
  Known via "rip", distance 120, metric 5
  Redistributing via rip
  Last update from 34.34.34.3 on Serial1/0, 00:00:05 ago
  Routing Descriptor Blocks:
  * 34.34.34.3, from 34.34.34.3, 00:00:05 ago, via Serial1/0
      Route metric is 5, traffic share count is 1

So far so good. Let’s move on to R2 and redistribute there. Remember, we need to make the route-map first.

R2:

route-map Connected
 match interface Ethernet0/0
!
router eigrp 12
 redistribute connected metric 1 1 1 1 1500 route-map Connected
!
router ospf 1
 redistribute connected subnets route-map Connected
!

After this step, R1 and R4 should have 2.2.2.0/24. Let’s make sure they do.

R1:

R1#show ip route eigrp | begin ^Gateway
Gateway of last resort is not set

      2.0.0.0/24 is subnetted, 1 subnets
D EX     2.2.2.0 [170/2560512256] via 12.12.12.2, 00:00:55, Serial1/0
      34.0.0.0/24 is subnetted, 1 subnets
D EX     34.34.34.0 [170/2560512256] via 12.12.12.2, 00:15:47, Serial1/0

R4:

R4#show ip route rip | begin ^Gateway
Gateway of last resort is not set

      1.0.0.0/24 is subnetted, 1 subnets
R        1.1.1.0 [120/5] via 34.34.34.3, 00:00:24, Serial1/0
      2.0.0.0/24 is subnetted, 1 subnets
R        2.2.2.0 [120/5] via 34.34.34.3, 00:00:24, Serial1/0
      23.0.0.0/24 is subnetted, 1 subnets
R        23.23.23.0 [120/1] via 34.34.34.3, 00:00:24, Serial1/0

This is awesome! Or is it? Take a close look at those two routing tables. What happened to 23.23.23.0/24 on R1 and 12.12.12.0/24 on R4? Where did those two go? Well, now you know why I’m writing this blog.

The Problem

Before we redistributed connected routes into our routing protocols, R2 considered 12.12.12.0/24 as part of EIGRP 12 process and 23.23.23.0/24 as part of OSPF. When we redistributed from OSPF to EIGRP, 23.23.23.0/24 was duly injected. The same thing happened to 12.12.12.0/24 in other direction. However, when we configured redistribution of connected prefixes these two are going to be picked up as connected prefixes by the router, because… they are:

R2:

R2#show ip route connected | begin ^Gateway
Gateway of last resort is not set

      2.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        2.2.2.0/24 is directly connected, Ethernet0/0
L        2.2.2.2/32 is directly connected, Ethernet0/0
      12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        12.12.12.0/24 is directly connected, Serial1/0
L        12.12.12.2/32 is directly connected, Serial1/0
      23.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        23.23.23.0/24 is directly connected, Serial1/1
L        23.23.23.2/32 is directly connected, Serial1/1

When we redistributed connected routes, we applied the filter that allows only Ethernet0/0 address to be redistributed. Since neither 12.12.12.0/24 nor 23.23.23.0/24 are associated with Ethernet0/0, they were not redistributed. We have filtered them out.

The Solution

So, how do we solve this problem? There are two solutions. One is to include 12.12.12.0/24 in OSPF process, or allow it in our route-map. The same applies to 23.23.23.0/24. We’ll use the second solution on R2.

We are going to hit the exact same problem on R3. To make things simpler and easier to follow, we’ll apply the same solution for the problem there. First off, let’s fix R2.

On R2 we used the single route-map. While we could add more match entries to it, let’s split it in two maps. One for EIGRP and one for OSPF. Just to make things clear and a little bit more scalable. Since I’m big proponent of not littering, I will remove the unused route-map, too! Here is the configuration.

R2:

route-map Connected-to-EIGRP permit 10
 match interface Ethernet0/0
!
route-map Connected-to-EIGRP permit 20
 match interface Serial1/1
!
route-map Connected-to-OSPF permit 10
 match interface Ethernet0/0
!
route-map Connected-to-OSPF permit 20
 match interface Serial1/0
!
router eigrp 12
 redistribute connected metric 1 1 1 1 1500 route-map Connected-to-EIGRP
!
router ospf 1
 redistribute connected subnets route-map Connected-to-OSPF
!
no route-map Connected

Before we continue, let’s take a look at R1 and R4.

R1:

R1#show ip route eigrp | begin ^Gateway
Gateway of last resort is not set

      2.0.0.0/24 is subnetted, 1 subnets
D EX     2.2.2.0 [170/2560512256] via 12.12.12.2, 00:20:52, Serial1/0
      23.0.0.0/24 is subnetted, 1 subnets
D EX     23.23.23.0 [170/2560512256] via 12.12.12.2, 00:00:05, Serial1/0
      34.0.0.0/24 is subnetted, 1 subnets
D EX     34.34.34.0 [170/2560512256] via 12.12.12.2, 00:35:44, Serial1/0

R4:

R4#show ip route rip | begin ^Gateway
Gateway of last resort is not set

      1.0.0.0/24 is subnetted, 1 subnets
R        1.1.1.0 [120/5] via 34.34.34.3, 00:00:20, Serial1/0
      2.0.0.0/24 is subnetted, 1 subnets
R        2.2.2.0 [120/5] via 34.34.34.3, 00:00:20, Serial1/0
      12.0.0.0/24 is subnetted, 1 subnets
R        12.12.12.0 [120/5] via 34.34.34.3, 00:00:20, Serial1/0
      23.0.0.0/24 is subnetted, 1 subnets
R        23.23.23.0 [120/1] via 34.34.34.3, 00:00:20, Serial1/0

Excellent. We solved that issue. Not taking care of this in the CCIE lab could be costly. Now that we know the trick, let’s move on to R3.

R3:

ip access-list standard Et0/0
 permit 3.3.3.0 0.0.0.255
!
ip access-list standard Se1/0
 permit 34.34.34.0 0.0.0.255
!
ip access-list standard Se1/1
 permit 23.23.23.0 0.0.0.255
!
route-map Connected-to-OSPF permit 10
 match ip address Et0/0
!
route-map Connected-to-OSPF permit 20
 match ip address Se1/0
!
route-map Connected-to-RIP permit 10
 match ip address Et0/0
!
route-map Connected-to-RIP permit 20
 match ip address Se1/1
!
router ospf 1
 redistribute connected subnets route-map Connected-to-OSPF
!
router rip
 redistribute connected metric 5 route-map Connected-to-RIP
!

Let’s again verify R1 and R4.

R1:

R1#show ip route eigrp | begin ^Gateway
Gateway of last resort is not set

      2.0.0.0/24 is subnetted, 1 subnets
D EX     2.2.2.0 [170/2560512256] via 12.12.12.2, 00:25:49, Serial1/0
      3.0.0.0/24 is subnetted, 1 subnets
D EX     3.3.3.0 [170/2560512256] via 12.12.12.2, 00:00:15, Serial1/0
      23.0.0.0/24 is subnetted, 1 subnets
D EX     23.23.23.0 [170/2560512256] via 12.12.12.2, 00:05:02, Serial1/0
      34.0.0.0/24 is subnetted, 1 subnets
D EX     34.34.34.0 [170/2560512256] via 12.12.12.2, 00:40:41, Serial1/0

R4:

R4#show ip route rip | begin ^Gateway
Gateway of last resort is not set

      1.0.0.0/24 is subnetted, 1 subnets
R        1.1.1.0 [120/5] via 34.34.34.3, 00:00:06, Serial1/0
      2.0.0.0/24 is subnetted, 1 subnets
R        2.2.2.0 [120/5] via 34.34.34.3, 00:00:06, Serial1/0
      3.0.0.0/24 is subnetted, 1 subnets
R        3.3.3.0 [120/5] via 34.34.34.3, 00:00:06, Serial1/0
      12.0.0.0/24 is subnetted, 1 subnets
R        12.12.12.0 [120/5] via 34.34.34.3, 00:00:06, Serial1/0
      23.0.0.0/24 is subnetted, 1 subnets
R        23.23.23.0 [120/5] via 34.34.34.3, 00:00:06, Serial1/0

Finally, we’re left with R4. We also need route-map here, but situation is much simpler on R4, as we have only one interface to worry about.

R4:

ip prefix-list Et0/0 seq 10 permit 4.4.4.0/24
!
route-map Connected-to-RIP permit 10
 match ip address prefix-list Et0/0
!
router rip
 redistribute connected metric 5 route-map Connected-to-RIP
!

Let’s see if R1 got this one.

R1:

R1#show ip route 4.4.4.0
Routing entry for 4.4.4.0/24
  Known via "eigrp 12", distance 170, metric 2560512256, type external
  Redistributing via eigrp 12
  Last update from 12.12.12.2 on Serial1/0, 00:00:24 ago
  Routing Descriptor Blocks:
  * 12.12.12.2, from 12.12.12.2, 00:00:24 ago, via Serial1/0
      Route metric is 2560512256, traffic share count is 1
      Total delay is 20010 microseconds, minimum bandwidth is 1 Kbit
      Reliability 1/255, minimum MTU 1500 bytes
      Loading 1/255, Hops 1

Excellent!

Final Verification

Let’s run quick full connectivity verification from R1 and R4.

R1:

R1#tclsh
R1(tcl)#foreach ip {
+>(tcl)#1.1.1.1
+>(tcl)#2.2.2.2
+>(tcl)#3.3.3.3
+>(tcl)#4.4.4.4
+>(tcl)#12.12.12.1
+>(tcl)#12.12.12.2
+>(tcl)#23.23.23.2
+>(tcl)#23.23.23.3
+>(tcl)#34.34.34.3
+>(tcl)#34.34.34.4
+>(tcl)#} { ping $ip repeat 3 timeout 1 }

Type escape sequence to abort.
Sending 3, 100-byte ICMP Echos to 1.1.1.1, timeout is 1 seconds:
!!!
Success rate is 100 percent (3/3), round-trip min/avg/max = 1/3/4 ms
Type escape sequence to abort.
Sending 3, 100-byte ICMP Echos to 2.2.2.2, timeout is 1 seconds:
!!!
Success rate is 100 percent (3/3), round-trip min/avg/max = 8/9/12 ms
Type escape sequence to abort.
Sending 3, 100-byte ICMP Echos to 3.3.3.3, timeout is 1 seconds:
!!!
Success rate is 100 percent (3/3), round-trip min/avg/max = 16/18/20 ms
Type escape sequence to abort.
Sending 3, 100-byte ICMP Echos to 4.4.4.4, timeout is 1 seconds:
!!!
Success rate is 100 percent (3/3), round-trip min/avg/max = 24/28/32 ms
Type escape sequence to abort.
Sending 3, 100-byte ICMP Echos to 12.12.12.1, timeout is 1 seconds:
!!!
Success rate is 100 percent (3/3), round-trip min/avg/max = 16/18/20 ms
Type escape sequence to abort.
Sending 3, 100-byte ICMP Echos to 12.12.12.2, timeout is 1 seconds:
!!!
Success rate is 100 percent (3/3), round-trip min/avg/max = 8/9/12 ms
Type escape sequence to abort.
Sending 3, 100-byte ICMP Echos to 23.23.23.2, timeout is 1 seconds:
!!!
Success rate is 100 percent (3/3), round-trip min/avg/max = 8/10/16 ms
Type escape sequence to abort.
Sending 3, 100-byte ICMP Echos to 23.23.23.3, timeout is 1 seconds:
!!!
Success rate is 100 percent (3/3), round-trip min/avg/max = 16/20/24 ms
Type escape sequence to abort.
Sending 3, 100-byte ICMP Echos to 34.34.34.3, timeout is 1 seconds:
!!!
Success rate is 100 percent (3/3), round-trip min/avg/max = 16/20/24 ms
Type escape sequence to abort.
Sending 3, 100-byte ICMP Echos to 34.34.34.4, timeout is 1 seconds:
!!!
Success rate is 100 percent (3/3), round-trip min/avg/max = 24/28/32 ms
R1(tcl)#tclquit

R4:

R4#tclsh
R4(tcl)#foreach ip {
+>(tcl)#1.1.1.1
+>(tcl)#2.2.2.2
+>(tcl)#3.3.3.3
+>(tcl)#4.4.4.4
+>(tcl)#12.12.12.1
+>(tcl)#12.12.12.2
+>(tcl)#23.23.23.2
+>(tcl)#23.23.23.3
+>(tcl)#34.34.34.3
+>(tcl)#34.34.34.4
+>(tcl)#} { ping $ip repeat 3 timeout 1 }

Type escape sequence to abort.
Sending 3, 100-byte ICMP Echos to 1.1.1.1, timeout is 1 seconds:
!!!
Success rate is 100 percent (3/3), round-trip min/avg/max = 20/25/28 ms
Type escape sequence to abort.
Sending 3, 100-byte ICMP Echos to 2.2.2.2, timeout is 1 seconds:
!!!
Success rate is 100 percent (3/3), round-trip min/avg/max = 16/17/20 ms
Type escape sequence to abort.
Sending 3, 100-byte ICMP Echos to 3.3.3.3, timeout is 1 seconds:
!!!
Success rate is 100 percent (3/3), round-trip min/avg/max = 8/9/12 ms
Type escape sequence to abort.
Sending 3, 100-byte ICMP Echos to 4.4.4.4, timeout is 1 seconds:
!!!
Success rate is 100 percent (3/3), round-trip min/avg/max = 4/5/8 ms
Type escape sequence to abort.
Sending 3, 100-byte ICMP Echos to 12.12.12.1, timeout is 1 seconds:
!!!
Success rate is 100 percent (3/3), round-trip min/avg/max = 24/26/28 ms
Type escape sequence to abort.
Sending 3, 100-byte ICMP Echos to 12.12.12.2, timeout is 1 seconds:
!!!
Success rate is 100 percent (3/3), round-trip min/avg/max = 16/20/24 ms
Type escape sequence to abort.
Sending 3, 100-byte ICMP Echos to 23.23.23.2, timeout is 1 seconds:
!!!
Success rate is 100 percent (3/3), round-trip min/avg/max = 16/17/20 ms
Type escape sequence to abort.
Sending 3, 100-byte ICMP Echos to 23.23.23.3, timeout is 1 seconds:
!!!
Success rate is 100 percent (3/3), round-trip min/avg/max = 8/12/16 ms
Type escape sequence to abort.
Sending 3, 100-byte ICMP Echos to 34.34.34.3, timeout is 1 seconds:
!!!
Success rate is 100 percent (3/3), round-trip min/avg/max = 8/10/12 ms
Type escape sequence to abort.
Sending 3, 100-byte ICMP Echos to 34.34.34.4, timeout is 1 seconds:
!!!
Success rate is 100 percent (3/3), round-trip min/avg/max = 16/18/20 ms
R4(tcl)#tclquit

Thanks for reading, I hope you had fun and learned something new. See you next time!


Marko Milivojevic – CCIE #18427
Senior Technical Instructor – IPexpert
Join our Online Study List

Redistributing Connected Routes, 4.6 out of 5 based on 7 ratings
Share and Enjoy:
  • RSS
  • Twitter
  • Facebook
  • Google Bookmarks
  • Digg
  • Print
  • Technorati
  • Slashdot
  • LinkedIn
  • del.icio.us
  • Reddit
  • Sphinn
  • Mixx
  • Blogplay
  • Netvibes
  • NewsVine
  • Live
  • Ping.fm
  • MySpace
  • Yahoo! Bookmarks
  • Yahoo! Buzz

Tags: , , , ,

10 Responses to “Redistributing Connected Routes”

  1. Abhinav says:

    For the following statement when you’re starting to redist connected routes :

    # R1: Redistribute all connected routes to RIP

    I think you mean EIGRP above ?

    VA:F [1.9.6_1107]
    Rating: 0.0/5 (0 votes cast)
  2. Pablo Alvarez says:

    Marko that was very good. just a small typo where it says (R1: Redistribute all connected routes to RIP) it should be EIGRP instead of RIP. Thank you.

    VA:F [1.9.6_1107]
    Rating: 0.0/5 (0 votes cast)
  3. Marcel Lammerse says:

    Thank you Marko, that was excellent! Funny, I just ran into this during one of my labs. Great timing :)

    VA:F [1.9.6_1107]
    Rating: 0.0/5 (0 votes cast)
  4. Siju says:

    Marco i is really excellent and help full.Thanks a lot.

    VA:F [1.9.6_1107]
    Rating: 0.0/5 (0 votes cast)
  5. Albert says:

    Thank you Marko, I have already finish it in a lab. I also use a “debug ip routing” command in all routers in order to see how the routes were deleted and added when the redistribution was applied or moved.
    Excellent blog!!!

    VA:F [1.9.6_1107]
    Rating: 0.0/5 (0 votes cast)

Leave a Reply