Support Support Downloads Knowledge Base Juniper Support Portal 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

[Contrail] How to determine MPLS label used in a MPLSoUDP encapsulation



Article ID: KB31035 KB Last Updated: 19 Nov 2021Version: 2.0

This article explains how to determine MPLS label used in MPLS encapsulation between compute nodes or compute node and DC gateway.


During data path encapsulation troubleshooting, you may be required to confirm that the compute node made the correct MPLS encapsulation, and the MPLS data frame took the correct path.

  1. In order to find the MPLS label, we need to determine the destination tap interface for a VM. See KB30668 - [Contrail] How to determine the tap interface associated with the instance of a VM’s interface.
  2. Then find VRF to which this tap interface is associated on the compute node.
  3. Get the MPLS label by listing the routes in that VRF.
Example Scenario

There are two compute nodes, rencpt1 (IP: and rencpt2 (IP: We want to determine the MPLS label used in MPLSoUDP encapsulation from the rencpt1 side, when the VM1 hosted on rencpt1 generates traffic to the VM2 (IP: hosted on rencpt2.

To determine VRF index on the compute node rencpt2, use the command vif –list to list all virtual interfaces. To filter the output, use grep for the VM2 tap interface determined from the procedure in KB30668. The “-A 4” option in grep will show 4 lines after the match. 
root@rencpt2:~# vif --list | grep tap1d0fba01-4e -A 4
vif0/9 OS: tap1d0fba01-4e
Type:Virtual HWaddr:00:00:5e:00:01:00 IPaddr:0
Vrf:1 Flags:PL3L2D MTU:9160 Ref:6
RX packets:0 bytes:0 errors:0
TX packets:36 bytes:4306 errors:0

From the output, we have our TAP interface at interface index 9 and the VRF associated which is the number 1.

VRF index is consistent across all compute nodes, so we can use it to list VRF routes on compute node rencpt1 with the command rt –dump. Destination IP address in grep will filter the output.

root@rencpt1:~# rt --dump 1 | grep
Vrouter inet4 routing table 0/1/unicast
Flags: L=Label Valid, P=Proxy ARP, T=Trap ARP, F=Flood ARP

Destination PPL Flags Label Nexthop Stitched MAC(Index)  32  LP    31    22      2:1d:f:ba:1:4e(173152)
From the output, we can see that the MPLS label 31 is going to be used when a packet to VM2 (IP: is sent from rencpt1.

In addition to the MPLS label, we can get tunnel endpoints information by using the command nh –get.
root@rencpt1:~# nh --get 22
Id:22 Type:Tunnel Fmly: AF_INET Flags:Valid, MPLSoUDP, Rid:0 Ref_cnt:23 Vrf:0
Oif:0 Len:14 Flags Valid, MPLSoUDP, Data:6c c2 17 2a f1 68 6c c2 17 2a ee e8 08 00
Vrf:0 Sip: Dip:

MPLSoUDP encapsulation will take place between two compute nodes, with IP addresses and (rencpt1 and rencpt2).
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