Thursday 24 November 2011

17 - IPv4 Redistribution - Implementing Simple Redistribution


I have already setup the lab (done this the other night, basic IP connectivity as per above)

Lets break down step 1 and configure EIGRP and OSPF on the respective routers;


R1(config)#router eigrp 100
R1(config-router)#network 10.0.0.0
R1(config-router)#no auto-summary


R2(config)#router eigrp 100
R2(config-router)#network 10.1.12.0 0.0.0.255
R2(config-router)#no auto-summary

00:06:27: %DUAL-5-NBRCHANGE: IP-EIGRP 100: Neighbor 10.1.12.1 (Serial0/0) is up: new adjacency


R2(config)#router ospf 1
R2(config-router)#network 10.1.23.0 0.0.0.255 area 0


R3(config)#router ospf 1
R3(config-router)#networ 10.0.0.0 0.255.255.255 area 0

*Mar  1 00:11:30.395: %OSPF-5-ADJCHG: Process 1, Nbr 10.1.23.2 on Serial1/0 from LOADING to FULL, Loading Done


So router2 should now show both EIGRP and OSPF routes;

R2#show ip route

     10.0.0.0/8 is variably subnetted, 16 subnets, 2 masks
O       10.1.10.1/32 [110/65] via 10.1.23.3, 00:00:06, Serial0/1
O       10.1.11.1/32 [110/65] via 10.1.23.3, 00:00:06, Serial0/1
O       10.1.8.1/32 [110/65] via 10.1.23.3, 00:00:06, Serial0/1
O       10.1.9.1/32 [110/65] via 10.1.23.3, 00:00:06, Serial0/1
O       10.1.11.5/32 [110/65] via 10.1.23.3, 00:00:06, Serial0/1
C       10.1.12.1/32 is directly connected, Serial0/0
C       10.1.12.0/24 is directly connected, Serial0/0
D       10.1.3.0/24 [90/20640000] via 10.1.12.1, 00:11:53, Serial0/0
D       10.1.2.0/24 [90/20537600] via 10.1.12.1, 00:11:53, Serial0/0
D       10.1.1.0/24 [90/20640000] via 10.1.12.1, 00:11:53, Serial0/0
D       10.1.0.0/24 [90/20640000] via 10.1.12.1, 00:11:53, Serial0/0
O       10.1.7.1/32 [110/65] via 10.1.23.3, 00:00:06, Serial0/1
D       10.1.6.0/24 [90/20640000] via 10.1.12.1, 00:11:53, Serial0/0
D       10.1.5.0/24 [90/20640000] via 10.1.12.1, 00:11:53, Serial0/0
D       10.1.4.0/24 [90/20640000] via 10.1.12.1, 00:11:53, Serial0/0
C       10.1.23.0/24 is directly connected, Serial0/1

Lets just tweak the serial point-to-point links

R3(config-if)#int loopback7
R3(config-if)#ip ospf network point-to-point
R3(config-if)#int loopback8
R3(config-if)#ip ospf network point-to-point
R3(config-if)#int loopback9
R3(config-if)#ip ospf network point-to-point
R3(config-if)#int loopback10
R3(config-if)#ip ospf network point-to-point
R3(config-if)#int loopback11
R3(config-if)#ip ospf network point-to-point
R3(config-if)#int loopback12
R3(config-if)#ip ospf network point-to-point
R3(config-if)#int loopback13
R3(config-if)#ip ospf network point-to-point

Thats better now the loopbacks look like real point-to-point links instead of that /32 host mask

R2#show ip route

     10.0.0.0/8 is variably subnetted, 17 subnets, 3 masks
O       10.1.11.0/30 [110/65] via 10.1.23.3, 00:01:41, Serial0/1
O       10.1.10.0/24 [110/65] via 10.1.23.3, 00:01:41, Serial0/1
O       10.1.9.0/24 [110/65] via 10.1.23.3, 00:01:41, Serial0/1
O       10.1.8.0/24 [110/65] via 10.1.23.3, 00:01:41, Serial0/1
O       10.1.11.4/30 [110/65] via 10.1.23.3, 00:01:41, Serial0/1
C       10.1.12.1/32 is directly connected, Serial0/0
C       10.1.12.0/24 is directly connected, Serial0/0
O       10.1.11.8/30 [110/65] via 10.1.23.3, 00:01:41, Serial0/1
D       10.1.3.0/24 [90/20640000] via 10.1.12.1, 00:16:37, Serial0/0
D       10.1.2.0/24 [90/20537600] via 10.1.12.1, 00:16:37, Serial0/0
D       10.1.1.0/24 [90/20640000] via 10.1.12.1, 00:16:37, Serial0/0
D       10.1.0.0/24 [90/20640000] via 10.1.12.1, 00:16:37, Serial0/0
O       10.1.7.0/24 [110/65] via 10.1.23.3, 00:01:41, Serial0/1
D       10.1.6.0/24 [90/20640000] via 10.1.12.1, 00:16:37, Serial0/0
D       10.1.5.0/24 [90/20640000] via 10.1.12.1, 00:16:37, Serial0/0
D       10.1.4.0/24 [90/20640000] via 10.1.12.1, 00:16:37, Serial0/0
C       10.1.23.0/24 is directly connected, Serial0/1




The problem we have with this is loosing the metric, both EIGRP and OSPF have totally different metrics:
OSPF = cost
EIGRP = composite of bandwidth and delay

As shown above RIP and EIGRP networks when distributed have an infinite metric by default
So OSPF will never see this routes as they are "unreachable" (ill prove this in abit)

OSPF networks have a default metric of 20 when distributed, BGP is whatever it was when you redistributed from the internal network (stays the same)


NOW, lets start with getting them EIGRP routes into OSPF, for this we have to go under the OSPF process;

R2(config)#router ospf 1
R2(config-router)#redistribute eigrp 100 ?
  metric       Metric for redistributed routes
  metric-type  OSPF/IS-IS exterior metric type for redistributed routes
  route-map    Route map reference
  subnets      Consider subnets for redistribution into OSPF
  tag          Set tag for routes redistributed into OSPF
  <cr>

Now by default, when we do redistribution it will try and  summarise the networks (which if you recall from our instructions we are not allowed to do)

SO we can use the "subnets" commands to keep their subnet class, rather than be summarised back to their orginal classful networks


If i miss off the subnet command (you are prompted this fact)

R2(config-router)#redistribute eigrp 100
% Only classful networks will be redistributed



R2(config-router)#redistribute eigrp 100 subnets


R3#show ip route


     10.0.0.0/8 is variably subnetted, 17 subnets, 3 masks
C       10.1.11.0/30 is directly connected, Loopback11
C       10.1.10.0/24 is directly connected, Loopback10
C       10.1.9.0/24 is directly connected, Loopback9
C       10.1.8.0/24 is directly connected, Loopback8
C       10.1.11.4/30 is directly connected, Loopback12
O E2    10.1.12.1/32 [110/20] via 10.1.23.2, 00:00:18, Serial1/0
O E2    10.1.12.0/24 [110/20] via 10.1.23.2, 00:00:18, Serial1/0
O E2    10.1.3.0/24 [110/20] via 10.1.23.2, 00:00:18, Serial1/0
C       10.1.11.8/30 is directly connected, Loopback13
C       10.1.2.0/24 is directly connected, FastEthernet0/0
O E2    10.1.1.0/24 [110/20] via 10.1.23.2, 00:00:18, Serial1/0
O E2    10.1.0.0/24 [110/20] via 10.1.23.2, 00:00:18, Serial1/0
C       10.1.7.0/24 is directly connected, Loopback7
O E2    10.1.6.0/24 [110/20] via 10.1.23.2, 00:00:18, Serial1/0
O E2    10.1.5.0/24 [110/20] via 10.1.23.2, 00:00:18, Serial1/0
O E2    10.1.4.0/24 [110/20] via 10.1.23.2, 00:00:18, Serial1/0
C       10.1.23.0/24 is directly connected, Serial1/0


NOTICE by default the routes come thru as E2 routes "E2 - OSPF external type 2"
E1 = These incriment their metric
E2 = these dont

NOTE:
If we want to change this can do via:
R2(config-router)#redistribute eigrp 100 subnets metric-type ?
  1  Set OSPF External Type 1 metrics
  2  Set OSPF External Type 2 metrics  <- - DEFAULT (wont show under OSPF, its default)


SO if this works, great, if not we can change the metric by this command;

R2(config)#router ospf 1
R2(config-router)#redistribute eigrp 100 subnets metric 100

This now sets any redistributed routes via EIGRP to a new default metric of 100 NOT 20 (as they are E2 routes)


R3#show ip route

Gateway of last resort is not set

     10.0.0.0/8 is variably subnetted, 17 subnets, 3 masks
C       10.1.11.0/30 is directly connected, Loopback11
C       10.1.10.0/24 is directly connected, Loopback10
C       10.1.9.0/24 is directly connected, Loopback9
C       10.1.8.0/24 is directly connected, Loopback8
C       10.1.11.4/30 is directly connected, Loopback12
O E2    10.1.12.1/32 [110/100] via 10.1.23.2, 00:00:10, Serial1/0
O E2    10.1.12.0/24 [110/100] via 10.1.23.2, 00:00:10, Serial1/0
O E2    10.1.3.0/24 [110/100] via 10.1.23.2, 00:00:10, Serial1/0

C       10.1.11.8/30 is directly connected, Loopback13
C       10.1.2.0/24 is directly connected, FastEthernet0/0
O E2    10.1.1.0/24 [110/100] via 10.1.23.2, 00:00:10, Serial1/0
O E2    10.1.0.0/24 [110/100] via 10.1.23.2, 00:00:10, Serial1/0

C       10.1.7.0/24 is directly connected, Loopback7
O E2    10.1.6.0/24 [110/100] via 10.1.23.2, 00:00:10, Serial1/0
O E2    10.1.5.0/24 [110/100] via 10.1.23.2, 00:00:10, Serial1/0
O E2    10.1.4.0/24 [110/100] via 10.1.23.2, 00:00:10, Serial1/0

C       10.1.23.0/24 is directly connected, Serial1/0

The cost has changed!

RIGHT, lets get OSPF redistributed into EIGRP, so lets go under the EIGRP process as that is what we want to redistribute into;

R2(config)#router eigrp 100
R2(config-router)#redistribute ospf 1 ?
  match      Redistribution of OSPF routes
  metric     Metric for redistributed routes
  route-map  Route map reference
  vrf        VPN Routing/Forwarding Instance

Not as many options here, but they are pretty self explanatory, lets run with what we have;

R2(config-router)#redistribute ospf 1


lets jump over to R1 and check whats happening;

R1#show ip route


     10.0.0.0/8 is variably subnetted, 9 subnets, 2 masks
C       10.1.12.2/32 is directly connected, Serial0/0
C       10.1.12.0/24 is directly connected, Serial0/0
C       10.1.3.0/24 is directly connected, Loopback3
C       10.1.2.0/24 is directly connected, Ethernet0/0
C       10.1.1.0/24 is directly connected, Loopback1
C       10.1.0.0/24 is directly connected, Loopback0
C       10.1.6.0/24 is directly connected, Loopback6
C       10.1.5.0/24 is directly connected, Loopback5
C       10.1.4.0/24 is directly connected, Loopback4

They are not there.......WHY?!!??
Recall what i said earlier, these routes are being redistributed with an infinite metric ... so the routes are not valid, hence they are not in the routing table

We need to set a metric;

R2(config-router)#redistribute ospf 1  metric ?
  <1-4294967295>  Bandwidth metric in Kbits per second

The question in this lab, does not state what metric we have to use, so lets just go with 100 for each metric (K Value of EIGRP);


R2(config-router)#redistribute ospf 1  metric 100 100 100 100 100


Lets go and check it out on router 1:

R1#show ip route


     10.0.0.0/8 is variably subnetted, 17 subnets, 3 masks
D EX    10.1.11.0/30 [170/26137600] via 10.1.12.2, 00:00:20, Serial0/0
D EX    10.1.10.0/24 [170/26137600] via 10.1.12.2, 00:00:20, Serial0/0
D EX    10.1.9.0/24 [170/26137600] via 10.1.12.2, 00:00:20, Serial0/0
D EX    10.1.8.0/24 [170/26137600] via 10.1.12.2, 00:00:20, Serial0/0
D EX    10.1.11.4/30 [170/26137600] via 10.1.12.2, 00:00:20, Serial0/0
C       10.1.12.2/32 is directly connected, Serial0/0
C       10.1.12.0/24 is directly connected, Serial0/0
D EX    10.1.11.8/30 [170/26137600] via 10.1.12.2, 00:00:20, Serial0/0
C       10.1.3.0/24 is directly connected, Loopback3
C       10.1.2.0/24 is directly connected, Ethernet0/0
C       10.1.1.0/24 is directly connected, Loopback1
C       10.1.0.0/24 is directly connected, Loopback0
D EX    10.1.7.0/24 [170/26137600] via 10.1.12.2, 00:00:20, Serial0/0
C       10.1.6.0/24 is directly connected, Loopback6
C       10.1.5.0/24 is directly connected, Loopback5
C       10.1.4.0/24 is directly connected, Loopback4
D EX    10.1.23.0/24 [170/26137600] via 10.1.12.2, 00:00:20, Serial0/0

AWESOME!!! lets ping one of the loopbacks on R3 (becuase we all love a good ping!)


R1#ping 10.1.10.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.10.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/4/8 ms


Yeah boi! Steps 1 & 2 are now complete :0)