Blog Viewer

Troubleshooting: Debugging BGP peering and route exchange in Contrail

By Erdem posted 08-13-2015 06:55




Use the troubleshooting steps and guidelines in this topic when you have errors with Contrail BGP peering and route exchange.


Example Cluster

Examples in this document refer to a virtual cluster that is set up as follows:

Config Nodes  : [‘nodea22’, ‘nodea20’]

Control Nodes : [‘nodea22’, ‘nodea20’]

Compute Nodes : [‘nodea22’, ‘nodea20’]

Collector     : [‘nodea22’]

WebUI         : nodea22

Openstack     : nodea22


Verifying the BGP Routers Setup


Use this procedure to launch various introspects to verify the setup of the BGP routers in your system.


1. Verify the BGP routers.

All of the configured control nodes and external BGP routers are visible from the following location, shown using the sample node setup:

http: //                 

Note: Replace nodea22.example.comwith the correct location for your system to see the setup in your system.​

Sample Output, BGP Routers:



2. Verify the BGP peering.


The following statement is entered to check the bgp_router_refs object on the API server to validate the peering on the sample setup.


http: //    


Sample Output, BGP Router References:​



3. Verify the command line arguments that are passed to the control-node.


On the control-node, use ps aux | grep control-node to see the arguments that are passed to the control-node.



/usr/bin/control-node --map-user --map-password --hostname nodea22 --host-ip --bgp-port 179 --discovery-server


The hostname is the bgp-router name. Ensure that the bgp-router config can be found for the hostname, using the procedure in Step 1.


4. Validate the BGP neighbor config and the BGP peering config object.


http: //      


Sample Output, BGP Neighbor Config:



http: //


Sample Output, BGP Peering Config:



5. Check the BGP neighbor states on the sample setup.


http: //


Sample Output, BGP Neighbor States:



If the peer is not in an established state, check the last_error and the flap_count.  Debug the BGP state machine by using information displayed in the output, such as last_state and last_event.


Note: The image displayed is truncated to fit this page. On the console screen you can scroll horizontally to see more columns and data.


Verifying the Route Exchange


The following two virtual networks are used in the sample debugging session for route exchange.

            vn1 ->

     vn2 ->



Example Procedure for Verifying Route Exchange

  1. Validate the presence of the routing instance for each virtual network in the sample system.

http :// 


Note: Throughout this example, replace with the correct location for the control node on your system.


Sample Output, Show Routing Instance:



In the sample output, you can see the import_target and the export_target configured on the routing instance.


Also shown are the xmpp peers (vroutes) registered to the table.


The user can click on the inet table of the required routing instance to display the routes that belong to the instance.


Use the information in Step 2 to validate a route.


  1. Validate a route in a given routing instance in the sample setup:

http ://nodea22.example.com8083/Snh_ShowRouteReq?x=default-domain:demo:vn1:vn1.inet.0


In the following sample output (truncated), the user can validate the BGP paths for the protocol and for the source of the route to verify which XMPP agent or vRouter has pushed the route. If the path source is BGP, the route is imported to the VRF table from a BGP peer, either another control-node or an external bgp router such as an MX Series router.  BGP paths are displayed in the order of path selection.


Sample Output, Validate Route:



  1. Validate the l3vpn table.

http: //


Sample Output, Validate L3vpn Table:




The following sample output has been scrolled horizontally to display the BGP path attributes of each route.  


The extended community (communities column), determines the VRF table to which this VPN route is imported. The origin_vn shows  the virtual network where this route was created, information useful for applying ACL policies.


The label (MPLS) and tunnel encap columns can be used for debugging data path issues.


Sample Output, Validate L3vpn Table, Scrolled:




Debugging Route Exchange with Policies


This section uses the sample output and the sample vn1 and vn2 to demonstrate methods of debugging route exchange with policies.


    1. Create a network policy to allow vn1 and vn2 traffic and associate the policy to the virtual networks.10.gif

    2. Validate that the routing instances have the correct import_target configuration.

      http: //

      Sample Output, Validate Import Target:


    3. Validate that the routes are imported from VRF.

Use the BGP path attribute to check the replication status of the path. The route from the destination VRF should be replicated and validate the origin-vn.

Sample Output, Route Import:


Debugging Peering with an MX Series Router

This section sets up an example BGP MX Series peer and provides some troubleshooting scenarios.


    1. Set the Global AS number of the control-node for an MX Series BGP peer, using the Contrail WebUI (eBGP).
    2. Configure the eBGP peer for the MX Series router. Use the Contrail Web UI or Python provisioning.

      Configuring the MX Series BGP peer at WebUI:

      Configuring the MX Series BGP peer with the Python provision utility:

      python ./ --router_name mx --router_ip --router_asn
      12345 --api_server_ip --api_server_port 8082 --oper add --admin_user admin --admin_password  abc123 --admin_tenant_name  admin

    3. Configure a control-node peer on the MX Series router, using Junos CLI:

set protocols bgp group contrail-control-nodes type external

set protocols bgp group contrail-control-nodes local-address

set protocols bgp group contrail-control-nodes keep all

set protocols bgp group contrail-control-nodes peer-as 54321

set protocols bgp group contrail-control-nodes local-as 12345

set protocols bgp group contrail-control-nodes neighbor

Debug a BGP Peer Down Error with Incorrect Family


  1. Check the BGP peer UVE.

http: //

  1. Search for the MX Series BGP peer by name in the list.

In the sample output, families is the family advertised by the peer and configured_families is what is provisioned.​ In the sample output, the families configured on the peer has a mismatch, thus the peer doesn’t move to an established state. You can verify it in the peer UVE.


  1. Fix the mismatch in the sample by updating the configuration on the MX Series router, using Junos CLI:

set protocols bgp group contrail-control-nodes family inet-vpn unicast

  1. After committing the CLI configuration, the peer comes up. Verify this with UVE. 

http: //


You can verify the peer status on the MX Series router, using Junos CLI:

run show bgp neighbor


Peer: AS 54321 Local: AS 12345

  Type: External    State: Established    Flags: <ImportEval Sync>

  Last State: OpenConfirm   Last Event: RecvKeepAlive

  Last Error: None

  Options: <Preference LocalAddress KeepAll AddressFamily PeerAS LocalAS Rib-group Refresh>

  Address families configured: inet-vpn-unicast

  Local Address: Holdtime: 90 Preference: 170 Local AS: 12345 Local System AS: 64512

  Number of flaps: 0

  Error: 'Cease' Sent: 0 Recv: 2

  Peer ID:   Local ID:    Active Holdtime: 90

  Keepalive Interval: 30         Group index: 1    Peer index: 0

  BFD: disabled, down

  Local Interface: ge-1/0/2.0

  NLRI for restart configured on peer: inet-vpn-unicast

  NLRI advertised by peer: inet-vpn-unicast

  NLRI for this session: inet-vpn-unicast

  Peer does not support Refresh capability

  Stale routes from peer are kept for: 300

  Peer does not support Restarter functionality

  Peer does not support Receiver functionality

  Peer does not support 4 byte AS extension

  Peer does not support Addpath


Configuring MX Peering (iBGP)


  1. Edit the Global ASN.



  1. Configure the MX Series IBGP peer, using Contrail WebUI or Python provisioning.

Configuring the MX Series BGP peer at WebUI:

Configuring the MX Series BGP peer with the Python provision utility:

python ./ --router_name
mx--router_ip --router_asn 64512 --api_server_ip --api_server_port 8082 --oper add --admin_user admin --admin_password abc123 --admin_tenant_name  admin


  1. Verify the peer from UVE.

http ://


  1. You can verify the same information at the http introspect page of the control-node (8443).

http: //nodea20.example:8083/Snh_BgpNeighborReq?ip_address=&domain=


Checking Route Exchange with an MX Series Peer

  1. Check the route table in the bgp.l3vpn.0 table.

http: //nodea20.example:8083/Snh_ShowRouteReq?x=bgp.l3vpn.0

2. Configure a public virtual network.

  1. Verify the routes in the public.inet.0 table.
http: //
  1. Launch a virtual machine ( in the sample case) in the public network and verify the route in the public.inet.0 table.
    http: //
  2. Verify the route in the bgp.l3vpn.0 table.

    http: //


    Check the Route in the MX Series Router

    Use Junos CLI show commands from the router to check the route.

    run show route table public.inet.0

    public.inet.0: 5 destinations, 6 routes (5 active, 0 holddown, 0 hidden)

    + = Active Route, - = Last Active, * = Both

           *[Static/5] 15w6d 08:50:34

                        > to via ge-1/0/1.0    *[Direct/0] 15w6d 08:50:35

                        > via ge-1/0/1.0    *[Local/0] 15w6d 08:50:51

                          Local via ge-1/0/1.0  *[BGP/170] 01:13:34, localpref 100, from

                          AS path: ?, validation-state: unverified

                        > via gr-1/0/0.32771, Push 16

                        [BGP/170] 01:13:34, localpref 100, from

                          AS path: ?, validation-state: unverified

                        > via gr-1/0/0.32771, Push 16      *[BGP/170] 00:03:20, localpref 100, from

                          AS path: ?, validation-state: unverified

                        > via gr-1/0/0.32769, Push 16


    run show route table bgp.l3vpn.0 receive-protocol bgp detail

    bgp.l3vpn.0: 92 destinations, 130 routes (92 active, 0 holddown, 0 hidden)

    * (1 entry, 0 announced)

         Import Accepted

         Route Distinguisher:

         VPN Label: 16


         Localpref: 100

         AS path: ?

         Communities: target:64512:1 target:64512:10003 unknown iana 30c unknown iana 30c unknown type 8004 value fc00:1 unknown type 8071 value fc00:4