Looking to see where my MX router is failing to peer with a neighbor. I can do a show bgp neighbor, but that only shows me the current state. Is there a way to see all the steps it took during the peering process, and where it failed?

  • Did any answer help you? if so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer.
    – Ron Maupin
    Aug 11, 2017 at 14:48

2 Answers 2


I think you're looking for traceoptions for BGP. From the documentation on Juniper's site:

Configuring Traceoptions

[edit protocols bgp traceoptions]
user@router# set file bgp.log size 10m files 10 world-readable

[edit protocols bgp traceoptions]
user@router# set flag ?
Possible completions:
4byte-as             Trace 4 byte AS events
add-path             Trace add-path events
all                  Trace everything
bfd                  Trace BFD events
damping              Trace BGP damping information
general              Trace general events
graceful-restart     Trace Graceful Restart events
keepalive            Trace BGP keepalive packets
normal               Trace normal events
nsr-synchronization  Trace NSR synchronization events
open                 Trace BGP open packets
packets              Trace all BGP protocol packets
policy               Trace policy processing
refresh              Trace BGP refresh packets
route                Trace routing information
state                Trace state transitions
task                 Trace routing protocol task processing
timer                Trace routing protocol timer processing
update               Trace BGP update packets

[edit protocols bgp traceoptions]
user@router# commit and-quit

Viewing Your Traceoptions

user@router> show log bgp.log

Note that the above will turn on traceoptions for all BGP peers which could be quite chatty. You have the ability to only turn on traceoptions for a specific group or even a specific neighbor by navigating to that hierarchy and running the same commands.


You need to communicate with your provider, on the way to see if it's presenting some troubles on his side, checking from the physical link, eg, fiber troubles, some equipment, or something else.

On the way to debug your BGP session, you need to change what do you want to see, like is explained here:


your@host# set traceoptions file bgp-log
your@host# set traceoptions file size 10k
your@host# set traceoptions file files 2
your@host# set traceoptions flag update detail

And sure, made a "commit"

your@host# commit

Finally, you can see you debugging here:

your@host> file show /var/logical-systems/A/log/bgp-log

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.