Which command configures OSPF on the point-to-point link between routers R1 and R2

Now that you have OSPF's key concepts and terminology mastered, you are ready to configure OSPF. Configuring OSFP on a Cisco routers entails two main steps:

1. Enable OSPF with the router ospf <process id> command.

2. Identify the interfaces that will be OSPF with the network address wildcard mask area command. The wildcard mask indicates which bits are pertinent (0 bits) and which bits aren't (1 bits). For example, the wildcard mask 0.0.255.255 indicates that the router must match the first two bytes, but the last two bytes are irrelevant and are included in routing protocol updates.

Let's configure the network shown in Figure 6.7 for OSPF.

In this configuration, we'll assign the WAN links to be in the backbone and the Ethernet networks in area 1 for router R1, area 2 for router R2, and area 3 for router R3. We'll also use MD5 authentication in the backbone and assign a process ID (local significance only) as 1 for R1, 2 for R2, and 3 for R3. This OSPF process number is not the autonomous system number. Listings 6.24 through 6.26 show the configurations for routers R1, R2, and R3 with the described setup.

Which command configures OSPF on the point-to-point link between routers R1 and R2

Listing 6.24 Configuration for router R1 with OSPF.

hostname R1

interface Ethernet0 ip address 10.1.6.1 255.255.255.0

interface Serial0 ip address 10.1.7.2 255.255.255.0 ip ospf message-digest-key 1 md5 ccie

interface Serial1 ip address 10.1.5.2 255.255.255.0 ip ospf message-digest-key 1 md5 ccie router ospf 1

network 10.1.6.0 0.0.0.255 area 1 network 10.1.7.0 0.0.0.255 area 0 network 10.1.5.0 0.0.0.255 area 0 area 0 authentication message-digest

Listing 6.25 Configurations for router R2 with OSPF.

hostname R2 interface Ethernet0 ip address 10.1.1.1 255.255.255.0

interface Serial1 ip address 10.1.7.1 255.255.255.0 ip ospf message-digest-key 1 md5 ccie i router ospf 2

network 10.1.1.0 0.0.0.255 area 2 network 10.1.7.0 0.0.0.255 area 0 network 10.1.2.0 0.0.0.255 area 0 area 0 authentication message-digest

Listing 6.26 Configurations for router R3 with OSPF.

hostname R3 interface Ethernet0 ip address 10.1.3.1 255.255.255.0

interface Serial0 ip address 10.1.5.1 255.255.255.0 ip ospf message-digest-key 1 md5 ccie

interface Serial1 ip address 10.1.2.2 255.255.255.0 ip ospf message-digest-key 1 md5 ccie

router ospf 3

network 10.1.3.0 0.0.0.255 area 3 network 10.1.5.0 0.0.0.255 area 0 network 10.1.2.0 0.0.0.255 area 0 area 0 authentication message-digest

Listing 6.27 provides the routing table from the viewpoint of router R1.

Listing 6.27 The show ip route command for router R1 with OSPF configured.

R1#sh ip route

10.0.0.0/24 is subnetted, 6 subnets

O IA 10.1.3.0 [110/1572] via 10.1.5.1, 00:09:31, Serial1

O 10.1.2.0 [110/3124] via 10.1.5.1, 00:09:32, Serial1

O IA 10.1.1.0 [110/1572] via 10.1.7.1, 00:09:32, SerialO C 10.1.7.0 is directly connected, Serial0

C 10.1.6.0 is directly connected, Ethernet0

C 10.1.5.0 is directly connected, Serial1

As you can see in Listing 6.27, the remote networks in areas 2 and 3 are denoted by O IA on the left-hand side, which means they are inter-area routers. O denotes IP networks in the same area for OSPF. These networks are intra-area routes. The administrative distance for OSPF is 110, and the cost is paired together in the square brackets. The cost to reach network 10.1.3.0 is 1572.

Notice the process ID is different in all three routers. Listing 6.28 displays some of the vital information about this OSPF network.

Listing 6.28 The show ip ospf int command after configuring OSPF.

R1#sh ip ospf int s 0 Serial0 is up, line protocol is up Internet Address 10.1.7.2/24, Area 0

...Network Type POINT_TO_POINT, Cost: 1562

Transmit Delay is 1 sec, State POINT_TO_POINT, Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5

Hello due in 00:00:03 Neighbor Count is 1, Adjacent neighbor count is 1

Adjacent with neighbor 9.1.1.1 Suppress hello for 0 neighbor(s) Message digest authentication enabled Youngest key id is 1

The show ip ospf int command displays the characteristics of the interface including the hello interval (10 seconds) and the dead interval (4 x 10 = 40 seconds). You can also see in Listing 6.28 that authentication is used on this link. The state of the interface is POINT_TO_POINT, and network type is also POINT_TO_POINT.

As mentioned earlier, OSPF supports a number of network types for different media types, including:

► Point to Point—This network is a link between two routers over a physical interface, such as a serial line.

► Broadcast—This network type is typical in LAN environments.

► Non-broadcast—The type is typical in non-broadcast media such as X25 networks. Neighbor statements are required here to form an OSPF adjacency.

Listing 6.29 displays the OSPF protocol characteristics using the show ip protocols IOS command.

Listing 6.29 The show ip protocols command after configuring OSPF.

R1# show ip protocols Routing Protocol is "ospf 1" Sending updates every 0 seconds

Invalid after 0 seconds, hold down 0, flushed after 0 Outgoing update filter list for all interfaces is not set Incoming update filter list for all interfaces is not set Redistributing: ospf 1 Routing for Networks: 10.1.6.0/24 10.1.7.0/24 10.1.5.0/24 Routing Information Sources:

Gateway Distance Last Update

10.1.8.2 110 00:12:22 10.1.9.1 110 00:36:44

9.1.1.1 110 00:12:23

Distance: (default is 110)

As you can see in Listing 6.29, the OSPF default administrative distance is 110. To display the neighbors when using OSPF, type the show ip ospf neighbor command, as shown in Listing 6.30.

Listing 6.30 The sh ip ospf neighbor command after configuring OSPF.

R1#sh ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface

9.1.1.1 1 FULL/ - 00:00:35 10.1.7.1 SerialO

10.1.8.2 1 FULL/ - 00:00:33 10.1.5.1 Serial1

Listing 6.30 indicates that router R1 it has full visibility of routers R2 and R3. To set a default route in OSPF, issue the default-information originate command. Table 6.5 provides a summary of useful OSPF commands.

Table 6.5 Summary of OSPF commands.

Command

Description

network address wildcard

Defines which interfaces will be advertised.

mask area area-id

neighbor ip address

Configures a neighbor statically. Typically used in non-

priority <0-255>

broadcast networks, such as Frame Relay or X.25.

summary-address

Provides external summarization to another

address mask

autonomous system.

(continued)

Table 6.5 Summary of OSPF commands (continued).

Command

Description

area area-id range mask

Provides a summarization of OSPF networks.

area area-id stub [no summary]

Defines an area as a stub area.

area area-id virtual-link router-id

Specifies a virtual link configuration.

show ip ospf virtual-links

Displays virtual links.

area area-id nssa

Creates a not so stubby area.

show ip route

Displays a routing table.

show ip ospf interface

Displays configuration parameters on interface, such as hello time.

show ip ospf neighbor

Displays adjacencies

show ip ospf

Displays the number of times SPF have run and which areas the router is configured for.

show ip ospf database

Displays the topological database. The router ID is listed here.

Debug ip ospf adj

Turns on OSPF adjacency events.

OSPF FAQ

Because OSPF is widely used, this section presents a quick FAQ-like presentation to assist in rounding out your knowledge about OSPF.

1. What OSPF packets types are used by Cisco routers?

► Hello packets—Used to discover neighbors.

► LSA packets—Used to send link-state acknowledgements.

► LSR packets—Used to send link-state requests.

► Database packets—Used to describe a link-state database.

2. What is OSPF's default hello time interval?

The default is 10 seconds. The dead interval is four times the hello interval.

3. What is the formula used to calculate the OSPF cost of any interface?

The formula is 108/bandwidth. For Ethernet the default cost is 108/107=10. You can override this default calculation by using the ip ospf cost <value> IOS command.

4. Why is MD5 authentication preferred over clear text authentication?

MD5 uses encryption to send a password across the medium, whereas clear text passwords are visible with a network protocol analyzer.

5. Does OSPF run over FDDI, Token Ring, and ATM LANE,? Yes. OSPF can run over FDDI.,Token Ring, and ATM LANE.

6. Can OSPF support other protocols, such as AppleTalk and IPX? No. OSPF is used for routing IP only.

Was this article helpful?

Configure an OSPF routing process by issuing the "router ospf" command in global configuration mode. Define the interfaces on which OSPF runs and define the area ID for those interfaces by issuing the "network area" command in router configuration mode.

In which way does router R1 operate differently than router R2?

In which way does router R1 operate differently than router R2? A. R1 sends LSA types 5 and 7, while R2 sends type 1, 2, and 7 LSAs.

What is the highest OSPF priority?

Setting Priority for the Selection of the Designated Router Default priority for an OSPF interface is 1. The range is from 0 to 255.