Guest

IP Routing

OSPF Routers Connected by a Numbered Point-to-Point Link

Document ID: 47861

Updated: Aug 10, 2005

   Print

Introduction

This document shows two Open Shortest Path First (OSPF) routers connected by a numbered point-to-point link.

Prerequisites

Requirements

There are no specific requirements for this document.

Components Used

This document is not restricted to specific software and hardware versions.

Conventions

For more information on document conventions, see the Cisco Technical Tips Conventions.

Configure

In this section, you are presented with the information to configure the features described in this document.

Note: To find additional information on the commands used in this document, use the Command Lookup Tool (registered customers only) .

Network Diagram

This document uses the network setup shown in this diagram.

ospfdb2a.gif

Configurations

This document uses the configurations shown here.

Router 1.1.1.1
Current configuration:

hostname r1.1.1.1

interface Loopback0
 ip address 1.1.1.1 255.0.0.0
 
interface Ethernet2/0/0
 ip address 4.0.0.1 255.0.0.0
 
interface Serial2/1/0
 ip address 5.0.0.1 255.0.0.0
 
router ospf 1
 network 4.0.0.0 0.255.255.255 area 0
 network 5.0.0.0 0.255.255.255 area 0

end

Router 2.2.2.2
Current configuration:

hostname r2.2.2.2

interface Loopback0
 ip address 2.2.2.2 255.0.0.0
 
interface Ethernet0/0/4
 ip address 6.0.0.2 255.0.0.0
 
interface Serial2/1/0
 ip address 5.0.0.2 255.0.0.0
 
router ospf 2
 network 6.0.0.0 0.255.255.255 area 0
 network 5.0.0.0 0.255.255.255 area 0

end

Verify

This section provides information you can use to confirm your configuration is working properly.

Certain show commands are supported by the Output Interpreter Tool (registered customers only) , which allows you to view an analysis of show command output.

  • show ip ospf database —Displays a list of the Link State Advertisements (LSAs) and types them into a link state database. This list shows only the information in the LSA header.

  • show ip ospf database [router] [link-state-id] —Displays a list of all of a router's LSAs in the database. LSAs are produced by every router. These fundamental LSAs list all of the routers' links or interfaces, along with the states and outgoing costs of the links. They are also flooded only within the area in which they originate.

Examine the OSPF Database

To see how the OSPF database looks given this network environment, look at the output of the show ip ospf database command.

r2.2.2.2#show ip ospf database 

       OSPF Router with ID (2.2.2.2) (Process ID 2) 

                Router Link States (Area 0) 

Link ID   ADV Router   Age   Seq#          Checksum   Link count 
1.1.1.1   1.1.1.1      522   0x80000002    0x96D3         3 
2.2.2.2   2.2.2.2      401   0x80000003    0x9FC2         3 

r2.2.2.2#show ip ospf database router 1.1.1.1 

       OSPF Router with ID (2.2.2.2) (Process ID 2) 

                Router Link States (Area 0) 

  LS age: 540 
  Options: (No TOS-capability, DC) 
  LS Type: Router Links 
  Link State ID: 1.1.1.1
  
!--- For router links, the Link State Id is always the same 
  !--- as the Advertising Router (the next line).

  Advertising Router: 1.1.1.1
  
!--- This is the router ID of the router that  
  !--- created this LSA. 

  LS Seq Number: 80000002 
  Checksum: 0x96D3 
  Length: 60 
   Number of Links: 3 

    Link connected to: another Router (point-to-point)
    
!--- This entry shows that this router (1.1.1.1) is a neighbor
    !--- with 2.2.2.2.

     (Link ID) Neighboring Router ID: 2.2.2.2 
     (Link Data) Router Interface address: 5.0.0.1
     
!--- Interface on this router (1.1.1.1) which connects the 
     !--- neighbor (2.2.2.2).

      Number of TOS metrics: 0 
       TOS 0 Metrics: 64
     	
!--- The OSPF cost of the link is 64.


    Link connected to: a Stub Network
	
!--- This represents the subnet of the serial link 5.0.0.0/8. 

     (Link ID) Network/subnet number: 5.0.0.0 
     (Link Data) Network Mask: 255.0.0.0 
      Number of TOS metrics: 0 
       TOS 0 Metrics: 64
		
!--- The OSPF cost of the link is 64.


    Link connected to: a Stub Network
	
!--- This represents the subnet of the 
!--- Ethernet segment 4.0.0.0/8.

     (Link ID) Network/subnet number: 4.0.0.0 
     (Link Data) Network Mask: 255.0.0.0 
      Number of TOS metrics: 0 
       TOS 0 Metrics: 10
		
!--- The OSPF cost of the link is 10.

  

r2.2.2.2#show ip ospf database router 2.2.2.2 

       OSPF Router with ID (2.2.2.2) (Process ID 2) 

                Router Link States (Area 0) 

  LS age: 424 
  Options: (No TOS-capability, DC) 
  LS Type: Router Links 
  Link State ID: 2.2.2.2 
  Advertising Router: 2.2.2.2 
  LS Seq Number: 80000003 
  Checksum: 0x9FC2 
  Length: 60 
   Number of Links: 3 

    Link connected to: a Stub Network 
     (Link ID) Network/subnet number: 6.0.0.0 
     (Link Data) Network Mask: 255.0.0.0 
      Number of TOS metrics: 0 
       TOS 0 Metrics: 10 

    Link connected to: another Router (point-to-point) 
     (Link ID) Neighboring Router ID: 1.1.1.1 
     (Link Data) Router Interface address: 5.0.0.2 
      Number of TOS metrics: 0 
       TOS 0 Metrics: 64 
  
    Link connected to: a Stub Network 
     (Link ID) Network/subnet number: 5.0.0.0 
     (Link Data) Network Mask: 255.0.0.0 
      Number of TOS metrics: 0 
       TOS 0 Metrics: 64

Calculate the Shortest Path

This section calculates the shortest path tree from the perspective of Router 2.2.2.2.

Router 2.2.2.2 looks in its own LSA and sees that Router 1.1.1.1 is a neighbor. Router 2.2.2.2 looks at 1.1.1.1's router LSA to verify that 1.1.1.1 sees 2.2.2.2 as a neighbor. If both routers see each other as neighbors, then they are considered reachable.

Each router also checks its local neighbor table (you can check it using the show ip ospf neighbor command) to verify that its interface and the neighbor's interface are on a common IP subnet. If they are, the routers install routes for any stub networks listed in their neighbor's router LSA.

In this example, Router 2.2.2.2 installs a route for 4.0.0.0/8 in its routing table because Router 1.1.1.1 listed 4.0.0.0/8 as a stub network in its own router LSA. Router 1.1.1.1 also listed 5.0.0.0/8 as a stub network. However, Router 2.2.2.2 does not install an OSPF route for 5.0.0.0/8 because it has a connected route for 5.0.0.0/8. A connected route is always better than a dynamically learned route.

Router 2_2_2_2#
show ip route ospf
 
O    4.0.0.0/8 [110/74] via 5.0.0.1, 00:09:26, Serial0/1/0 

Router 1_1_1_1#show ip route ospf 
O    6.0.0.0/8 [110/74] via 5.0.0.2, 00:00:49, Serial2/1/0 

Troubleshoot

There is currently no specific troubleshooting information available for this configuration.

Related Information

Updated: Aug 10, 2005
Document ID: 47861