Support Support Downloads Knowledge Base Case Manager My Juniper Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

[MX] BGP adjacency troubleshooting using traceoptions

1

0

Article ID: KB36461 KB Last Updated: 16 Feb 2021Version: 1.0
Summary:

This article demonstrates how to troubleshoot an EBGP neighbor adjacency using traceoptions.

The focus is on MX6, which is part of Local AS 64544 but we would like to establish an EBGP adjacency with MX4. MX4 is not under our administrative control, therefore the AS number to which it belongs is unknown.

Symptoms:

MX6 initial configuration.

jcluser@vMX6> show configuration protocols bgp | display set 
set protocols bgp group IBGP type internal
set protocols bgp group IBGP local-address 10.100.100.6
set protocols bgp group IBGP neighbor 10.100.100.5

jcluser@vMX6> show configuration interfaces | display set 
set interfaces ge-0/0/3 unit 0 family inet address 10.100.46.2/24
set interfaces ge-0/0/4 unit 0 family inet address 10.100.56.2/24
set interfaces fxp0 unit 0 family inet address 100.123.1.5/16
set interfaces lo0 unit 0 family inet address 10.100.100.6/32

jcluser@vMX6> show configuration interfaces                  
ge-0/0/3 {
    unit 0 {
        family inet {
            address 10.100.46.2/24;
        }
    }
}
ge-0/0/4 {
    unit 0 {
        family inet {
            address 10.100.56.2/24;
        }
    }
}
lo0 {
    unit 0 {
        family inet {
            address 10.100.100.6/32;
        }
    }
}

Verify if layer 3 is connected with MX4:

[edit]
jcluser@vMX6# run ping 10.100.46.1 
PING 10.100.46.1 (10.100.46.1): 56 data bytes
64 bytes from 10.100.46.1: icmp_seq=0 ttl=64 time=1.438 ms
64 bytes from 10.100.46.1: icmp_seq=1 ttl=64 time=1.597 ms
^C
--- 10.100.46.1 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max/stddev = 1.438/1.518/1.597/0.079 ms

It appears layer 3 connectivity to MX4 is established, which means that MX4 is able to reach MX6. Hence, it is also able to send BGP open messages to MX6 which can be monitored using traceoptions.

Cause:

The goal is to determine from MX6 if MX4's autonomous system number can be retrieved and configure MX6 as EBGP neighbor with a fake peer-as number.

set protocols bgp group to-MX4 type external
set protocols bgp group to-MX4 peer-as 1
set protocols bgp group to-MX4 neighbor 10.100.46.1
set protocols bgp traceoptions file bgp.JTAC 
set protocols bgp traceoptions flag open     

[edit]
jcluser@vMX6# show|compare 
[edit protocols bgp]
     group IBGP { ... }
+    group to-MX4 {
+        type external;
+        peer-as 1;
+        neighbor 10.100.46.1;
+    }
[edit protocols bgp]
+    traceoptions {
+        file bgp.JTAC;
+        flag open;
+    }

[edit]
jcluser@vMX6# 

[edit]
jcluser@vMX6# commit 
commit complete

Check BGP adjacency with MX4

[edit]
jcluser@vMX6# run show bgp summary 
Threading mode: BGP I/O
Groups: 2 Peers: 2 Down peers: 1
Table          Tot Paths  Act Paths Suppressed    History Damp State    Pending
inet.0               
                       0          0          0          0          0          0
Peer                     AS      InPkt     OutPkt    OutQ   Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped...
10.100.46.1               1          0          0       0       0                                        2 Active
10.100.100.5          64544        673        677       0       0          5:04:54           Establ
  inet.0: 0/0/0/0

[edit]
jcluser@vMX6# 

As expected, neighborship with MX4 is not established.

Solution:

Enable BGP traceoptions to see if MX4 AS number can be retrieved.

run monitor start bgp
run show log bgp.JTAC | match open

jcluser@vMX6# run show log bgp.JTAC | last 10 | match open   
Jan 28 02:58:53.778506 bgp_process_open:4240: NOTIFICATION sent to 10.100.46.1 (External AS 1): code 2 (Open Message Error) subcode 2 (b
ad peer AS number), Reason: peer 10.100.46.1 (External AS 1) claims 64533, 1 configured
Jan 28 02:59:25.783574 BGP SEND message type 1 (Open) length 63
Jan 28 02:59:25.786035 BGP RECV message type 1 (Open) length 63
Jan 28 02:59:25.786098 bgp_process_open:4240: NOTIFICATION sent to 10.100.46.1 (External AS 1): code 2 (Open Message Error) subcode 2 (b
ad peer AS number), Reason: peer 10.100.46.1 (External AS 1) claims 64533, 1 configured
Jan 28 02:59:57.792010 BGP SEND message type 1 (Open) length 63
Jan 28 02:59:57.796519 BGP RECV message type 1 (Open) length 63
Jan 28 02:59:57.796582 bgp_process_open:4240: NOTIFICATION sent to 10.100.46.1 (External AS 1): code 2 (Open Message Error) subcode 2 (b
ad peer AS number), Reason: peer 10.100.46.1 (External AS 1) claims 64533, 1 configured
                                        
[edit]
jcluser@vMX6# 

Determined from the traceoptions output, the MX4 AS number is "64533".

Reconfigure the peer-as statement
delete protocols bgp group to-MX4
set protocols bgp group to-AS64533 type external
set protocols bgp group to-AS64533 peer-as 64533
set protocols bgp group to-AS64533 neighbor 10.100.46.1

[edit]
jcluser@vMX6# show|compare 
[edit protocols bgp]
     group IBGP { ... }
+    group to-AS64533 {
+        type external;
+        peer-as 64533;
+        neighbor 10.100.46.1;
+    }
-    group to-MX4 {
-        type external;
-        peer-as 1;
-        neighbor 10.100.46.1;
-    }

[edit]
jcluser@vMX6# 

[edit]
jcluser@vMX6# commit 
commit complete

[edit]
jcluser@vMX6# 

[edit]
jcluser@vMX6# show protocols bgp 
group IBGP {
    type internal;
    local-address 10.100.100.6;
    neighbor 10.100.100.5;
}
group to-AS64533 {
    type external;
    peer-as 64533;
    neighbor 10.100.46.1;
}
traceoptions {
    file bgp.JTAC;
    flag open;
}

[edit]
jcluser@vMX6# 

Check the BGP peering with MX4 again

[edit]
jcluser@vMX6# run show bgp summary 
Threading mode: BGP I/O
Groups: 2 Peers: 2 Down peers: 0
Table          Tot Paths  Act Paths Suppressed    History Damp State    Pending
inet.0               
                       0          0          0          0          0          0
Peer                     AS      InPkt     OutPkt    OutQ   Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped...
10.100.46.1           64533          4          4       0       0        1:03                      Establ
  inet.0: 0/0/0/0
10.100.100.5          64544        691        696       0       0     5:12:52               Establ
  inet.0: 0/0/0/0

[edit]
jcluser@vMX6# run show bgp neighbor 10.100.46.1 
Peer: 10.100.46.1+179 AS 64533 Local: 10.100.46.2+59411 AS 64544
  Group: to-AS64533            Routing-Instance: master
  Forwarding routing-instance: master  
  Type: External    State: Established    Flags: <Sync>
  Last State: OpenConfirm   Last Event: RecvKeepAlive
  Last Error: None
  Options: <Preference PeerAS Refresh>
  Options: <GracefulShutdownRcv>
  Holdtime: 90 Preference: 170
  Graceful Shutdown Receiver local-preference: 0
  Number of flaps: 0
  Peer ID: 10.100.100.4    Local ID: 10.100.100.6      Active Holdtime: 90
  Keepalive Interval: 30         Group index: 2    Peer index: 0    SNMP index: 2     
  I/O Session Thread: bgpio-0 State: Enabled
  BFD: disabled, down
  Local Interface: ge-0/0/3.0                       
  NLRI for restart configured on peer: inet-unicast
  NLRI advertised by peer: inet-unicast
  NLRI for this session: inet-unicast
  Peer supports Refresh capability (2)
  Stale routes from peer are kept for: 300
  Peer does not support Restarter functionality
  Restart flag received from the peer: Notification
  NLRI that restart is negotiated for: inet-unicast
  NLRI of received end-of-rib markers: inet-unicast
  NLRI of all end-of-rib markers sent: inet-unicast
  Peer does not support LLGR Restarter functionality
  Peer supports 4 byte AS extension (peer-as 64533)
  Peer does not support Addpath
  Table inet.0 Bit: 20000
    RIB State: BGP restart is complete
    Send state: in sync
    Active prefixes:              0
    Received prefixes:            0
    Accepted prefixes:            0
    Suppressed due to damping:    0
    Advertised prefixes:          0
  Last traffic (seconds): Received 13   Sent 16   Checked 97  
  Input messages:  Total 5Updates 1 Refreshes 0 Octets 99
  Output messages: Total 5Updates 0 Refreshes 0 Octets 99
  Output Queue[1]: 0            (inet.0, inet-unicast)
  Trace options: open
  Trace file: /var/log/bgp.JTAC size 131072 files 10

[edit]
jcluser@vMX6# 

Related Links

Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search