Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Verifying and Monitoring OSPF Configuration

Verifying an OSPF Configuration

To verify an OSPF configuration, perform these tasks:

Verifying OSPF-Enabled Interfaces

Purpose

Verify that OSPF is running on a particular interface and that the interface is in the desired area.

Action

From the CLI, enter the show ospf interface command.

Sample Output
command-name

Meaning

The output shows a list of the device interfaces that are configured for OSPF. Verify the following information:

  • Each interface on which OSPF is enabled is listed.

  • Under Area, each interface shows the area for which it was configured.

  • Under Intf and State, the device loopback (lo0.0) interface and LAN interface that are linked to the OSPF network's designated router (DR) are identified.

  • Under DR ID, the IP address of the OSPF network's designated router appears.

  • Under State, each interface shows a state of PtToPt to indicate a point-to-point connection. If the state is Waiting, check the output again after several seconds. A state of Down indicates a problem.

  • The designated router addresses always show a state of DR.

Verifying OSPF Neighbors

Purpose

OSPF neighbors are interfaces that have an immediate adjacency. On a point-to-point connection between the device and another router running OSPF, verify that each router has a single OSPF neighbor.

Action

From the CLI, enter the show ospf neighbor command.

Sample Output
command-name

Meaning

The output shows a list of the device's OSPF neighbors and their addresses, interfaces, states, router IDs, priorities, and number of seconds allowed for inactivity (“dead” time). Verify the following information:

  • Each interface that is immediately adjacent to the device is listed.

  • The device's own loopback address and the loopback addresses of any routers with which the device has an immediate adjacency are listed.

  • Under State, each neighbor shows a state of Full. Because full OSPF connectivity is established over a series of packet exchanges between clients, the OSPF link might take several seconds to establish. During that time, the state might be displayed as Attempt, Init, or 2way, depending on the stage of negotiation.

    If, after 30 seconds, the state is not Full, the OSPF configuration between the neighbors is not functioning correctly.

Verifying the Number of OSPF Routes

Purpose

Verify that the OSPF routing table has entries for the following:

  • Each subnetwork reachable through an OSPF link

  • Each loopback address reachable on the network

For example, Figure 1 shows a sample network with an OSPF topology.

Figure 1: Sample OSPF Network Topology Sample OSPF Network Topology

In this topology, OSPF is being run on all interfaces. Each segment in the network is identified by an address with a /24 prefix, with interfaces on either end of the segment being identified by unique IP addresses.

Action

From the CLI, enter the show ospf route command.

Sample Output
command-name

Meaning

The output lists each route, sorted by IP address. Routes are shown with a route type of Network, and loopback addresses are shown with a route type of Router.

For the example shown in Figure 1, verify that the OSPF routing table has 21 entries, one for each network segment and one for each router's loopback address.

Verifying Reachability of All Hosts in an OSPF Network

Purpose

By using the traceroute tool on each loopback address in the network, verify that all hosts in the network are reachable from each device.

Action

For each device in the OSPF network:

  1. In the J-Web interface, select Troubleshoot>Traceroute.

  2. In the Host Name box, type the name of a host for which you want to verify reachability from the device.

  3. Click Start. Output appears on a separate page.

Sample Output
command-name

Meaning

Each numbered row in the output indicates a routing “hop” in the path to the host. The three-time increments indicate the round-trip time (RTT) between the device and the hop, for each traceroute packet. To ensure that the OSPF network is healthy, verify the following information:

  • The final hop in the list is the host you want to reach.

  • The number of expected hops to the host matches the number of hops in the traceroute output. The appearance of more hops than expected in the output indicates that a network segment is likely not reachable. In this case, verify the routes with the show ospf route command.

For information about show ospf route, see Verifying the Number of OSPF Routes

Tracing OSPF Protocol Traffic

Tracing operations record detailed messages about the operation of OSPF. You can trace OSPF protocol traffic to help debug OSPF protocol issues. When you trace OSPF protocol traffic, you specify the name of the file and the type of information you want to trace.

You can specify the following OSPF protocol-specific trace options:

  • database-description—All database description packets, which are used in synchronizing the OSPF topological database

  • error—OSPF error packets

  • event—OSPF state transitions

  • flooding—Link-state flooding packets

  • graceful-restart—Graceful-restart events

  • hello—Hello packets, which are used to establish neighbor adjacencies and to determine whether neighbors are reachable

  • ldp-synchronization—Synchronization events between OSPF and LDP

  • lsa-ack—Link-state acknowledgment packets, which are used in synchronizing the OSPF topological database

  • lsa-analysis—Link-state analysis. Specific to the Juniper Networks implementation of OSPF, Junos OS performs LSA analysis before running the shortest-path-first (SPF) algorithm. LSA analysis helps to speed the calculations performed by the SPF algorithm.

  • lsa-request—Link-state request packets, which are used in synchronizing the OSPF topological database

  • lsa-update—Link-state updates packets, which are used in synchronizing the OSPF topological database

  • nsr-synchronization—Nonstop routing synchronization events

  • on-demand—Trace demand circuit extensions

  • packet-dump—Dump the contents of selected packet types

  • packets—All OSPF packets

  • restart-signaling—(OSPFv2 only) Restart-signaling graceful restart events

  • spf—Shortest path first (SPF) calculations

You can optionally specify one or more of the following flag modifiers:

  • detail—Detailed trace information

  • receive—Packets being received

  • send—Packets being transmitted

Note:

Use the detail flag modifier with caution as it might cause the CPU to become very busy.

Global tracing options are inherited from the configuration set by the traceoptions statement at the [edit routing-options] hierarchy level. You can override the following global trace options for the OSPF protocol using the traceoptions flag statement included at the [edit protocols ospf] hierarchy level:

  • all—All tracing operations

  • general—All normal operations and routing table changes (a combination of the normal and route trace operations)

  • normal—Normal events

  • policy—Policy processing

  • route—Routing information

  • state—State transitions

  • task—Routing protocol task processing

  • timer—Routing protocol timer processing

Note:

Use the trace flag all with caution as it might cause the CPU to become very busy.

Example: Tracing OSPF Protocol Traffic

This example shows how to trace OSPF protocol traffic.

Requirements

This example assumes that OSPF is properly configured and running in your network, and you want to trace OSPF protocol traffic for debugging purposes.

Overview

You can trace OSPF protocol traffic to help debug OSPF protocol issues. When you trace OSPF protocol traffic, you specify the name of the file and the type of information you want to trace. All files are placed in a directory on the routing device’s hard disk. On M Series and T Series routers, trace files are stored in the /var/log directory.

This example shows a few configurations that might be useful when debugging OSPF protocol issues. The verification output displayed is specific to each configuration.

Tip:

To keep track of your log files, create a meaningful and descriptive name so it is easy to remember the content of the trace file. We recommend that you place global routing protocol tracing output in the file routing-log, and OSPF tracing output in the file ospf-log.

In the first example, you globally enable tracing operations for all routing protocols that are actively running on your routing device to the file routing-log. With this configuration, you keep the default settings for the trace file size and the number of trace files. After enabling global tracing operations, you enable tracing operations to provide detailed information about OSPF packets, including link-state advertisements, requests, and updates, database description packets, and hello packets to the file ospf-log, and you configure the following options:

  • size—Specifies the maximum size of each trace file, in KB, MB, or GB. In this example, you configure 10 KB as the maximum size. When the file reaches its maximum size, it is renamed with a .0 extension. When the file again reaches its maximum size, it is renamed with a .1 extension, and the newly created file is renamed with a .0 extension. This renaming scheme continues until the maximum number of trace files is reached. Then, the oldest trace file is overwritten. If you specify a maximum file size, you must also specify a maximum number of trace files with the files option. You specify k for KB, m for MB, and g for GB. By default, the trace file size is 128 KB. The file size range is 10 KB through the maximum file size supported on your system.

  • files—Specifies the maximum number of trace files. In this example, you configure a maximum of 5 trace files. When a trace file reaches its maximum size, it is renamed with a .0 extension, then a .1 extension, and so on until the maximum number of trace files is reached. When the maximum number of files is reached, the oldest trace file is overwritten. If you specify a maximum number of files, you must also specify a maximum file size with the size option. By default, there are 10 files. The range is 2 through 1000 files.

In the second example, you trace all SPF calculations to the file ospf-log by including the spf flag. You keep the default settings for the trace file size and the number of trace files.

In the third example, you trace the creation, receipt, and retransmission of all LSAs to the file ospf-log by including the lsa-request, lsa-update, and lsa-ack flags. You keep the default settings for the trace file size and the number of trace files.

Configuration

Configuring Global Tracing Operations and Tracing OSPF Packet Information

CLI Quick Configuration

To quickly enable global tracing operations for all routing protocols actively running on your routing device and to trace detailed information about OSPF packets, copy the following commands and paste them into the CLI.

Step-by-Step Procedure

The following example requires you to navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Modifying the Junos OS Configuration in the CLI User Guide.

To configure global routing tracing operations and tracing operations for OSPF packets:

  1. Configure tracing at the routing options level to collect information about the active routing protocols on your routing device.

  2. Configure the filename for the global trace file.

  3. Configure the filename for the OSPF trace file.

    Note:

    To specify OSPFv3, include the ospf3 statement at the [edit protocols] hierarchy level.

  4. Configure the maximum number of trace files.

  5. Configure the maximum size of each trace file.

  6. Configure tracing flags.

  7. If you are done configuring the device, commit the configuration.

Results

Confirm your configuration by entering the show routing-options and the show protocols ospf commands. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

To confirm your OSPFv3 configuration, enter the show routing-options and the show protocols ospf3 commands.

Tracing SPF Calculations

CLI Quick Configuration

To quickly trace SPF calculations, copy the following commands and paste them into the CLI.

Step-by-Step Procedure

To configure SPF tracing operations for OSPF:

  1. Configure the filename for the OSPF trace file.

    Note:

    To specify OSPFv3, include the ospf3 statement at the [edit protocols] hierarchy level.

  2. Configure the SPF tracing flag.

  3. If you are done configuring the device, commit the configuration.

Results

Confirm your configuration by entering the show protocols ospf command. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

To confirm your OSPFv3 configuration, enter the show protocols ospf3 command.

Tracing Link-State Advertisements

CLI Quick Configuration

To quickly trace the creation, receipt, and retransmission of all LSAs, copy the following commands and paste them into the CLI.

Step-by-Step Procedure

To configure link-state advertisement tracing operations for OSPF:

  1. Configure the filename for the OSPF trace file.

    Note:

    To specify OSPFv3, include the ospf3 statement at the [edit protocols] hierarchy level.

  2. Configure the link-state advertisement tracing flags.

  3. If you are done configuring the device, commit the configuration.

Results

Confirm your configuration by entering the show protocols ospf command. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

To confirm your OSPFv3 configuration, enter the show protocols ospf3 command.

Verification

Confirm that the configuration is working properly.

Verifying Trace Operations

Purpose

Verify that the Trace options field displays the configured trace operations, and verify that the Trace file field displays the location on the routing device where the file is saved, the name of the file to receive the output of the tracing operation, and the size of the file.

Action

From operational mode, enter the show ospf overview extensive command for OSPFv2, and enter the show ospf3 overview extensive command for OSPFv3.