Junos BGP Establishment Troubleshooting: Commands - 夜莺博客

Junos BGP Establishment Troubleshooting: Commands

A BGP session that refuses to come up leaves the network silently broken, and the Junos CLI gives you every tool needed to find out why - if you know where to look. This article, based on the Network Curiosity Junos BGP troubleshooting series, walks through the main troubleshooting tools (show bgp summary, show bgp neighbor, log files, traceoptions, and monitor traffic interface) and the common scenarios that prevent BGP from establishing, including filtered BGP traffic, shutdown peers, prefix limits and session state analysis.

Main BGP Troubleshooting Tools on Junos

  • Show commands - show bgp summary and show bgp neighbor give an overview of configured sessions and their current state.
  • Log files - such as the messages log file, capture BGP events around the failure.
  • Traceoptions - specific debug configuration to trace BGP events at protocol level.
  • Monitor traffic interface - acts like a packet capture, showing traffic destined to the router on a given interface to verify TCP 179 connectivity.

Reading the Session State

A session stuck in the Connect state - with the BGP neighbor output showing the TryConnect flag - indicates the router is attempting to establish the TCP connection but the peer is not responding. Check whether the peer is reachable, whether TCP port 179 is filtered between the devices, and whether the local address used for peering is correct.

Common Causes of BGP Establishment Failure

BGP Traffic Being Filtered

Firewall or ACL rules in the path can silently drop BGP traffic. This is less likely with eBGP sessions, which typically run over a direct interface, but more likely with iBGP peering to loopback addresses where intermediate devices sit in the path. Verify with monitor traffic interface that TCP packets to port 179 arrive at the router.

BGP Peer Is Shutdown

Check show bgp summary for the peer state: a peer showing Active for a long time while the neighbor's session never moves to Established often means the remote side has the session administratively disabled or is unreachable.

Prefix Limits and Route Flooding

A router sending too many routes may see the BGP session reset or fail to establish, depending on how the prefix limit is configured on the receiving side. Review the configured prefix limits and the received route counts on both peers.

Step-by-Step Diagnosis Flow

  1. Run show bgp summary and note the session state (Idle, Connect, Active, OpenConfirm, Established).
  2. Run show bgp neighbor for the failing peer and check flags and last error codes.
  3. Check the messages log and BGP traceoptions output for the last events.
  4. Use monitor traffic interface to confirm whether TCP SYN packets reach the router and whether replies come back.
  5. Verify routing to the peer address and the local-address configured for the BGP group.

Related Reading

原文链接:https://www.networkcuriosity.com/junos-bgp-establishment-troubleshooting