Tracing RIP Protocol Traffic

Problem

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

Solution

You set up a trace file that captures all information about RIP protocol update messages:

[edit protocols rip] aviva@RouterA# set traceoptions file rip-update-log aviva@RouterA# set traceoptions flag update aviva@RouterA# show traceoptions { file rip-update-log; flag update; }

 

Discussion

When you need to debug RIP operations, you can use the JUNOS tracing facility to track the packets that RIP 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 RIP update traffic information in the file named rip-update-log, which is on the router's hard disk in the directory /var/log.

To see the RIP protocol update messages, look at the contents of the file:

aviva@RouterA> show log rip-update-log Mar 31 10:10:47 trace_on: Tracing to "/var/log/rip-update-log" started Mar 31 10:10:51 received response: command 2, version 2, mbz: 0; 5 routes. Mar 31 10:11:00 received response: command 2, version 2, mbz: 0; 8 routes. Mar 31 10:11:13 Preparing to send RIPv2 updates. Mar 31 10:11:13 Update job: sending 20 msgs; group: alpha-rip-group. Mar 31 10:11:13 nbr se-0/0/3.0; msgp: 0x866ee00. Mar 31 10:11:13 sending msg 0x866ee04, 6 rtes Mar 31 10:11:13 nbr se-0/0/3.0 done. Mar 31 10:11:13 Group alpha-rip-group done. Mar 31 10:11:13 New group beta-rip-group. Mar 31 10:11:13 New nbr fe-0/0/1.0; msgp 0x8672000. Mar 31 10:11:13 sending msg 0x8672004, 8 rtes Mar 31 10:11:13 nbr fe-0/0/1.0 done. Mar 31 10:11:13 Group beta- rip-group done. Mar 31 10:11:13 Update job done! Mar 31 10:11:20 received response: command 2, version 2, mbz: 0; 5 routes.

What you are seeing here is the standard RIP message update process. Every 30 seconds, RIP sends an unsolicited update message that contains the complete routing table to every neighboring router. This router has two RIP neighbors, reachable through interfaces se-0/0/3 and fe-0/0/1. In this update, the router sends six routes to the neighbor on the serial interface and eight routes to the neighbor of the Fast Ethernet interface. The second and third lines of the file show that the local router has received two updates from its two RIP neighbors, one with five and the other with eight routes.

Over time, logfiles can get very large. RIP is a very chatty protocol. You can see from the timestamps in this example that tracing has been on for about 40 seconds. Similar information is added to the file every 30 seconds. If you want to save the logfile for future analysis, you can copy the file to a server:

aviva@RouterA> file copy /var/log/rip-update-log server1:rip-update-log-20050227

If you no longer need the information in the file, you can delete the contents:

aviva@RouterA> clear log rip-update-log

Deleting the file's contents does not turn off tracing. To stop the tracing altogether, you need to either deactivate or remove the traceoptions statement from the configuration:

[edit protocols rip] aviva@RouterA# deactivate traceoptions aviva@RouterA# show protocols rip inactive: traceoptions { file rip-update-log; flag update; }

or:

[edit protocols rip] aviva@RouterA# delete traceoptions

When debugging RIP, you can set one or more of the following trace flags to capture RIP information:

[edit protocols rip traceoptions] aviva@RouterA# set flag ? Possible completions: all Trace everything auth Trace RIP authentication error Trace RIP errors expiration Trace RIP route expiration processing general Trace general events holddown Trace RIP hold-down processing normal Trace normal events packets Trace all RIP packets policy Trace policy processing request Trace RIP information packets route Trace routing information state Trace state transitions task Trace routing protocol task processing timer Trace routing protocol timer processing trigger Trace RIP triggered updates update Trace RIP update packets

 

See Also

Recipe 5.10

Категории