Friday, October 26, 2012

BGP Neighbor/Advising Routes with loopback interfaces


Creating BGP neighbors with physical interfaces can become troublesome when that interface is changed or is flapping, best practice is to create neighbors with loopback interfaces that are always up if the router is. Additional commands are needed to create a neighbor with loopback interfaces and an extra command is needed for EBGP peers.

The update source command is needed to change the interface from a physical interface to a loopback. The ebgp multihop command is required to tell BGP how many hops away the loopback interface is.

R1(config)#router bgp 100
R1(config-router)#neighbor 3.3.3.3 remote-as 200
R1(config-router)#neighbor 3.3.3.3 update-source loopback 0
R1(config-router)#neighbor 3.3.3.3 ebgp-multihop 2

R3(config)#router bgp 200
R3(config-router)#neighbor 1.1.1.1 remote-as 100        
R3(config-router)#neighbor 1.1.1.1 update-source loopback 0
R3(config-router)#neighbor 1.1.1.1 ebgp-multihop 2

The neighborship between R1 and R3 still won't happen unless they know how to reach each others loopback addresses. A static route can accomplish this.


R1(config)#ip route 3.3.3.3 255.255.255.255 172.12.123.3
R3(config)#ip route 1.1.1.1 255.255.255.255 172.12.123.1

With routes to each others loopbacks the adjacency comes up.

R3(config)#
*Mar  1 00:39:47.866: %BGP-5-ADJCHANGE: neighbor 1.1.1.1 Up


Verifying the BGP adjacency with the show ip bgp summary command.

R1#show ip bgp sum
BGP router identifier 1.1.1.1, local AS number 100
BGP table version is 1, main routing table version 1

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
3.3.3.3         4   200       4       4        1    0    0 00:00:32        0

Below I create adjacencies between R1 and R2, no ebgp multi-hop command is needed because these are internal BGP peers, both in AS 100.

R1(config)#router bgp 100
R1(config-router)#neighbor 2.2.2.2 remote-as 100
R1(config-router)#neighbor 2.2.2.2 update-source loopback 0

R2(config)#router bgp 100
R2(config-router)#neighbor 1.1.1.1 remote-as 100
R2(config-router)#neighbor 1.1.1.1 update-source loopback 0
R2(config-router)#       
*Mar  1 00:44:01.574: %BGP-5-ADJCHANGE: neighbor 1.1.1.1 Up 

R1 now has adjacencies with both R2 and R3.

R1#show ip bgp sum
BGP router identifier 1.1.1.1, local AS number 100
BGP table version is 1, main routing table version 1

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
2.2.2.2         4   100       4       4        1    0    0 00:00:42        0
3.3.3.3         4   200       8       8        1    0    0 00:04:55        0

Similar to OSPF, to advise a route into BGP we use the network command along with the actual mask not the inverse mask. The mask isn't required but can cause problems when classful boundaries are overlapping. 

R3(config)#router bgp 200
R3(config-router)#network 3.3.3.3 mask 255.255.255.255
R3(config-router)#network 33.33.33.33 mask 255.255.255.255     

The show ip bgp command will show the routes learned by BGP. Both routes are valid and best. BGP has many attributes that decide which route is valid and best when multiple routes to a destination are known.

R1#show ip bgp   
BGP table version is 4, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 3.3.3.3/32       3.3.3.3                  0             0 200 i
*> 33.33.33.33/32   3.3.3.3                  0             0 200 i


Wednesday, October 24, 2012

BGP Neighbors with physical interfaces



BGP is an external gateway protocol that is used between autonomous systems. Normally these are seen inside of an ISP network or between an enterprise network with multiple ISPs.  Unlike EIGRP the  AS number doesn't have to match to become a peer but it is classified differently. An IBGP is a peer between two spokes with the same AS number and an EBGP is a peer between two spokes with different AS numbers. BGP doesn't automatically detect a neighbor so a neighbor command is used along with the remote as number. In the example below I configured a peers using the connected interfaces.


R1(config)#router bgp 100
R1(config-router)#neighbor 172.12.123.2 remote-as 100
R1(config-router)#neighbor 172.12.123.3 remote-as 200

R2(config)#router bgp 100
R2(config-router)#neighbor 172.12.123.1 remote-as 100
*Mar  1 00:49:35.068: %BGP-5-ADJCHANGE: neighbor 172.12.123.21Up 

R3(config)#router bgp 200
R3(config-router)#neighbor 172.12.123.1 remote-as 100
R3(config-router)#
*Mar  1 00:53:12.084: %BGP-5-ADJCHANGE: neighbor 172.12.123.1 Up 

Using the ip BGP summary command I can see a summary of the neighbor relationships. An empty State means it's established or you can use the ip bgp neighbor command to see the state of the relationship.

R1#show ip bgp sum          
BGP router identifier 172.12.123.1, local AS number 100
BGP table version is 1, main routing table version 1

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
172.12.123.2    4   100      10      10        1    0    0 00:06:10        0
172.12.123.3    4   200       6       6        1    0    0 00:02:32        0

R1#show ip bgp neighbors 172.12.123.3          
BGP neighbor is 172.12.123.3,  remote AS 200, external link
  BGP version 4, remote router ID 172.12.123.3
  BGP state = Established, up for 00:02:54
  Last read 00:00:54, hold time is 180, keepalive interval is 60 seconds
  Neighbor capabilities:
    Route refresh: advertised and received(old & new)
    Address family IPv4 Unicast: advertised and received.....................

Also the type of peer is shown as internal (ibgp)or external (ebgp)

R1#show ip bgp neighbors 172.12.123.2
BGP neighbor is 172.12.123.2,  remote AS 100, internal link
  BGP version 4, remote router ID 172.12.123.2
  BGP state = Established, up for 00:06:57
  Last read 00:00:56, hold time is 180, keepalive interval is 60 seconds
  Neighbor capabilities:
    Route refresh: advertised and received(old & new)
    Address family IPv4 Unicast: advertised and received.......................................


Sunday, October 21, 2012

OSPF Neighbor Authentication


Neighbor authentication is pretty straightforward, there is a clear text and md5 option. I show the md5 option, clear test is similar just minus the md5 stuff in the command. Adjacencies will break when setting up authentication.

R1(config-if)#ip ospf authentication message-digest

R1(config-if)#ip ospf message-digest-key 1 md5 CCNP



R1(config-if)#
R1#
*Mar  1 01:03:18.335: %SYS-5-CONFIG_I: Configured from console by console
*Mar  1 01:03:23.375: %OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.2 on Serial0/0 from FULL to DOWN, Neighbor Down: Dead timer expired
*Mar  1 01:03:35.407: %OSPF-5-ADJCHG: Process 1, Nbr 3.3.3.3 on Serial0/0 from FULL to DOWN, Neighbor Down: Dead timer expired


R2(config)#interface serial 0/0
R2(config-if)#ip ospf authentication message-digest
R2(config-if)#ip ospf message-digest-key 1 md5 CCNP




R3(config)#int serial 0/0
R3(config-if)#ip ospf message-digest-key 1 md5 CCNP
R3(config-if)#ip ospf authentication message-digest


R1#show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.2           0   FULL/DROTHER    00:01:46    172.12.123.2    Serial0/0
3.3.3.3           0   FULL/DROTHER    00:01:58    172.12.123.3    Serial0/0

OSPF Area-Based Route Summarization


Area 0 can't  be a stub area so if you need to reduce the routing table there is also route summarization. Looking at R3 I can see the OSPF table is bit lengthy, so I will summarize both IA and E1 routes. E2 is the default OSPF external route type but I changed it with the metric-type command when I redistributed them into OSPF. There are two different ways to summarize routes depending on the type of routes you want summarize. First I will redistribute inter-area routes using the area range command. I will summarize 8.0.0.0,9.0.0.0 and 10.0.0.0. The binary results gives me a 8.0.0.0 248.0.0.0 summary address. The area is the area in which the routes originated from not where they are going for the area range command.



R3#show ip route ospf
     1.0.0.0/32 is subnetted, 1 subnets
O IA    1.1.1.1 [110/65] via 172.12.123.1, 00:07:11, Serial0/0
     2.0.0.0/32 is subnetted, 1 subnets
O IA    2.2.2.2 [110/65] via 172.12.123.2, 00:07:11, Serial0/0
     5.0.0.0/32 is subnetted, 1 subnets
O E1    5.1.1.1 [110/84] via 172.12.123.1, 00:03:54, Serial0/0
     6.0.0.0/32 is subnetted, 1 subnets
O E1    6.1.1.1 [110/84] via 172.12.123.1, 00:03:54, Serial0/0
     7.0.0.0/32 is subnetted, 1 subnets
O E1    7.1.1.1 [110/84] via 172.12.123.1, 00:03:54, Serial0/0
     8.0.0.0/32 is subnetted, 1 subnets
O IA    8.1.1.1 [110/65] via 172.12.123.1, 00:00:02, Serial0/0
     9.0.0.0/32 is subnetted, 1 subnets
O IA    9.1.1.1 [110/65] via 172.12.123.1, 00:00:02, Serial0/0
     10.0.0.0/32 is subnetted, 1 subnets
O IA    10.1.1.1 [110/65] via 172.12.123.1, 00:00:02, Serial0/0
     15.0.0.0/24 is subnetted, 1 subnets
O E1    15.1.1.0 [110/84] via 172.12.123.1, 00:03:54, Serial0/0





R1(config)#router ospf 1
R1(config-router)#area 1 range 8.0.0.0 248.0.0.0 


I can see that the routes are not summarize into OIA 8.0.0.0/5, the route is smaller but now I will summarize the external routes.



R3#show ip route ospf
     1.0.0.0/32 is subnetted, 1 subnets
O IA    1.1.1.1 [110/65] via 172.12.123.1, 00:06:35, Serial0/0
     2.0.0.0/32 is subnetted, 1 subnets
O IA    2.2.2.2 [110/65] via 172.12.123.2, 00:06:35, Serial0/0
     5.0.0.0/32 is subnetted, 1 subnets
O E1    5.1.1.1 [110/84] via 172.12.123.1, 00:03:18, Serial0/0
     6.0.0.0/32 is subnetted, 1 subnets
O E1    6.1.1.1 [110/84] via 172.12.123.1, 00:03:18, Serial0/0
     7.0.0.0/32 is subnetted, 1 subnets
O E1    7.1.1.1 [110/84] via 172.12.123.1, 00:03:18, Serial0/0
     15.0.0.0/24 is subnetted, 1 subnets
O E1    15.1.1.0 [110/84] via 172.12.123.1, 00:03:18, Serial0/0
O IA 8.0.0.0/5 [110/65] via 172.12.123.1, 00:03:23, Serial0/0


To summarize external routes I use the command summary-address, the routes are 5.1.1.1,6.1.1.1.1,7.1.1.1 that I want summarize. The binary result gives me 4.0.0.0 with a mask of 252.0.0.0.

R1(config)#router ospf 1
R1(config-router)#summary-address 4.0.0.0 252.0.0.0

I can now see the summary address of O E1 4.0.0.0, the summary address takes the type of the routes being summarize. The ip routing table is now much smaller. Connectivity is still working.

R3#show ip route ospf
     1.0.0.0/32 is subnetted, 1 subnets
O IA    1.1.1.1 [110/65] via 172.12.123.1, 00:13:43, Serial0/0
     2.0.0.0/32 is subnetted, 1 subnets
O IA    2.2.2.2 [110/65] via 172.12.123.2, 00:13:43, Serial0/0
     15.0.0.0/24 is subnetted, 1 subnets
O E1    15.1.1.0 [110/84] via 172.12.123.1, 00:06:13, Serial0/0
O E1 4.0.0.0/6 [110/84] via 172.12.123.1, 00:00:01, Serial0/0
O IA 8.0.0.0/5 [110/65] via 172.12.123.1, 00:06:18, Serial0/0

R3#ping 5.1.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 5.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 32/49/88 ms
R3#



Friday, October 19, 2012

OSPF NSSA-NSSTSA

The general rule with OSPF is that you can't make an ASBR  a stub router but it is possible by bending the rules with a Not So Stubby Area. At this point the above configuration has been configured. What if we needed R3 to be an ASBR by redistributing another ospf route 14.14.14.14, area 34 could not be a stub area anymore because of the stub network rules. NSSA uses Type 7 LSAs to allow this breakage of the rules.


R3(config)#int lo14

R3(config-if)#ip address 14.14.14.14 255.255.255.255
R3(config-if)#router ospf 1
R3(config-router)#redistribute connected subnets



R1#show ip route ospf
     2.0.0.0/32 is subnetted, 1 subnets
O IA    2.2.2.2 [110/65] via 172.12.123.2, 00:01:02, Serial0/0
     3.0.0.0/32 is subnetted, 1 subnets
O IA    3.3.3.3 [110/65] via 172.12.123.3, 00:01:02, Serial0/0
     172.34.0.0/24 is subnetted, 1 subnets
O IA    172.34.34.0 [110/65] via 172.12.123.3, 00:01:02, Serial0/0
     14.0.0.0/32 is subnetted, 1 subnets
O E2    14.14.14.14 [110/20] via 172.12.123.3, 00:01:02, Serial0/0

R1#show ip route rip  
R    5.0.0.0/8 [120/1] via 15.0.0.5, 00:00:21, FastEthernet0/0
R    6.0.0.0/8 [120/1] via 15.0.0.5, 00:00:21, FastEthernet0/0
R    7.0.0.0/8 [120/1] via 15.0.0.5, 00:00:21, FastEthernet0/0

R2#show ip route ospf 
     1.0.0.0/32 is subnetted, 1 subnets
O IA    1.1.1.1 [110/65] via 172.12.123.1, 00:06:53, Serial0/0
     3.0.0.0/32 is subnetted, 1 subnets
O IA    3.3.3.3 [110/65] via 172.12.123.3, 00:06:53, Serial0/0
O E2 5.0.0.0/8 [110/20] via 172.12.123.1, 00:00:41, Serial0/0
O E2 6.0.0.0/8 [110/20] via 172.12.123.1, 00:00:41, Serial0/0
     172.34.0.0/24 is subnetted, 1 subnets
O IA    172.34.34.0 [110/65] via 172.12.123.3, 00:06:53, Serial0/0
O E2 7.0.0.0/8 [110/20] via 172.12.123.1, 00:00:41, Serial0/0
O E2 15.0.0.0/8 [110/20] via 172.12.123.1, 00:00:31, Serial0/0

R3#show ip route ospf 
     1.0.0.0/32 is subnetted, 1 subnets
O IA    1.1.1.1 [110/65] via 172.12.123.1, 00:07:28, Serial0/0
     2.0.0.0/32 is subnetted, 1 subnets
O IA    2.2.2.2 [110/65] via 172.12.123.2, 00:07:28, Serial0/0
O E2 5.0.0.0/8 [110/20] via 172.12.123.1, 00:01:16, Serial0/0
O E2 6.0.0.0/8 [110/20] via 172.12.123.1, 00:01:16, Serial0/0
O E2 7.0.0.0/8 [110/20] via 172.12.123.1, 00:01:16, Serial0/0
O E2 15.0.0.0/8 [110/20] via 172.12.123.1, 00:01:06, Serial0/0


R4#show ip route ospf 
     1.0.0.0/32 is subnetted, 1 subnets
O IA    1.1.1.1 [110/66] via 172.34.34.3, 00:10:16, FastEthernet0/0
     2.0.0.0/32 is subnetted, 1 subnets
O IA    2.2.2.2 [110/66] via 172.34.34.3, 00:10:16, FastEthernet0/0
     3.0.0.0/32 is subnetted, 1 subnets
O IA    3.3.3.3 [110/2] via 172.34.34.3, 00:10:16, FastEthernet0/0
O E2 5.0.0.0/8 [110/20] via 172.34.34.3, 00:00:34, FastEthernet0/0
O E2 6.0.0.0/8 [110/20] via 172.34.34.3, 00:00:34, FastEthernet0/0
     172.12.0.0/24 is subnetted, 1 subnets
O IA    172.12.123.0 [110/65] via 172.34.34.3, 00:10:16, FastEthernet0/0
O E2 7.0.0.0/8 [110/20] via 172.34.34.3, 00:00:34, FastEthernet0/0
O E2 15.0.0.0/8 [110/20] via 172.34.34.3, 00:00:24, FastEthernet0/0

R5#show ip route rip
     1.0.0.0/32 is subnetted, 1 subnets
R       1.1.1.1 [120/2] via 15.0.0.1, 00:00:06, FastEthernet0/0
     2.0.0.0/32 is subnetted, 1 subnets
R       2.2.2.2 [120/2] via 15.0.0.1, 00:00:06, FastEthernet0/0
     3.0.0.0/32 is subnetted, 1 subnets
R       3.3.3.3 [120/2] via 15.0.0.1, 00:00:06, FastEthernet0/0
     172.12.0.0/24 is subnetted, 1 subnets
R       172.12.123.0 [120/2] via 15.0.0.1, 00:00:06, FastEthernet0/0
     172.34.0.0/24 is subnetted, 1 subnets
R       172.34.34.0 [120/2] via 15.0.0.1, 00:00:06, FastEthernet0/0

Now we want to make our routing tables complete yet concise and realize that R4 next hop address are all through area 34 to R3. We want to create a stub area but we can't because R3 is ASBR but with the NSSA command we still can. 


R3(config-router)#area 34 nssa    
R3(config-router)#
*Mar  1 00:47:59.031: %OSPF-5-ADJCHG: Process 1, Nbr 172.34.34.4 on FastEthernet0/0 from FULL to DOWN, Neighbor Down: Adjacency forced to reset

R4(config-router)#area 34 nssa
R4(config-router)#
*Mar  1 00:48:15.069: %OSPF-5-ADJCHG: Process 1, Nbr 3.3.3.3 on FastEthernet0/0 from FULL to DOWN, Neighbor Down: Adjacency forced to reset
*Mar  1 00:48:18.711: %OSPF-5-ADJCHG: Process 1, Nbr 3.3.3.3 on FastEthernet0/0 from LOADING to FULL, Loading Done

R4 now has all external routes removed from the table but we can still make it smaller by using the no summary command, which is called a not so stubby total stub area.

R4#show ip route ospf 
     1.0.0.0/32 is subnetted, 1 subnets
O IA    1.1.1.1 [110/66] via 172.34.34.3, 00:00:24, FastEthernet0/0
     2.0.0.0/32 is subnetted, 1 subnets
O IA    2.2.2.2 [110/66] via 172.34.34.3, 00:00:24, FastEthernet0/0
     3.0.0.0/32 is subnetted, 1 subnets
O IA    3.3.3.3 [110/2] via 172.34.34.3, 00:00:24, FastEthernet0/0
     172.12.0.0/24 is subnetted, 1 subnets
O IA    172.12.123.0 [110/65] via 172.34.34.3, 00:00:24, FastEthernet0/0
     14.0.0.0/32 is subnetted, 1 subnets
O N2    14.14.14.14 [110/20] via 172.34.34.3, 00:00:24, FastEthernet0/0

R3(config-router)#area 34 nssa no-summary 

R4(config-router)#area 34 nssa no-summary

R4 has a default no summary route now like we had before with a total stub area.

R4#show ip route ospf 
     14.0.0.0/32 is subnetted, 1 subnets
O N2    14.14.14.14 [110/20] via 172.34.34.3, 00:00:23, FastEthernet0/0
O*IA 0.0.0.0/0 [110/2] via 172.34.34.3, 00:00:28, FastEthernet0/0

Monday, October 8, 2012

Starting up Blog Again

I took a break from studying for my CCNP. I'm back on track and should be taking the route exam in a few weeks.

Monday, August 13, 2012

OSPF Stub and Total Stub Area


Router 1 has a view of all networks , without redistribution the others won't learn all networks

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 not set
     1.0.0.0/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback0
     2.0.0.0/32 is subnetted, 1 subnets
O IA    2.2.2.2 [110/65] via 172.12.123.2, 00:31:01, Serial0/0
     3.0.0.0/32 is subnetted, 1 subnets
O IA    3.3.3.3 [110/65] via 172.12.123.3, 00:31:01, Serial0/0
R    5.0.0.0/8 [120/1] via 15.0.0.5, 00:00:27, FastEthernet0/0
R    6.0.0.0/8 [120/1] via 15.0.0.5, 00:00:27, FastEthernet0/0
     172.12.0.0/24 is subnetted, 1 subnets
C       172.12.123.0 is directly connected, Serial0/0
     172.34.0.0/24 is subnetted, 1 subnets
O IA    172.34.34.0 [110/65] via 172.12.123.3, 00:31:01, Serial0/0
R    7.0.0.0/8 [120/1] via 15.0.0.5, 00:00:27, FastEthernet0/0
C    15.0.0.0/8 is directly connected, FastEthernet0/0




R5#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 not set

C    5.0.0.0/8 is directly connected, Loopback0
C    6.0.0.0/8 is directly connected, Loopback1
C    7.0.0.0/8 is directly connected, Loopback2
C    15.0.0.0/8 is directly connected, FastEthernet0/0




R5#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 not set

C    5.0.0.0/8 is directly connected, Loopback0
C    6.0.0.0/8 is directly connected, Loopback1
C    7.0.0.0/8 is directly connected, Loopback2
C    15.0.0.0/8 is directly connected, FastEthernet0/0

Redistributing OSPF routes into RIP is fairly easy, only a seed metric is needed because RIP has a max hop count of 16. Connected routes will need to be redistributed as well because connectivity won't be possible for all routes.  

R1(config)#router rip
R1(config-router)#redistribute ospf 1 metric 2
R1(config-router)#redistribute connected metric 2

I now have one way redistribute. I can see the OSPF routes on R5 coming in as RIP. Below I tried to ping one of the newly added routes but I was unsuccessful because the OSPF networks do not know how to reach the RIP routes.

R5#show ip route rip 
     1.0.0.0/32 is subnetted, 1 subnets
R       1.1.1.1 [120/1] via 15.0.0.1, 00:00:23, FastEthernet0/0
     2.0.0.0/32 is subnetted, 1 subnets
R       2.2.2.2 [120/2] via 15.0.0.1, 00:00:23, FastEthernet0/0
     3.0.0.0/32 is subnetted, 1 subnets
R       3.3.3.3 [120/2] via 15.0.0.1, 00:00:23, FastEthernet0/0
     172.12.0.0/24 is subnetted, 1 subnets
R       172.12.123.0 [120/1] via 15.0.0.1, 00:00:23, FastEthernet0/0
     172.34.0.0/24 is subnetted, 1 subnets
R       172.34.34.0 [120/2] via 15.0.0.1, 00:00:23, FastEthernet0/0

Failed ping without two-way redistribution 

R5#ping 172.34.34.4

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.34.34.4, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)

Here I redistributed RIP into OSPF with the subnet commands. This is important because we want the subnets to be in the routes and not just the classful boundaries. 

R1(config)#router ospf 1
R1(config-router)#redistribute rip subnets 
R1(config-router)#redistribute connected subnets


I can see here that R4 now can see the RIP routes in it's routing table. The code OE2 are the rip routes, it stands for OSPF learned external type 2 route. The default is type 2 (metric from last router), type 1 is another type (metric from destination router)

R4#show ip route ospf 
     1.0.0.0/32 is subnetted, 1 subnets
O IA    1.1.1.1 [110/66] via 172.34.34.3, 00:43:39, FastEthernet0/0
     2.0.0.0/32 is subnetted, 1 subnets
O IA    2.2.2.2 [110/66] via 172.34.34.3, 00:43:39, FastEthernet0/0
     3.0.0.0/32 is subnetted, 1 subnets
O IA    3.3.3.3 [110/2] via 172.34.34.3, 00:43:40, FastEthernet0/0
O E2 5.0.0.0/8 [110/20] via 172.34.34.3, 00:00:58, FastEthernet0/0
O E2 6.0.0.0/8 [110/20] via 172.34.34.3, 00:00:58, FastEthernet0/0
     172.12.0.0/24 is subnetted, 1 subnets
O IA    172.12.123.0 [110/65] via 172.34.34.3, 00:43:40, FastEthernet0/0
O E2 7.0.0.0/8 [110/20] via 172.34.34.3, 00:00:58, FastEthernet0/0
O E2 15.0.0.0/8 [110/20] via 172.34.34.3, 00:00:58, FastEthernet0/0

Now the pings are successful across the network.

R5#ping 172.34.34.4

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


Creating a stub in OSPF is needed when I want to reduce the size of the routing table. Looking up R4 routing table I can see that the exit interface for all routes ifs fastethernet 0/0. Unlike RIP and EIGRP, OSPF stub in configured per area not interface.

R3(config)#router ospf 1
R3(config-router)#area 34 stub 

R4(config)#router ospf 1
R4(config-router)#area 34 stub

Inter-area routes are still here but the external routes have been stubbed

R4#show ip route ospf 
     1.0.0.0/32 is subnetted, 1 subnets
O IA    1.1.1.1 [110/66] via 172.34.34.3, 03:18:10, FastEthernet0/0
     2.0.0.0/32 is subnetted, 1 subnets
O IA    2.2.2.2 [110/66] via 172.34.34.3, 03:18:10, FastEthernet0/0
     3.0.0.0/32 is subnetted, 1 subnets
O IA    3.3.3.3 [110/2] via 172.34.34.3, 03:18:10, FastEthernet0/0
     172.12.0.0/24 is subnetted, 1 subnets
O IA    172.12.123.0 [110/65] via 172.34.34.3, 03:18:10, FastEthernet0/0
O*IA 0.0.0.0/0 [110/2] via 172.34.34.3, 03:18:10, FastEthernet0/0

A total stub area will summarized inter-area routes as well

R3(config)#router ospf 1
R3(config-router)# area 34 stub  no-summary


Now I have a Total Stub Area with only one OSPF route

R4#show ip route ospf 
O*IA 0.0.0.0/0 [110/2] via 172.34.34.3, 00:01:14, FastEthernet0/0