O'Reilly logo

JUNOS Cookbook by Aviva Garrett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

12.15. Tracing OSPF Protocol Traffic

Problem

You are setting up OSPF on your network and want to keep a running log of OSPF protocol packets that the router is sending to help track any problems that might occur during the configuration process.

Solution

Set up a tracing file that captures information about OSPF protocol operations:

	[edit protocols ospf]
	aviva@RouterG# set traceoptions file ospf-log
	aviva@RouterG# set traceoptions flag hello
	aviva@RouterG# set traceoptions flag error
	aviva@RouterG# set traceoptions flag general

To stop the tracing, remove the traceoptions statement from the configuration:

	[edit protocols ospf]
	aviva@RouterG# delete traceoptions

Discussion

To debug OSPF operations, use the JUNOS tracing facility to track the packets that OSPF is sending. You specify the name of the file to which you want to collect the information and the type of information you want to trace. In this example, we are logging general OSPF traffic information as well as Hello packets and errors in the ospf-log file, which is on the router's hard disk in the directories /var/log (on M-series and T-series routers) and /cf/var/log (on J-series routers).

Some things you see in the logfile are Hello packets sent to and received from neighbors:

	Jun 14 21:49:36  
OSPF rcvd Hello 10.0.16.2 -> 224.0.0.5 (fe-0/0/0.0, IFL 0x42) Jun 14 21:49:36 Version 2, length 48, ID 192.168.19.1, area 0.0.0.1 Jun 14 21:49:36 checksum 0x0, authtype 0 Jun 14 21:49:36 mask 255.255.255.0, hello_ivl 10, opts 0x2, prio ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required