Enabling Traceoptions in Juniper Router and monitoring the trace.

AID: 6149
  • Status: Published

1660 points

  • Byperfectgame
  • TypeTips/Tricks
  • Posted on2011-06-11 at 08:57:41
Hello ,

This is a short article on how would you go about enabling traceoptions on a Juniper router . Traceoptions are similar to Cisco debug commands but these traceoptions are implemented in Juniper networks router .

The following demonstrates a traceoptions configuration on a Juniper router which has ospf enabled on it and we will be tracing for ospf .

First this is to go into a mode to make this happen Below is the command from the start of the router .

login: lab
Password:

--- JUNOS 9.6R2.11 built 2009-10-06 20:56:00 UTC
lab> configure 
Entering configuration mode
Users currently editing the configuration:
  lab terminal d0 (pid 1359) on since 2011-06-11 00:48:19 IST, idle 12:27:15
      [edit]
  lab terminal p2 (pid 1510) on since 2011-06-11 14:40:34 IST, idle 05:10:52
      [edit]

[edit]
lab# 
                                    
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:

Select allOpen in new window



Now that you have done this we will go ahead and configure the protocol

[edit]
lab# set protocols ospf area 0 interface all 

[edit]
lab# commit 
commit complete

[edit]
lab# 
                                    
1:
2:
3:
4:
5:
6:
7:
8:
9:

Select allOpen in new window



how would you enable traceoptions ? well traceoptions are protocol specific and not device specific . In the sense you would have traceoptions for ospf , rip , and protocols not for the entire router itself

let us enable traceoptions for ospf

[edit]
lab# edit protocols ospf 

[edit protocols ospf]
lab# set traceoptions file testtrace 

[edit protocols ospf]
lab# set traceoptions flag all 

[edit protocols ospf]
lab# commit 
commit complete

[edit protocols ospf]
lab# 
                                    
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:

Select allOpen in new window



Now , how would you monitor it ... simple

[edit]
lab# exit 
Exiting configuration mode

lab> monitor start testtrace 

lab> 
*** testtrace ***
Jun 11 21:23:51.316731 task_timer_dispatch: calling OSPF_internal timer, late by 0.000
Jun 11 21:23:51.316798 task_timer_dispatch: returned from OSPF_internal timer, rescheduled in 0
Jun 11 21:23:51.875790 task_process_events: recv ready for OSPF I/O./var/run/ppmd_control
Jun 11 21:23:51.875864 task_process_events: recv ready for OSPF I/O./var/run/ppmd_control
Jun 11 21:23:51.875898 task_timer_uset: timer OSPF I/O./var/run/ppmd_control_PPM Hold <Touched> set to offset 2:00 at 21:25:51
Jun 11 21:23:51.875912 OSPF periodic xmit from 22.1.1.2 to 224.0.0.5 (IFL 78 area 0.0.0.0)
Jun 11 21:23:53.415544 task_process_events: recv ready for OSPF I/O./var/run/ppmd_control
Jun 11 21:23:53.415634 task_process_events: recv ready for OSPF I/O./var/run/ppmd_control
Jun 11 21:23:53.415663 task_timer_uset: timer OSPF I/O./var/run/ppmd_control_PPM Hold <Touched> set to offset 2:00 at 21:25:53
Jun 11 21:23:53.415677 OSPF periodic xmit from 10.141.227.1 to 224.0.0.5 (IFL 3 area 0.0.0.0)

monitor stop 

lab> 
                                    
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:

Select allOpen in new window



one thing to keep in mind though , you can type monitor stop at anytime to stop the trace.

You can also see the log file which gets generated along with this

lab> file list /var/log | match testtrace 
testtrace

lab> 
                                    
1:
2:
3:
4:

Select allOpen in new window



The same thing is with protocol rip or any other protocol . So what are all the options available under ospf traceoptions

lab# set traceoptions flag ?
Possible completions:
  all                  Trace everything
  database-description  Trace database description packets
  error                Trace errored packets
  event                Trace OSPF state machine events
  flooding             Trace LSA flooding
  general              Trace general events
  graceful-restart     Trace graceful restart
  hello                Trace hello packets
  ldp-synchronization  Trace synchronization between OSPF and LDP
  lsa-ack              Trace LSA acknowledgment packets
  lsa-analysis         Trace LSA analysis
  lsa-request          Trace LSA request packets
  lsa-update           Trace LSA update packets
  normal               Trace normal events
  nsr-synchronization  Trace NSR synchronization events
  on-demand            Trace demand circuit extensions
  packet-dump          Dump the contents of selected packet types
  packets              Trace all OSPF packets
  policy               Trace policy processing
  route                Trace routing information
  spf                  Trace SPF calculations
  state                Trace state transitions
  task                 Trace routing protocol task processing
  timer                Trace routing protocol timer processing
[edit protocols ospf]
lab# set traceoptions flag    
                                    
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:

Select allOpen in new window



if you can see , you can do a trace for each and every type of state ospf has , my suggestion if you are learning ospf and if you are in a lab environment then we can go with traceoptions which has 'state' tag enabled so that we can see the state information of the protocol , 'timers' which is self explanatory protocol timers

if we wanted to go for the protocol state only , then we would do the following
set protocols ospf traceoptions flag state
                                    
1:

Select allOpen in new window


Hope this helps and please feel free to post any suggestions or comments that might make this a better Article, or, maybe a follow up Article.
Asked On
2011-06-11 at 08:57:41ID6149
Tags

Traceoptions

,

Juniper

,

ospf

,

logs

,

log

,

messages

,

monitort

,

start

,

traffic

Topic

Network Routers

Views
1090

Comments

Add your Comment

Please Sign up or Log in to comment on this article.

Join Experts Exchange Today

Gain Access to all our Tech Resources

Get personalized answers

Ask unlimited questions

Access Proven Solutions

Search 3.2 million solutions

Read In-Depth How-To Guides

1000+ articles, demos, & tips

Watch Step by Step Tutorials

Learn direct from top tech pros

And Much More!

Your complete tech resource

See Plans and Pricing

30-day free trial. Register in 60 seconds.

Loading Advertisement...

Top Routers Experts

  1. nazsky

    155,823

    Guru

    0 points yesterday

    Profile
    Rank: Wizard
  2. donjohnston

    86,006

    Master

    1,336 points yesterday

    Profile
    Rank: Genius
  3. mat1458

    60,486

    Master

    0 points yesterday

    Profile
    Rank: Master
  4. Soulja

    60,398

    Master

    0 points yesterday

    Profile
    Rank: Genius
  5. erniebeek

    59,140

    Master

    0 points yesterday

    Profile
    Rank: Genius
  6. Darr247

    57,778

    Master

    0 points yesterday

    Profile
    Rank: Genius
  7. giltjr

    55,813

    Master

    0 points yesterday

    Profile
    Rank: Genius
  8. fgasimzade

    45,402

    0 points yesterday

    Profile
    Rank: Wizard
  9. TimotiSt

    35,398

    0 points yesterday

    Profile
    Rank: Master
  10. craigbeck

    35,011

    0 points yesterday

    Profile
    Rank: Sage
  11. lrmoore

    34,850

    0 points yesterday

    Profile
    Rank: Savant
  12. eeRoot

    34,782

    0 points yesterday

    Profile
    Rank: Wizard
  13. Syed_M_Usman

    29,786

    0 points yesterday

    Profile
    Rank: Wizard
  14. mattvmotas

    28,979

    0 points yesterday

    Profile
    Rank: Sage
  15. fmarshall

    27,995

    10 points yesterday

    Profile
    Rank: Wizard
  16. thinkpads_user

    24,468

    0 points yesterday

    Profile
    Rank: Genius
  17. harbor235

    24,400

    0 points yesterday

    Profile
    Rank: Genius
  18. Kvistofta

    24,218

    0 points yesterday

    Profile
    Rank: Sage
  19. ArneLovius

    23,976

    0 points yesterday

    Profile
    Rank: Wizard
  20. lruiz52

    22,801

    300 points yesterday

    Profile
    Rank: Guru
  21. jodylemoine

    21,900

    0 points yesterday

    Profile
    Rank: Sage
  22. rigan123

    21,548

    0 points yesterday

    Profile
    Rank: Guru
  23. ikalmar

    21,466

    0 points yesterday

    Profile
    Rank: Genius
  24. The_Warlock

    20,568

    0 points yesterday

    Profile
    Rank: Wizard
  25. getzjd

    20,368

    800 points yesterday

    Profile
    Rank: Wizard

Hall Of Fame