Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation
 

Related Documentation

 

Example: Configuring OSPF Trace Options

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.

[edit] set routing-options traceoptions file routing-logset protocols ospf traceoptions file ospf-logset protocols ospf traceoptions file files 5 size 10kset protocols ospf traceoptions flag lsa-ackset protocols ospf traceoptions flag database-descriptionset protocols ospf traceoptions flag helloset protocols ospf traceoptions flag lsa-updateset protocols ospf traceoptions flag lsa-request

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 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.
    [edit]user@host# edit routing-options traceoptions
  2. Configure the filename for the global trace file.
    [edit routing-options traceoptions]user@host# set file routing-log
  3. Configure the filename for the OSPF trace file.

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

    [edit]user@host# edit protocols ospf traceoptionsuser@host# set file ospf-log
  4. Configure the maximum number of trace files.
    [edit protocols ospf traceoptions]user@host# set file files 5
  5. Configure the maximum size of each trace file.
    [edit protocols ospf traceoptions]user@host# set file size 10k
  6. Configure tracing flags.
    [edit protocols ospf traceoptions]user@host# set flag lsa-ackuser@host# set flag database-descriptionuser@host# set flag hellouser@host# set flag lsa-updateuser@host# set flag lsa-request
  7. If you are done configuring the device, commit the configuration.
    [edit protocols ospf traceoptions]user@host# commit

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.

user@host# show routing-options
traceoptions {file routing-log;}
user@host# show protocols ospf
traceoptions {file ospf-log size 10k files 5;flag lsa-ack;flag database-description;flag hello;flag lsa-update;flag lsa-request;}

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.

[edit] set protocols ospf traceoptions file ospf-logset protocols ospf traceoptions flag spf

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.

    [edit]user@host# edit protocols ospf traceoptionsuser@host# set file ospf-log
  2. Configure the SPF tracing flag.
    [edit protocols ospf traceoptions]user@host# set flag spf
  3. If you are done configuring the device, commit the configuration.
    [edit protocols ospf traceoptions]user@host# commit

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.

user@host# show protocols ospf
traceoptions { file ospf-log ;flag spf;}

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.

[edit] set protocols ospf traceoptions file ospf-logset protocols ospf traceoptions flag lsa-requestset protocols ospf traceoptions flag lsa-updateset protocols ospf traceoptions flag lsa-ack

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.

    [edit]user@host# edit protocols ospf traceoptionsuser@host# set file ospf-log
  2. Configure the link-state advertisement tracing flags.
    [edit protocols ospf traceoptions]user@host# set flag lsa-requestuser@host# set flag lsa-updateuser@host# set flag lsa-ack
  3. If you are done configuring the device, commit the configuration.
    [edit protocols ospf traceoptions]user@host# commit

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.

user@host# show protocols ospf
traceoptions {file ospf-log;flag lsa-request;flag lsa-update;flag lsa-ack;}

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.

 

Related Documentation

 

Published: 2013-07-09

 

Related Documentation

 

Published: 2013-07-09