184
Juniper Extension Toolkit Developer Guide Published 2019-10-03

Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

  • Upload
    others

  • View
    11

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Juniper Extension Toolkit Developer Guide

Published

2019-10-03

Page 2: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Juniper Networks, Inc.1133 Innovation WaySunnyvale, California 94089USA408-745-2000www.juniper.net

Juniper Networks, the Juniper Networks logo, Juniper, and Junos are registered trademarks of Juniper Networks, Inc. inthe United States and other countries. All other trademarks, service marks, registered marks, or registered service marksare the property of their respective owners.

Juniper Networks assumes no responsibility for any inaccuracies in this document. Juniper Networks reserves the rightto change, modify, transfer, or otherwise revise this publication without notice.

Juniper Extension Toolkit Developer GuideCopyright © 2019 Juniper Networks, Inc. All rights reserved.

The information in this document is current as of the date on the title page.

YEAR 2000 NOTICE

Juniper Networks hardware and software products are Year 2000 compliant. Junos OS has no known time-relatedlimitations through the year 2038. However, the NTP application is known to have some difficulty in the year 2036.

END USER LICENSE AGREEMENT

The Juniper Networks product that is the subject of this technical documentation consists of (or is intended for use with)Juniper Networks software. Use of such software is subject to the terms and conditions of the EndUser License Agreement(“EULA”) posted at https://support.juniper.net/support/eula/. By downloading, installing or using such software, youagree to the terms and conditions of that EULA.

ii

Page 3: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Table of Contents

About the Documentation | vii

Documentation and Release Notes | vii

Documentation Conventions | vii

Documentation Feedback | x

Requesting Technical Support | x

Self-Help Online Tools and Resources | xi

Creating a Service Request with JTAC | xi

Introduction1Overview | 15

Benefits of JET | 15

Architecture2JET Architecture | 19

Off-Device Application Development Workflow | 21

On-Device Application Development Workflow | 21

Quick Start3Getting Started with JET | 25

Overview | 25

Configure JET Interaction with Junos OS | 25

Compile IDL Files | 27

Sample Python Application | 28

Application Development4Overview | 35

Prerequisites and Setup | 35

Download the Packages You Need | 35

Initialize Your Virtual Machine | 36

Set Up Your Virtual Machine Environment | 38

iii

Page 4: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Create a Certificate Request | 39

On-Device Applications | 40

Overview | 41

Signed C Package | 41

Signed Python Package Without C Dependencies | 44

Signed Python Package with C Dependencies | 48

Unsigned Python Program | 52

Troubleshooting5Debugging JET Applications | 57

Configuration Statements6allow-clients | 61

application (Extensions) | 62

arguments | 63

checksum | 64

commit | 65

description | 66

daemonize | 67

exit | 68

extensions | 69

extension-service (System Extensions) | 72

extension-service (System Services gRPC) | 74

extension-service (System Services) | 75

file (JET) | 77

grpc | 79

iv

Page 5: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

interface-notification (programmable-rpd) | 80

JSON File Format for JET Application Packaging | 80

Main Section Attributes | 81

Mandatory Attributes | 81

Optional Attributes | 83

Source Attributes | 84

Dependent Libraries | 85

Dependent Python Modules | 85

language (Scripts) | 87

license-type | 88

local | 89

max-connections | 90

max-datasize | 91

notification | 93

providers | 94

purge-timeout (routing-options programmable-rpd) | 95

refresh (JET) | 97

refresh-from (JET) | 99

request-response | 101

routing-instance (JET Scripts) | 102

services (System Services) | 103

source (JET Scripts) | 109

ssl | 110

top | 112

traceoptions (Extensions) | 113

traceoptions (Services) | 115

v

Page 6: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

traceoptions (routing-options programmable-rpd) | 117

username | 119

Operational Commands7request extension-service (start | stop) | 123

show extension-service status | 124

show programmable-rpd clients | 127

show route | 128

show route detail | 157

API Reference8JET APIs | 183

Additional Resources9Additional Resources | 187

Downloads10Downloads | 191

vi

Page 7: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

About the Documentation

IN THIS SECTION

Documentation and Release Notes | vii

Documentation Conventions | vii

Documentation Feedback | x

Requesting Technical Support | x

Use this guide to develop, deploy, use, and debug a JET application that are developed on Junos OS andthird party applications. Also, to provide access to the control plane on the device and a managementinterface to run operational and configuration commands using JET APIs.

Documentation and Release Notes

To obtain the most current version of all Juniper Networks® technical documentation, see the productdocumentation page on the Juniper Networks website at https://www.juniper.net/documentation/.

If the information in the latest release notes differs from the information in the documentation, follow theproduct Release Notes.

Juniper Networks Books publishes books by Juniper Networks engineers and subject matter experts.These books go beyond the technical documentation to explore the nuances of network architecture,deployment, and administration. The current list can be viewed at https://www.juniper.net/books.

Documentation Conventions

Table 1 on page viii defines notice icons used in this guide.

vii

Page 8: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Table 1: Notice Icons

DescriptionMeaningIcon

Indicates important features or instructions.Informational note

Indicates a situation that might result in loss of data or hardwaredamage.

Caution

Alerts you to the risk of personal injury or death.Warning

Alerts you to the risk of personal injury from a laser.Laser warning

Indicates helpful information.Tip

Alerts you to a recommended use or implementation.Best practice

Table 2 on page viii defines the text and syntax conventions used in this guide.

Table 2: Text and Syntax Conventions

ExamplesDescriptionConvention

To enter configuration mode, typethe configure command:

user@host> configure

Represents text that you type.Bold text like this

user@host> show chassis alarms

No alarms currently active

Represents output that appears onthe terminal screen.

Fixed-width text like this

• A policy term is a named structurethat defines match conditions andactions.

• Junos OS CLI User Guide

• RFC 1997, BGP CommunitiesAttribute

• Introduces or emphasizes importantnew terms.

• Identifies guide names.

• Identifies RFC and Internet drafttitles.

Italic text like this

viii

Page 9: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Table 2: Text and Syntax Conventions (continued)

ExamplesDescriptionConvention

Configure the machine’s domainname:

[edit]root@# set system domain-name

domain-name

Represents variables (options forwhich you substitute a value) incommands or configurationstatements.

Italic text like this

• To configure a stub area, includethe stub statement at the [editprotocols ospf area area-id]hierarchy level.

• The console port is labeledCONSOLE.

Represents names of configurationstatements, commands, files, anddirectories; configuration hierarchylevels; or labels on routing platformcomponents.

Text like this

stub <default-metric metric>;Encloses optional keywords orvariables.

< > (angle brackets)

broadcast | multicast

(string1 | string2 | string3)

Indicates a choice between themutually exclusive keywords orvariables on either side of the symbol.The set of choices is often enclosedin parentheses for clarity.

| (pipe symbol)

rsvp { # Required for dynamic MPLSonly

Indicates a comment specified on thesame line as the configurationstatement to which it applies.

# (pound sign)

community name members [community-ids ]

Encloses a variable for which you cansubstitute one or more values.

[ ] (square brackets)

[edit]routing-options {static {route default {nexthop address;retain;

}}

}

Identifies a level in the configurationhierarchy.

Indention and braces ( { } )

Identifies a leaf statement at aconfiguration hierarchy level.

; (semicolon)

GUI Conventions

ix

Page 10: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Table 2: Text and Syntax Conventions (continued)

ExamplesDescriptionConvention

• In the Logical Interfaces box, selectAll Interfaces.

• To cancel the configuration, clickCancel.

Represents graphical user interface(GUI) items you click or select.

Bold text like this

In the configuration editor hierarchy,select Protocols>Ospf.

Separates levels in a hierarchy ofmenu selections.

> (bold right angle bracket)

Documentation Feedback

We encourage you to provide feedback so that we can improve our documentation. You can use eitherof the following methods:

• Online feedback system—Click TechLibrary Feedback, on the lower right of any page on the JuniperNetworks TechLibrary site, and do one of the following:

• Click the thumbs-up icon if the information on the page was helpful to you.

• Click the thumbs-down icon if the information on the page was not helpful to you or if you havesuggestions for improvement, and use the pop-up form to provide feedback.

• E-mail—Send your comments to [email protected]. Include the document or topic name,URL or page number, and software version (if applicable).

Requesting Technical Support

Technical product support is available through the Juniper Networks Technical Assistance Center (JTAC).If you are a customer with an active Juniper Care or Partner Support Services support contract, or arecovered under warranty, and need post-sales technical support, you can access our tools and resourcesonline or open a case with JTAC.

x

Page 11: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

• JTAC policies—For a complete understanding of our JTAC procedures and policies, review the JTACUserGuide located at https://www.juniper.net/us/en/local/pdf/resource-guides/7100059-en.pdf.

• Productwarranties—For productwarranty information, visit https://www.juniper.net/support/warranty/.

• JTAC hours of operation—The JTAC centers have resources available 24 hours a day, 7 days a week,365 days a year.

Self-Help Online Tools and Resources

For quick and easy problem resolution, Juniper Networks has designed an online self-service portal calledthe Customer Support Center (CSC) that provides you with the following features:

• Find CSC offerings: https://www.juniper.net/customers/support/

• Search for known bugs: https://prsearch.juniper.net/

• Find product documentation: https://www.juniper.net/documentation/

• Find solutions and answer questions using our Knowledge Base: https://kb.juniper.net/

• Download the latest versions of software and review release notes:https://www.juniper.net/customers/csc/software/

• Search technical bulletins for relevant hardware and software notifications:https://kb.juniper.net/InfoCenter/

• Join and participate in the Juniper Networks Community Forum:https://www.juniper.net/company/communities/

• Create a service request online: https://myjuniper.juniper.net

To verify service entitlement by product serial number, use our Serial Number Entitlement (SNE) Tool:https://entitlementsearch.juniper.net/entitlementsearch/

Creating a Service Request with JTAC

You can create a service request with JTAC on the Web or by telephone.

• Visit https://myjuniper.juniper.net.

• Call 1-888-314-JTAC (1-888-314-5822 toll-free in the USA, Canada, and Mexico).

For international or direct-dial options in countries without toll-free numbers, seehttps://support.juniper.net/support/requesting-support/.

xi

Page 12: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

1CHAPTER

Introduction

Overview | 15

Page 13: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48
Page 14: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Overview

Juniper Extension Toolkit (JET), an evolution of the Junos SDK, provides amodern, programmatic interfacefor developers of third-party applications on Junos devices. It focuses on providing a standards-basedinterface to the Juniper Networks’ Junos operating system (Junos OS) for customizing management andcontrol plane functionality.

JET also includes a virtual machine (VM) packaged as a vagrant file, libraries, and other tools to enabledevelopers to write on-device JET applications.

Benefits of JET

• Provides Service APIs to interact with any device running Junos OS.

• Uses gRPC for cross-language services (see https://www.grpc.io/) as a mechanism to enablerequest-response service. gRPC provides a mechanism to define programming language agnostic APIs.

• Provides an event notification method that enables the applications to respond to selected systemevents.

• Provides tools to develop applications that run on Junos devices.

15

Page 15: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

2CHAPTER

Architecture

JET Architecture | 19

Page 16: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48
Page 17: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

JET Architecture

IN THIS SECTION

Off-Device Application Development Workflow | 21

On-Device Application Development Workflow | 21

JET is a framework that enables developers to create applications that extend the functionality of JunosOS. For example, a JET application might extend the Junos CLI by adding a new operational command toshow application-specific states. Starting in Junos OS Release 16.2R1, JET supports gRPC framework forremote procedure calls (RPCs).

JET applications can run on devices running Junos OS or on another device in your operating environmentand connect over the network to a device running Junos OS.

Table 3 on page 19 describes the JET applications’ interaction with Junos OS through request-responseand notification services over standards based transport channels.

Table 3: JET Applications Interact with Junos OS Through Services

DescriptionService

JET services daemon (jsd), which runs on JunosOS, provides the request-responseservice. When jsd receives a request (by default on TCP port 32767), it creates anew session to service the JET application. The session remains alive as long asthe client and server are both up and communicating with each other. Over thelifetime of a session, jsd can execute any number of APIs. jsd can support amaximum of 8 active client sessions and execute APIs from these sessions inparallel.

NOTE: For secure communications with jsd, use RSA certificates, specificallyTLSv1.2 (minimum).

Request-response—Anapplication can issue a requestand wait for the response fromJunos OS.

19

Page 18: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Table 3: JET Applications Interact with Junos OS Through Services (continued)

DescriptionService

JET provides a publish-subscribe based messaging protocol and a notificationbroker. JET applications can register with the notification broker and inform thebroker about the topics of interest to receive messages. The broker is responsiblefor distributing messages to the interested clients based on the topic of themessage. Junos OS daemons publishing the events (such as eventd) connect tothe broker as a publisher and publish the events.

JET utilizes Message Queue Telemetry Transport (MQTT) protocol (seehttps://mqtt.org/) method to implement the notification service.

Notifications—An application canreceive asynchronousnotifications of events happeningon Junos OS.

Figure 1 on page 20 illustrates the request-response and notification services.

Figure 1: JET Request-Response and Notification Services

The following sections describe the JET application development scenarios and its workflow.

20

Page 19: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Off-Device Application Development Workflow

Figure 2 on page 21 describes off-device application development workflow.

Figure 2: Developing an Off-Device Application Workflow

External server

Linux (Ubuntu)

Off-device JETapplication workflow

Downloadand compilethe IDL file

Develop applicationusing languageof your choice

Package theapplication

Deploy applicationpackage on externalserver or run the appdirectly from JET VM

g200

521

On-Device Application Development Workflow

Figure 3 on page 22 describes on-device application development workflow.

21

Page 20: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Figure 3: Developing an On-Device Application Workflow

g200

522

SignedApplication?

Supports onlyC/C++/Python2.7 applications

DownloadVagrant VM

DownloadSB-toolchain

package

Acquire asigning certficate

Build, package, andsign the package usingthe acquired certificate

Deploy applicationpackage on a devicerunning Junos OS

Supports onlyPython 2.7applications

Configure the script

Linux (Ubuntu)

On-device JETapplication workflow

Veriexec Junos

Deploy applicationpackage on a devicerunning Junos OS

Veriexec Junos

No Yes

Release History Table

DescriptionRelease

Starting in Junos OS Release 16.2R1, JET supports gRPC framework for remoteprocedure calls (RPCs).

16.2R1

22

Page 21: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

3CHAPTER

Quick Start

Getting Started with JET | 25

Page 22: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48
Page 23: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Getting Started with JET

IN THIS SECTION

Overview | 25

Configure JET Interaction with Junos OS | 25

Compile IDL Files | 27

Sample Python Application | 28

Overview

JET supports language of your choice to write applications that can run off-device.

You must download the IDL file from the Juniper Networks website and compile the IDL file by using theprotoc compiler. You can write the application using stub after a client side stub is generated.

For more information on generating the gRPC client side stubs in the language of your choice and writingthe application using the stub and for details on how to generate code from an IDL file in the language ofyour choice, see https://www.grpc.io/docs/.

The example shown in “Sample Python Application” on page 28 guides you with using Python languageand you can follow the same for other languages that are supported by gRPC.

Configure JET Interaction with Junos OS

To run an off-device application, you need to enable the request-response configuration on the Junos OSdevice.

When using the request-response service, the client application issues a request and synchronously waitsfor the response from the Junos OS server.

You can configure the JET service process (jsd) to run in Secure Sockets Layer (SSL) mode for increasedsecurity. To have jsd run in SSL mode, you must first enable the jsd process to use SSL by adding andconfiguring the certificate name locally. The certificate must be an RSA certificate. ECDSA and DSA SSLcertificates are not supported.

25

Page 24: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

NOTE: If a certificate is updated with the same identifier, the changes will not reflect for jsd. Youneed to either configure the certificate with a new identifier in the jsd hierarchy or perform a jsdrestart to reflect the changes made.

Currently, JET supports Transport Layer Security (TLS) version 1.2 for certificate exchange and supportsmultiple encryption algorithms, but does not support mutual authentication. This means that clients canauthenticate the server, but the server can not authenticate clients using SSL/TLS certificates. For clientauthentication, use the LoginCheck() procedure from the authentication service API.

To configure the jsd for request-response service:

1. Before you enable gRPC with SSL, you must first generate and install the necessary certificates on aJunos network element.

NOTE: This method is same as other SSL based services in Junos (e.g. xnm-ssl). Ensure to keeptrack of the CN entry you specify during certificate generation, it should match in thehost_override option in our Sample App.

ubuntu-16:~ jet$ openssl genrsa -aes256 -out router.key.orig 2048ubuntu-16:~ jet$ openssl req -new -key router.key.orig -out router.csrubuntu-16:~ jet$ openssl rsa -in router.key.orig -out router.keyubuntu-16:~ jet$ openssl x509 -req -days 365 -in router.csr -signkey router.key -out router.crtubuntu-16:~ jet$ cat router.crt router.key > router.pem

2. Copy the .pem file to the device.

For example, if router.pem is the SSL certificate’s filename:

% scp router.pem device-name:/var/tmp

3. Load the certificate into the keychain on the Junos device.

For example, if the local name of the SSL certificate is ssl:

[edit]user@device# set security certificates local ssl load-key-file /var/tmp/router.pem

26

Page 25: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

4. Enable the gRPC endpoint to support SSL on the default port of tcp/51051.

[edit]user@device# set system services extension-service (System Extensions) request-response grpc ssl

NOTE: Setting ssl requires that you must first enable the jsd process to use SSL. See Step 1.

5. Specify the maximum connections.

max-connections is the number of simultaneous connections for request-response that can be attachedto jsd. The higher the number, the higher the impact on clients performance. The maximum number ofconnections supported is eight.

Compile IDL Files

To download and compile the IDL files:

1. Download the IDL file from the Juniper Networks website at www.juniper.net/support/downloads/.

2. Unpack the IDL file.

For example:

ubuntu-16:~ jet$ mkdir protoubuntu-16:~ jet$ tar -xzf jet-idl-18.4-20181107.0.tar.gz -C proto/ubuntu-16:~ jet$ ls proto/

1 2 README

ubuntu-16:~ jet$ ls proto/2

jnx_authentication_service.proto

jnx_common_addr_types.proto

jnx_common_base_types.proto

jnx_management_service.proto

jnx_registration_service.proto

3. Compile python and gRPC modules for Authentication and Management Service proto files.

For example:

27

Page 26: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

ubuntu-16:~ jet$ python -m grpc_tools.protoc -I./proto/2 --python_out=. --grpc_python_out=.proto/2/jnx_management_service.protoubuntu-16:~ jet$ python -m grpc_tools.protoc -I./proto/2 --python_out=. --grpc_python_out=.proto/2/jnx_authentication_service.protoubuntu-16:~ jet$ python -m grpc_tools.protoc -I./proto/2 --python_out=. --grpc_python_out=.proto/2/jnx_common_base_types.protoubuntu-16:~ jet$ ls -lrt

total 112

-rw-r--r-- 1 vagrant vagrant 52683 Nov 8 16:47 jet-idl-18.4-20181107.0.tar.gz

drwxr-xr-x 1 vagrant vagrant 170 Nov 8 16:49 proto

-rw-r--r-- 1 vagrant vagrant 40924 Nov 8 16:56 jnx_management_service_pb2.py

-rw-r--r-- 1 vagrant vagrant 4719 Nov 8 16:56

jnx_management_service_pb2_grpc.py

-rw-r--r-- 1 vagrant vagrant 5365 Nov 8 2018 jnx_authentication_service_pb2.py

-rw-r--r-- 1 vagrant vagrant 1898 Nov 8 2018

jnx_authentication_service_pb2_grpc.py

-rw-r--r-- 1 vagrant vagrant 6391 Nov 8 2018 jnx_common_base_types_pb2.py

-rw-r--r-- 1 vagrant vagrant 83 Nov 8 2018

jnx_common_base_types_pb2_grpc.py

For details on how to generate code from an IDL file in the language of your choice, seehttps://www.grpc.io/docs.

Sample Python Application

For example:

#!/usr/bin/env python

# A simple Python client to run XML OP command 'get-system-uptime-information'

# Environment

# Python 2.7.12

# grpcio (1.12.0)

# grpcio-tools (1.12.0)

# Following files should be available in current working directory

# jnx_authentication_service_pb2_grpc.py

# jnx_authentication_service_pb2.py

28

Page 27: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

# jnx_management_service_pb2_grpc.py

# jnx_management_service_pb2.py

import argparse

import grpc

import os

import stat

import jnx_authentication_service_pb2

import jnx_authentication_service_pb2_grpc

import jnx_management_service_pb2

import jnx_management_service_pb2_grpc

import jnx_common_base_types_pb2

_HOST_OVERRIDE = 'router'

def Main():

try:

parser = argparse.ArgumentParser()

parser.add_argument('-d','--device', help='Input hostname',

required=True)

parser.add_argument('-t','--timeout', help='Input time_out value',

required=True,type=int)

parser.add_argument('-u', '--user', help='Input username',

required=True)

parser.add_argument('-pw', '--password', help='Input password',

required=True)

args = parser.parse_args()

#Establish grpc channel to jet router

creds = grpc.ssl_channel_credentials(open('/tmp/router.pem').read(),

None, None)

channel = grpc.secure_channel(args.device + ":32767", creds,

options=(('grpc.ssl_target_name_override', _HOST_OVERRIDE,),))

#create stub for authentication services

stub = jnx_authentication_service_pb2_grpc.AuthenticationStub(channel)

#Authenticate

login_request = jnx_authentication_service_pb2.LoginRequest(

username=args.user, password=args.password, client_id="SampleApp")

login_response = stub.Login(login_request, args.timeout)

29

Page 28: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

#Check if authentication is successful

if login_response.status.code == jnx_common_base_types_pb2.SUCCESS:

print "[INFO] Connected to gRPC Server"

else:

print "[ERROR] gRPC Server Connection failed:"

print login_response.status.message

#Create stub for management services

stub = jnx_management_service_pb2_grpc.ManagementStub(channel)

print "[INFO] Connected to management service"

for i in range(1):

#Provide API request details

op_xml_command = "<get-system-uptime-information>"

op = jnx_management_service_pb2.OpCommandGetRequest(

xml_command=op_xml_command, out_format=2)

# Invoke API

op_response = stub.OpCommandGet(op, args.timeout)

# Check API response like status and output

for resp in op_response:

if resp.status.code == jnx_common_base_types_pb2.SUCCESS:

print "[INFO] Invoked OpCommandGetRequest succeeded"

print "[INFO] Return output in CLI format = "

print resp.data

else:

print "[ERROR] Invoked OpCommandGetRequest failed"

print "[ERROR] " + resp.status.message

except Exception as ex:

print ex

if __name__ == '__main__':

Main()

ubuntu-16:~ jet$ python mgd_api_new_doc_example_ssl.py -d JUNOS_DEVICE -t TIMEOUT -uUSER -pw PASSWORD

[INFO] Connected to gRPC Server

[INFO] Connected to management service

[INFO] Invoked OpCommandGetRequest succeeded

[INFO] Return output in CLI format =

30

Page 29: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Current time: 2018-11-08 09:36:40 PST

Time Source: NTP CLOCK

System booted: 2018-10-09 17:02:56 PDT (4w1d 17:33 ago)

Protocols started: 2018-10-09 17:05:09 PDT (4w1d 17:31 ago)

Last configured: 2018-11-08 09:30:28 PST (00:06:12 ago) by root

9:36AM up 29 days, 17:34, 2 users, load averages: 1.05, 0.77, 0.57

31

Page 30: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

4CHAPTER

Application Development

Overview | 35

Prerequisites and Setup | 35

On-Device Applications | 40

Page 31: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48
Page 32: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Overview

JET provides a development environment that you can download the JET bundle from the Juniper Networksdownload site. JET bundle includes a virtual machine (VM) packaged as a vagrant file, JET toolchain, plug-ins,and other tools and libraries that are required for developing on-device or off-device applications. TheJET VM is based on 64-bit Ubuntu 12.04 long-term support release.

If you are developing an application with a dependency on C or C++ modules or developing a signedapplication, then you must use the JET VM for the application development.

RELATED DOCUMENTATION

Prerequisites and Setup | 35

On-Device Applications | 40

Prerequisites and Setup

IN THIS SECTION

Download the Packages You Need | 35

Initialize Your Virtual Machine | 36

Set Up Your Virtual Machine Environment | 38

Create a Certificate Request | 39

Download the Packages You Need

For using the JET VM, download and install the following packages:

• Vagrant

Vagrant (https://www.vagrantup.com/) is a software that creates and configures virtual developmentenvironments. You can think of it as a higher-level wrapper around virtualization software such as

35

Page 33: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

VirtualBox (https://www.virtualbox.org/wiki/Downloads). You can use Vagrant to manage the JETdevelopment virtual machine (VM).

To download Vagrant, go to https://www.vagrantup.com/ and download Vagrant for your system’splatform (Windows, Mac, or Linux).

• VirtualBox

For the JET VM, Juniper Networks supports only the VirtualBox hypervisor.

To download and install VirtualBox:

1. Go to https://www.virtualbox.org/wiki/Downloads.

2. Download and install the VirtualBox package for your platform and the VirtualBox extension package.

3. Enable hardware virtualization support on your machine BIOS if it is not already enabled.

• JET Files from the Juniper Networks Download Site

Download the JET VM from the Juniper Networks download website in the form of following packages:

• JET sandbox and toolchain file

• JET client IDL library

• JET-vagrant.zip file

To download the JET files, go to Juniper Networks download website and download the package.

Initialize Your Virtual Machine

To start the JET VM:

1. Create a jet-vagrant directory.

2. Extract the JET-vagrant.zip file you downloaded from the Juniper Networks download site to thejet-vagrant directory.

3. Change to the jet-vagrant directory where you have extracted the JET-vagrant.zip file.

4. Run the vagrant up command in the jet-vagrant directory.

36

Page 34: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

NOTE: Before using the JET VM, wait for the installation of all the packages after running thevagrant up command.

37

Page 35: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

If needed, use the following default login credentials:

username: vagrantpassword: vagrant

Set Up Your Virtual Machine Environment

To set the PATH variable:

1. Extract junos-jet-XX.YRZ.S.tar.gz package and install it using the following command:

Where:

• XX is the main release number of the product, for example, 18.

• Y is the minor release number of the product, for example, 3.

• R is the type of software release, for example, R for FRS or maintenance release.

• Z is the build number of the product, for example, 1, indicating the FRS rather than a maintenancerelease.

• S is the spin number of the product, for example, 13

./install

NOTE: Run the sudo ./install command if you have not logged in as root user.

2. Open a terminal in the VM.

3. Add absolute path to /junos-jet-XX.YRZ.S.tar.gz/bin directory to the PATH variable in .bashrc.

For example:

vagrant@jet-vm:~$ echo'PATH=$PATH:/usr/local/junos-jet/18.3R1/junos-jet-XX.YRZ.S.tar.gz'>>~/.bashrc

4. Run the following command for JET XX.YRZ.S.tar.gz path to display in the output:

vagrant@jet-vm:~$ source ~/.bashrc

5. Run the env command to ensure the PATH variable contains the directory path you just added.

38

Page 36: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

vagrant@jet-vm:~$ env

PATH=/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:

/bin:/usr/games:/usr/local/junos-jet/18.3R1/junos-jet-XX.YRZ.S.tar.gz/bin

Create a Certificate Request

In order to develop and distribute JET applications, you must install a package signing certificate onto theVM by executing the certificate request script. This script assists you in creating a signing key and acertificate request for use with JET.

CAUTION: Never share the signing key to anyone, including Juniper Networks. The keyenables anyone to sign applications that your router will trust. Therefore, treat the keywith the same level of security as the root password for the routers. Once you obtainyour signing key, save it in a file outside of the VM.

The certificate request script asks for the following information:

• City, state, and country

• Your organization and unit

• Provider prefix

Use a string that represents your organization. This string will be used later in the configuration on theJunos OS device. Use lowercase letter followed by one or more lowercase letters or numbers. Forexample, xyzorg.

• User string

This is an additional specification of your choosing. It could be a string specifying the development teamor project name. The user string can consist of a lowercase letter followed by one or more lowercaseletters or numbers. For example, teamjet2.

• Deployment scope

This the string assigned by Juniper to differentiate multiple certificates for the same partner. If none isassigned to you, leave it empty.

• Index number

39

Page 37: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

This number is known as a certificate generations number. It will be 1 for your initial certificate. Whena certificate expires and when you request for a new one, this number will be incremented.

• E-mail address

We recommend against using a personal e-mail address for the certificate contact.

To create a signed application, request certificates and copy them as explained in the following procedure.This procedure is optional if you want to create an unsigned application.

To create a certificate request manually:

1. In a VM terminal, run the jet-certificate-request command.

The script leads you through a series of questions.

2. Answer the questions, and press Enter after each answer.

These answers synthesizes a certificate name. The certificate name appears as the stem of the filenamesfor two files the script creates in the /usr/local/junos-jet/certs directory: filename_key.pem andfilename_req.pem.

3. Save the filename_key.pem file outside the VM.

Ensure that no one outside of your development organization has access to it. Do not send this file toJuniper Networks.

4. Send the filename_req.pem file to JET Certificate Processing at [email protected].

JET Certificate Processing immediately sends your certificate to you.

To copy your certificate:

• Copy the certificate file to the /usr/local/junos-jet/certs directory.

On-Device Applications

IN THIS SECTION

Overview | 41

Signed C Package | 41

Signed Python Package Without C Dependencies | 44

40

Page 38: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Signed Python Package with C Dependencies | 48

Unsigned Python Program | 52

Overview

JET supports C, C++, and Python languages to write applications that can run on-device. You can developthe applications in the downloaded VM and then deploy these applications on the device running on JunosOS.

NOTE: Starting in Junos OS Release 19.3R1, devices running Junos OS with Upgraded FreeBSDsupport using IPv6 in Python applications.

Signed C Package

Before you develop a signed on-device JET application, ensure you:

• Set up a VM on your system. See Set Up Your Virtual Machine Environment in “Prerequisites and Setup”on page 35.

• Install a package signing certificate onto the VM by executing the certificate request script. See Createa Certificate Request in “Prerequisites and Setup” on page 35.

• Verify if the certificate and the signing key are available in the /usr/local/junos-jet/certs directory.

• For information on the extensions providers, see providers.

Now you are ready to create the development sandbox in the VM and start developing the applications.

A sandbox is simply a build tree with a magic little environment file (called .sandbox-env) at the top whichis used by a wrapper script mk to ensure the build environment is properly conditioned.

41

Page 39: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

To create C applications echoclient and echoserver:

1. Checkout the sandbox.

vagrant@jet-vm:~$ mksb -n capp echoclient /home/vagrant/capp_server/src/echoclient.json

NOTE: The echoclient is a demo application. In the bin/ directory, all the necessary configurationand build related files are available within the sandbox along with source file for the echoclient.

2. Build an echoclient package.

vagrant@jet-vm:/home/vagrant/capp/src$ mk-i386,bsdx echoclient

3. Copy the echoclient package on to the device running on Junos OS.

vagrant@jet-vm:/home/vagrant/capp/src$ scp/home/vagrant/capp/junos-jet-sb-obj//ship/echoclient-x86-32-20180829.065039_vagrant.tgzroot@user:/var/tmp

4. On Junos Device, enter the configuration mode.

root@user:~ # cli

5. Install the echo client package

root@user> request system software add/var/tmp/echoclient-x86-32-20180829.065039_vagrant.tgz

Verified echoclient-x86-32-20180829.065039_vagrant signed by

junosmanageability-dev-beta-1 method RSA2048+SHA1

root@user> show version

Hostname: user

Model: mx480

Junos: 18.4-20180627_dev_common.1

JUNOS OS Kernel 32-bit [20180621.191151_fbsd-builder_stable_11]

JET app echoclient [20180829.065039_vagrant]

6. Check out echoserver sandbox.

42

Page 40: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

vagrant@jet-vm:/home/vagrant$ mksb -n capp_server echoserver/home/vagrant/capp_server/src/echoclient.json

7. Bulid the echoserver package.

vagrant@jet-vm:/home/vagrant/capp_server/src$ mk-i386,bsdx echoserver

8. Copy the echoserver package to Junos VM.

vagrant@JETVM:/home/vagrant/capp_server/src$ scp/home/vagrant/capp_server/junos-jet-sb-obj//ship/echoserver-x86-32-20180829.065703_vagrant.tgzroot@user:/var/tmp/

9. Add the echoserver package on to Junos VM.

root@user> request system software add/var/tmp/echoserver-x86-32-20180829.065703_vagrant.tgz

Verified echoserver-x86-32-20180829.065703_vagrant signed by

junosmanageability-dev-beta-1 method RSA2048+SHA1

10.Check if the packages were added successfully.

root@user> show version

Hostname: user

Model: mx480

Junos: 18.4-20180627_dev_common.1

JUNOS OS Kernel 32-bit [20180621.191151_fbsd-builder_stable_11]

JUNOS OS libs [20180621.191151_fbsd-builder_stable_11]

……….

………

JET app echoserver [20180829.065703_vagrant]

JET app echoclient [20180829.065039_vagrant]

11.Configure the echoserver on Junos VM.

root@user# set system extensions extension-service application file echoserverd

[edit]

root@user# commit

commit complete

43

Page 41: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

[edit]

root@user# exitroot@user> request extension-service start echoserverd

Extension-service application 'echoserverd' started with pid: 27552

12.Configure the echoclient application on Junos VM.

root@user# set system extensions extension-service application file echoclientd arguments"127.0.0.1 Testmessage"

[edit]

root@user# commit

commit complete

[edit]

root@user# exit

13.Run the echoclient application.

root@user> request extension-service start echoclientd

Extension-service application 'echoclientd' started with pid: 28582

-- server reply:Testmessage

-- Testmessage

Signed Python Package Without C Dependencies

Before you develop a signed on-device JET application, ensure you:

• Set up a VM on your system. See Set Up Your Virtual Machine Environment in “Prerequisites and Setup”on page 35.

• Install a package signing certificate onto the VM by executing the certificate request script. See Createa Certificate Request in “Prerequisites and Setup” on page 35.

44

Page 42: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

• Verify if the certificate and the signing key are available in the /usr/local/junos-jet/certs directory.

• For information on the extensions providers, see providers.

Now you are ready to create the development sandbox in the VM and start developing the applications.

A sandbox is simply a build tree with a magic little environment file (called .sandbox-env) at the top whichis used by a wrapper script mk to ensure the build environment is properly conditioned.

To create a development sandbox:

1. In the VM, go to the /home/vagrant directory.

2. Create a sandbox by using the mksb command, for example:

vagrant@jet-vm:~$ mksb -n SamplePyApp% mksb -n SamplePyApp

Where SamplePyApp is the name of the sandbox.

3. Create subdirectories in the sandbox.

a. Use the workon command to go into your sandbox.

vagrant@jet-vm:/home/vagrant$ workon SamplePyApp

The workon command takes you directly to the $SB/src directory and sets the sandbox correctly.

Alternatively, you can cd to the src directory of your sandbox.

b. Create subdirectories for application code in $SB/src/python or $SB/src/lib or $SB/src/bin, basedon whether you need Python, library, or bin (executable) files.

vagrant@jet-vm:/home/vagrant/pyapp/src/python$ mkdir SamplePyApp

4. Develop the code.

vagrant@jet-vm:$ /home/vagrant/pyapp/src/python/SamplePyApp$ ls cmdline_args.py.

For example:

If you have a script with the name cmdline_args.py and it is available in the /var/db/scripts/jet/ directoryon a device running on JunosOS, you can supply the arguments from the Junos CLI using the argumentsconfiguration statement at the hierarchy level: [edit system extensions extension-service (SystemExtensions) application file filename:

45

Page 43: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

import argparse

def main():

parser = argparse.ArgumentParser(description='This is a demo script.')

parser.add_argument('-arg1', required=True)

parser.add_argument('-arg2', required=True)

args = parser.parse_args()

print args.arg1

print args.arg2

if __name__ == '__main__':

main()

5. Write an application JSON file.

SamplePyApp.json

{

"app-name" : "SamplePyApp",

"app-path" : "python/SamplePyApp",

"language" : "python",

"main-scripts" : ["cmdline_args.py"],

"app-type" : "standalone",

"sign" : "yes",

"os-type" : "bsd11",

"target-arch" : "i386",

"description" : "Simple Python App"

}

6. Add the path to jet-pkg-gen.py to your .bashrc file:

vagrant@jet-vm:/home/vagrant$ echo'PATH=$PATH:/usr/local/junos-jet/18.2R1.9/junos-jet-sb/src/junos/host-utils/scripts' >> ~/.bashrcvagrant@jet-vm:/home/vagrant/pyapp/src$ source ~/.bashrc

7. Autogenerate the appropriate makefiles by running the jet-pkg-gen.py command.

NOTE: The autogenerated application makefile will be correct for most cases; if there are anyexternal library dependencies, you must adjust the makefile accordingly.

46

Page 44: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

The jet-pkg-gen.py command takes two options:

• The -i option is followed by the path and filename of the JSON file.

• The -p option is followed by the path to the src directory of the sandbox.

For example, if a sandbox name is SamplePyApp, then:

vagrant@jet-vm:~/SamplePyApp/src$ jet-pkg-gen.py -I/home/vagrant/pyapp/src/SamplePyApp.json -p /home/vagrant/pyapp/src

8. Build the entire package.

a. Return to the src directory ($SB/src).

b. Run the mk-i386 SamplePyApp command, where SamplePyApp is the "app-name" from the JSONfile.

vagrant@jet-vm:/home/vagrant/pyapp/src$ mk-i386,bsdx SamplePyApp

For more on the JSON file, see “JSON File Format for JET Application Packaging” on page 80.

9. Copy the package on to a device running on Junos OS.

vagrant@jet-vm:/home/vagrant/pyapp/src$scp../junos-jet-sb-obj/ship/SamplePyApp-x86-32-20180828.231545_vagrant.tgz root@user:/var/tmp/

10. Install the copied package on a device running on Junos OS.

root@user> request system software add/var/tmp/SamplePyApp-x86-32-20180828.231545_vagrant.tgz

NOTE: This step will fail if the providers configuration is not available already.

11.Verify if the package is installed successfully.

root@user> show version

Hostname: user

Model: mx480

JET app SamplePyApp [20180828.231545_vagrant]

47

Page 45: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

12. Enter configuration mode.

user@device> configure

Entering configuration mode

[edit]

user@device#

13.Configure the command-line arguments.

user@device# set systemextensions extension-service application file cmdline_args.py arguments"-arg1 jet -arg2 application"

14.Commit.

user@device# commit

15. Start the application.

user@device# exit

16.Run the application.

user@device> request extension-service start cmdline_args.py

Extension-service application 'cmdline_args.py' started with PID: 71198

jet

application

Signed Python Package with C Dependencies

Before you develop a signed on-device JET application, ensure you:

• Set up a VM on your system. See Set Up Your Virtual Machine Environment in “Prerequisites and Setup”on page 35.

• Install a package signing certificate onto the VM by executing the certificate request script. See Createa Certificate Request in “Prerequisites and Setup” on page 35.

• Verify if the certificate and the signing key are available in the /usr/local/junos-jet/certs directory.

• For information on the extensions providers, see providers.

48

Page 46: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

To develop a python application with C dependencies:

1. Check out the sandbox.

vagrant@jet-vm:/vagrant/jet-trial-apps/signed-python-with-c-dep$ mksb -n PyAppC

2. Create an application directory within the python subdirectory.

vagrant@jet-vm:/vagrant/jet-trial-apps/signed-python-with-c-dep/PyAppC/src/python$ mkdirpyappc

We have used a bitarray which is a relatively simple python module which has C dependency.

3. Download and extract bitarray from https://pypi.org/project/bitarray/ into our python applicationdirectory.

vagrant@jet-vm:/vagrant/jet-trial-apps/signed-python-with-c-dep/PyAppC/src/python/pyappc$ls bitarray

_bitarray.c __init__.py

Following example is a simple python application that uses bitarray module:

vagrant@jet-vm:/vagrant/jet-trial-apps/signed-python-with-c-dep/PyAppC/src/python/pyappc$

cat bitarray_app.py

from bitarray import bitarray

a = bitarray()

a.append(True)

a.extend([False, True, False])

print a

4. Create the JSON configuration file that includes references to the external source files.

vagrant@jet-vm:/vagrant/jet-trial-apps/signed-python-with-c-dep/PyAppC/src$ cat pyappc.json

{

"app-name" : "PyAppC",

"app-path" : "python/pyappc",

"language" : "python",

"main-scripts" : ["bitarray_app.py"],

"app-type" : "standalone",

"sign" : "yes",

"os-type" : "bsd11",

49

Page 47: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

"target-arch" : "i386",

"description" : "Simple Python App with C dependencies",

"srcs" : {

"python/pyappc/bitarray" : ["__init__.py"]

},

"extn-srcs" : {

"python/pyappc/bitarray" : ["_bitarray.c"]

}

}

vagrant@jet-vm:/vagrant/jet-trial-apps/signed-python-with-c-dep/PyAppC/src$ jet-pkg-gen.py-I /vagrant/jet-trial-apps/signed-python-with-c-dep/PyAppC/src/pyappc.json -p/vagrant/jet-trial-apps/signed-python-with-c-dep/PyAppC/src

5. Run the following command to create necessary Makefiles and manifest file which locates the files onthe Junos VM when the package is installed, this will require a tweak.

/vagrant/jet-trial-apps/signed-python-with-c-dep/PyAppC/src/pkgs/PyAppC/contents.manifestvagrant@jet-vm:/vagrant/jet-trial-apps/signed-python-with-c-dep/PyAppC/src$ cat./pkgs/PyAppC/contents.manifest.orig

/set package_id=31 role=Provider_Daemon

%TOPDIR%/python/pyappc/bitarray_app.py store=%INSTALLDIR%/bitarray_app.py mode=555

program_id=1

%TOPDIR%/python/pyappc/bitarray/__init__.py

store=%PYTHON_MOD_INSTALLDIR%/PyAppC/bitarray/__init__.py mode=555 program_id=1

%TOPDIR%/python/pyappc/_bitarray.so

store=%PYTHON_MOD_INSTALLDIR%/PyAppC/_bitarray.so mode=555 program_id=1

6. Add the /PyAppC/ path for __init__.py file and also add bitarray/ directory path for _bitarray.so.

These tweaks are necessary to locate the bitarray module on Junos device.

vagrant@jet-vm:/vagrant/jet-trial-apps/signed-python-with-c-dep/PyAppC/src$ cat./pkgs/PyAppC/contents.manifest

/set package_id=31 role=Provider_Daemon

%TOPDIR%/python/pyappc/bitarray_app.py store=%INSTALLDIR%/bitarray_app.py mode=555

program_id=1

%TOPDIR%/python/pyappc/bitarray/__init__.py

store=%PYTHON_MOD_INSTALLDIR%/bitarray/__init__.py mode=555 program_id=1

50

Page 48: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

%TOPDIR%/python/pyappc/_bitarray.so

store=%PYTHON_MOD_INSTALLDIR%/bitarray/_bitarray.so mode=555 program_id=1

7. Build and package the application after the changes.

vagrant@jet-vm:/vagrant/jet-trial-apps/signed-python-with-c-dep/PyAppC/src$ mk-i386,bsdxPyAppC

8. Copy the built package on to the device running Junos OS.

vagrant@jet-vm:/vagrant/jet-trial-apps/signed-python-with-c-dep/PyAppC/src$ scp/vagrant/jet-trial-apps/signed-python-with-c-dep/PyAppC/junos-jet-sb-obj/ship/PyAppC-x86-32-20180829.211252_vagrant.tgz root@user:/var/tmp/

9. Add the package to the device running Junos OS.

root@user> request system software add PyAppC-x86-32-20180830.031354_vagrant.tgz

Once the package is installed successfully, you can notice that the dependent python module and theC shared library are installed on the device in the standard Python module path as specified in themanifest file.

root@user:/opt/lib/python2.7/site-packages # ls bitarray/__init__.py _bitarray.so

10.Add the sample application in the configuration mode.

root@user# set system extensions extension-service application file bitarray_app.py

[edit]

root@user# commit

commit complete

11.Run the application

root@user> request extension-service start bitarray_app.py

Extension-service application 'bitarray_app.py' started with PID: 8963

bitarray('1010')

51

Page 49: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Unsigned Python Program

For the configuration statement for unsigned Python language, see language.

For running JET Python applications on a device running Junos OS, you can configure command-linearguments for the file.

For example:

If you have a script with the name cmdline_args.py and it is available in the /var/db/scripts/jet/ directoryon a device running on Junos OS, you can supply the arguments from the Junos CLI using the argumentsconfiguration statement at the hierarchy level: [edit system extensions extension-service (SystemExtensions) application file filename:

import argparse

def main():

parser = argparse.ArgumentParser(description='This is a demo script.')

parser.add_argument('-arg1', required=True)

parser.add_argument('-arg2', required=True)

args = parser.parse_args()

print args.arg1

print args.arg2

if __name__ == '__main__':

main()

To configure the arguments in the CLI:

1. Enter configuration mode.

user@device> configure

Entering configuration mode

[edit]

user@device#

2. Configure the command-line arguments.

user@device# set systemextensions extension-service application file cmdline_args.py arguments"-arg1 jet -arg2 application"

52

Page 50: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

3. Commit.

user@device# commit

4. Start the application.

user@device# exit

5. Run the application.

user@device> request extension-service start cmdline_args.py

Extension-service application 'cmdline_args.py' started with PID: 71198

jet

application

53

Page 51: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

5CHAPTER

Troubleshooting

Debugging JET Applications | 57

Page 52: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48
Page 53: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Debugging JET Applications

Users need to enable the extension-service traceoptions on the JunosOS device before writing the sampleapplications.

In case your application is not able to connect to the Junos service process (jsd):

1. Check whether jsd is up and running on the Junos OS device using the following command:

ps aux | grep jsd

If not, then restart jsd using the following command.

user@device# restart jsd <gracefully | immediately | soft>

Where:

• gracefully—Gracefully restart the process

• immediately—Immediately restart (SIGKILL) the process

• soft—Soft reset (SIGHUP) the process

• |—Pipe through a command

2. If jsd is up, verify the configuration is present on the device using the following CLI command inconfiguration mode:

user@device# show system services extension-service

3. If the configuration is present, verify if jsd is listening on configured port 51051:

nestat -a | grep 51051

You should see a matching entry. If you do not, then restart jsd.

To eliminate any firewall issues, use an on-device application to test.

In case of notification applications, verify that your client IP source address (the address from which theconnection is established) is added to the list of allowed clients in the jsd notification configuration.

jsd is supported only on the Routing Engine running in master mode. It is not supported on the backupRouting Engine.

57

Page 54: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Ensure that themaximum number of notification connections does not exceed as configured on the device.Use the following command to see the clients:

netstat -a | grep 1883

For debugging applications on a device running Junos OS, you can configure the trace file and trace optionwith the system extension-service statement. See, traceoptions (Services).

For non-daemonized applications that run on the router, you can invoke the debugger at the same timethat you install the application.

To load your application along with the debugger:

1. Use the request extension-service start invoke-debugger cli command.

user@device> request extension-service start invoke-debugger cli application-name.py

Extension-service application 'application-name.py' started with pid: 71246

2. Enter help to display a list of the supported commands.

(Pdb) help

Documented commands (type help <topic>):

========================================

EOF bt cont enable jump pp run unt

a c continue exit l q s until

alias cl d h list quit step up

args clear debug help n r tbreak w

b commands disable ignore next restart u whatis

break condition down j p return unalias where

Miscellaneous help topics:

==========================

exec pdb

Undocumented commands:

======================

retval rv

58

Page 55: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

6CHAPTER

Configuration Statements

allow-clients | 61

application (Extensions) | 62

arguments | 63

checksum | 64

commit | 65

description | 66

daemonize | 67

exit | 68

extensions | 69

extension-service (System Extensions) | 72

extension-service (System Services gRPC) | 74

extension-service (System Services) | 75

file (JET) | 77

grpc | 79

interface-notification (programmable-rpd) | 80

Page 56: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

JSON File Format for JET Application Packaging | 80

language (Scripts) | 87

license-type | 88

local | 89

max-connections | 90

max-datasize | 91

notification | 93

providers | 94

purge-timeout (routing-options programmable-rpd) | 95

refresh (JET) | 97

refresh-from (JET) | 99

request-response | 101

routing-instance (JET Scripts) | 102

services (System Services) | 103

source (JET Scripts) | 109

ssl | 110

top | 112

traceoptions (Extensions) | 113

traceoptions (Services) | 115

traceoptions (routing-options programmable-rpd) | 117

username | 119

Page 57: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

allow-clientsSyntax

allow-clients {address ip-address;

}

Hierarchy Level

[edit system services extension-service notification]

Release InformationStatement introduced in Junos OS Release 16.1 for MX80, MX104, MX240, MX480, MX960, MX2010,MX2020, vMX Series.

DescriptionSpecify client IP addresses from which notifications are allowed.

Optionsaddress ip-address—Specify IPv4 or IPv6 addresses (prefix length optional) or host names. You can specify

a set of values using square brackets ([ ]).

Required Privilege Levelsystem—To view this statement in the configuration.system-control—To add this statement to the configuration.

61

Page 58: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

application (Extensions)Syntax

application {file script-name {arguments arguments;checksum (md5 | sha-256 | sha1) hash;daemonize;refresh;refresh-from;respawn-on-normal-exit;routing-instance;source;traceoptions {file <filename> <files number> <match regex> <size size> <world-readable | no-world-readable>;flag flag;no-remote-trace;

}username username;

}max-datasize max-datasize;traceoptions {file <filename> <files number> <match regex> <size size> <world-readable | no-world-readable>;flag flag;no-remote-trace;

}}

Hierarchy Level

[edit system extensions extension-service]

Release InformationStatement introduced in Junos OS Release 16.1 for MX80, MX104, MX240, MX480, MX960, MX2010,MX2020, vMX Series.

NOTE: Global traceoptions for daemonized applications do not take effect if the daemonizedapplication and global traceoptions are committed separately

Description

62

Page 59: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Configure the Junos OS extension service application.

The remaining statements are explained separately. See CLI Explorer.

Required Privilege Levelmaintenance—To view this statement in the configuration.maintenance-control—To add this statement to the configuration.

argumentsSyntax

arguments {argument-name {description descriptive-text;

}}

Hierarchy Level

[edit system scripts op file filename]

Release InformationStatement introduced in Junos OS Release 7.6.

DescriptionDefine the expected command-line arguments for an op script. Once configured, the list of possiblearguments will be included in the context-sensitive help in the CLI.

Optionsargument-name—The name of a command-line argument to an op script.

The remaining statement is explained separately. See CLI Explorer.

Required Privilege Levelmaintenance—To view this statement in the configuration.maintenance-control—To add this statement to the configuration.

63

Page 60: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

checksumSyntax

checksum (md5 | sha-256 | sha1) hash;

Hierarchy Level

[edit event-options event-script file filename],[edit system scripts commit file filename],[edit system scripts op file filename],[edit system scripts snmp file filename],[edit system extensions extension-service (System Extensions) application file filename]

Release InformationStatement introduced in Junos OS Release 9.5.Statement introduced in Junos OS Release 11.1 for the QFX Series.Statement introduced in Junos OS Release 13.2X51-D10 for QFX Series switches.Statement introduced in Junos OS Release 14.1X53-D20 for the OCX Series.Statement introduced for the [edit systemextensions extension-service application file filename] hierarchylevel in Junos OS Release 16.1 for MX80, MX104, MX240, MX480, MX960, MX2010, MX2020, vMXSeries.

DescriptionFor Junos OS commit scripts, event scripts, op scripts, SNMP scripts, and scripts developed using theJuniper Extension Toolkit (JET) specify the MD5, SHA-1, or SHA-256 checksum hash. When Junos OSexecutes a local commit, event, op, or SNMP script, the system verifies the authenticity of the script byusing the configured checksum hash.

Optionsmd5 hash—MD5 checksum of this script.

sha-256 hash—SHA-256 checksum of this script.

sha1 hash—SHA-1 checksum of this script.

Required Privilege Levelmaintenance—To view this statement in the configuration.maintenance-control—To add this statement to the configuration.

64

Page 61: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

commitSyntax

commit {allow-transients;dampen {dampen-options {cpu-factor cpu-factor;line-interval line-interval;time-interval time-interval;

}}direct-access;file filename {checksum (md5 | sha-256 | sha1) hash;optional;refresh;refresh-from url;routing-instance routing-instance-name;source url;

}max-datasize size;refresh;refresh-from url;traceoptions (Extensions) {file <filename> <files number> <size size> <world-readable | no-world-readable>;flag flag;no-remote-trace;

}}

Hierarchy Level

[edit system scripts]

Release InformationStatement introduced in Junos OS Release 7.4.Statement introduced in Junos OS Release 11.1 for the QFX Series.Statement introduced in Junos OS Release 14.1X53-D20 for the OCX Series.

DescriptionFor Junos OS commit scripts, configure the commit-time scripting mechanism.

65

Page 62: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

OptionsThe remaining statements are explained separately. See CLI Explorer.

Required Privilege Levelmaintenance—To view this statement in the configuration.maintenance-control—To add this statement to the configuration.

descriptionSyntax

description description;

Hierarchy Level

[edit system scripts op file filename][edit system scripts op file filename arguments argument-name]

Release InformationStatement introduced in Junos OS Release 7.6.Statement introduced in Junos OS Release 11.1 for the QFX Series.Statement introduced in Junos OS Release 14.1X53-D20 for the OCX Series.

DescriptionProvide help text to describe an op script or its command-line arguments. The help text is included in thecontext-sensitive help in the command-line interface (CLI).

Optionsdescription—At the script hierarchy level, specify the purpose of the script. At the arguments hierarchy

level, provide a description for the command-line argument.

Required Privilege Levelmaintenance—To view this statement in the configuration.maintenance-control—To add this statement to the configuration.

66

Page 63: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

daemonizeSyntax

daemonize;

Hierarchy Level

[edit system extensions extension-service application file filename]

Release InformationStatement introduced in Junos OS Release 16.1 for MX80, MX104, MX240, MX480, MX960, MX2010,MX2020, vMX Series.

DescriptionAn application runs as a daemonized process in the background. An application configured to run as adaemonized process triggers automatically upon commit. A non-daemonized applicationmust be triggeredmanually from the command-line client.

Optionsdaemonize—Specify the application as daemonized.

The remaining statement is explained separately. See CLI Explorer.

Required Privilege Levelmaintenance—To view this statement in the configuration.maintenance-control—To add this statement to the configuration.

67

Page 64: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

exitSyntax

exit <configuration-mode>

Release InformationCommand introduced before Junos OS Release 7.4.

DescriptionExit the current level of the statement hierarchy, returning to the level prior to the last edit command, orexit from configuration mode. The quit and exit commands are synonyms.

Optionsnone—Return to the previous edit level. If you are at the top of the statement hierarchy, exit configurationmode.

configuration-mode—(Optional) Exit from configuration mode.

Required Privilege Levelconfigure—To enter configurationmode, but other required privilege levels depend onwhere the statementis located in the configuration hierarchy.

68

Page 65: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

extensionsSyntax

extensions {extension-service (System Extensions) {application {file script-name {arguments arguments;checksum (md5 | sha-256 | sha1) hash;daemonize;username username;

}max-datasize max-datasize;traceoptions (Extensions) {file <filename> <files number> <size size> <world-readable | no-world-readable>;flag flag;no-remote-trace;

}}

}providers {

provider-id {license-type license deployment-scope [ deployments ];

}}resource-limits {package package-name {resources {cpu {priority number;time seconds;

}file {core-size bytes;open number;size bytes;

}memory {data-size bytes;locked-in bytes;resident-set-size bytes;socket-buffers bytes;stack-size bytes;

69

Page 66: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

}}

}process process-ui-name {resources {cpu {priority number;time seconds;

}file {core-size bytes;open number;size bytes;

}memory {data-size bytes;locked-in bytes;resident-set-size bytes;socket-buffers bytes;stack-size bytes;

}}

}}

}

Hierarchy Level

[edit system]

Release InformationStatement introduced in Junos OS Release 9.0.extension-service option introduced in JunosOSRelease 16.1 forMX80,MX104,MX240,MX480,MX960,MX2010, MX2020, vMX Series.

70

Page 67: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

DescriptionConfigure extensions to Junos OS.

You must configure the providers provider-id statement to enable application packages developed usingthe Junos SDK to be deployed and run on the router.

You must configure the extension-service statement to enable application packages developed using theJuniper Extension Toolkit (JET) to be deployed and run on the device.

The remaining statements are explained separately. See CLI Explorer.

Required Privilege Leveladmin—To view this statement in the configuration.admin-control—To add this statement to the configuration.

71

Page 68: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

extension-service (System Extensions)Syntax

extension-service {application {file script-name {arguments arguments;checksum (md5 | sha-256 | sha1) hash;daemonize;refresh;refresh-from;respawn-on-normal-exit;routing-instancesource;traceoptions {file <filename> <files number> <match regex> <size size> <world-readable | no-world-readable>;flag flag;no-remote-trace;

}username username;

}max-datasize max-datasize;traceoptions {file <filename> <files number> <size size> <world-readable | no-world-readable>;flag flag;no-remote-trace;

}}

}

Hierarchy Level

[edit system extensions]

Release InformationStatement introduced in Junos OS Release 16.1 for MX80, MX104, MX240, MX480, MX960, MX2010,MX2020, vMX Series.Statement introduced in Junos OS Release 17.1R1 for all MX-Series routers.Statement introduced in JunosOSRelease 17.1R1 for ACX500, ACX1000, ACX1100, ACX2100, ACX2200,ACX4000 routers.Statement introduced in Junos OS Release 17.2R1 for PTX-Series routers.Statement introduced in Junos OS Release 17.3R1 for SRX-Series Services Gateways.

72

Page 69: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Argument respawn-on-normal-exit introduced in Junos OS Releases 17.3R3 and 18.1R1.

DescriptionEnable Junos OS extension services.

The refresh option instructs the system to refresh all jet applications from their source.

The refresh-from option instructs the system to refresh all jet applications from a given base URL.

The source option provides the specific URL of the source for this application.

The remaining statements are explained separately. See CLI Explorer.

Required Privilege Levelmaintenance—To view this statement in the configuration.maintenance-control—To add this statement to the configuration.

73

Page 70: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

extension-service (System Services gRPC)Syntax

extension-service {request-response {grpc {ssl{address ip-address;local-certificate local-certificate;port port;

}max-connections max-connections;}

}notification {port port;

}traceoptions {file <filename>;flag flag;flag flag;

}}

Hierarchy Level

[edit system services]

Release InformationStatement introduced in Junos OS Release 16.2 for MX80, MX104, MX240, MX480, MX960, MX2010,MX2020, vMX Series.

DescriptionEnable Junos OS extension services.

Required Privilege Levelsystem—To view this statement in the configuration.system-control—To add this statement to the configuration.

74

Page 71: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

extension-service (System Services)Syntax

extension-service {request-response {grpc {ssl{address ip-address;local-certificate local-certificate;port port;

}max-connections max-connections;

}}notification {port port;max-connections max-connections;allow-clients {address ip-address;

}}traceoptions {file <filename> <files number> <match regex> <size size> <world-readable | no-world-readable>;flag flag;no-remote-trace;

}}

Hierarchy Level

[edit system services]

Release InformationStatement introduced in Junos OS Release 16.1 for MX80, MX104, MX240, MX480, MX960, MX2010,MX2020, vMX Series.

DescriptionEnable Junos OS extension services.

75

Page 72: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

NOTE: The extension-service statement at the [edit systemextensions] hierarchy level is deprecatedfor Junos OS Evolved as of Release 19.1R1.

Required Privilege Levelsystem—To view this statement in the configuration.system-control—To add this statement to the configuration.

76

Page 73: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

file (JET)Syntax

file filename {arguments arguments;checksum (md5 | sha-256 | sha1) hash;daemonize;refresh;refresh-from;respawn-on-normal-exit;routing-instance;source;traceoptions {file <filename> <files number> <match regex> <size size> <world-readable | no-world-readable>;flag flag;no-remote-trace;

}username username;

}

Hierarchy Level

[edit system extensions extension-service application]

Release InformationStatement introduced in Junos OS Release 16.1 for MX80, MX104, MX240, MX480, MX960, MX2010,MX2020, vMX Series.refresh, refresh-from, routing-instance, and source options added in Junos OS Release 18.1R1 for MXSeries, PTX Series, and QFX Series.

DescriptionFor files in the [edit system extensions extension-service application] hierarchy level, specify theconfiguration for each file in the extension-service application.

Optionsarguments arguments—Specify the command-line arguments called by a JET application. A program can

take any number of command-line arguments. Enter the arguments in theway the application expects.Developer must supply this information.

daemonize—Specify the file as daemonized.

77

Page 74: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

An application runs as a daemonized process in the background. An application configured to run asa daemonized process triggers automatically upon commit. A non-daemonized application must betriggered manually from the command-line client.

filename—Local filename of the script file.

refresh—Refresh all operation scripts from their source

refresh-from—Refresh all operation scripts from a given base URL

respawn-on-normal-exit—In general, JET applications should not get respawned on a normal exit, but tosupport few special cases, you can set this configuration to enable the behavior of applications gettingrespawned on a normal exit.

source—URL source used for refresh for this script

username username—Specify the name of the user under whose privileges the extension service willexecute. This username is configured at the [edit system login] hierarchy level. If you do not associatea username with an extension-service application, the application is executed as user nobody.

Default: nobody

The remaining statement is explained separately. See CLI Explorer.

Required Privilege Levelmaintenance—To view this statement in the configuration.maintenance-control—To add this statement to the configuration.

78

Page 75: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

grpcSyntax

grpc {ssl {address ip-address;local-certificate local-certificate;port port;

}max-connections max-connections;

}

Hierarchy Level

[edit system services extension-service request-response]

Release InformationStatement introduced in Junos OS Release 16.2 for MX80, MX104, MX240, MX480, MX960, MX2010,MX2020, vMX Series.Statement introduced in Junos OS Release 17.2 for EX9200.

DescriptionConfigure the type of connections the gRPC service accepts for API applications.

Required Privilege Levelsystem—To view this statement in the configuration.system-control—To add this statement to the configuration.

79

Page 76: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

interface-notification (programmable-rpd)Syntax

interface-notification name;

Hierarchy Level

[edit logical-systems name routing-instances name routing-options programmable-rpd client id],[edit logical-systems name routing-options programmable-rpd client id],[edit routing-instances name routing-options programmable-rpd client id],[edit routing-options programmable-rpd client id]

Release InformationStatement introduced in Junos OS Release 17.4R1

DescriptionRestrict interface event notifications from the programmable routing protocol process (prpd) to specifiedJET clients and interfaces. The prpd provides public APIs to program routing systems, making it possiblefor users to directly access the APIs to customize, create and modify behavior of their network.

DefaultNo restrictions are imposed by default and JET clients are notified of all interfaces.

Optionsname—Interface name

Required Privilege Levelrouting

JSON File Format for JET Application Packaging

IN THIS SECTION

Main Section Attributes | 81

Source Attributes | 84

Dependent Libraries | 85

Dependent Python Modules | 85

80

Page 77: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to readand write, and also easy for machines to parse and generate. For more details, see https://www.json.org.

After application development is complete, write the JSON file describing the content to build and packagefor deployment on the device. JSON files consist of a collection of attributes. Attributes use two structures:

• A collection of key-value pairs

• An ordered list of values

These attributes are included inside a set of curly braces.

The following subtopics describe each of the attributes contained in the JSON format for applicationpackaging:

Main Section Attributes

IN THIS SECTION

Mandatory Attributes | 81

Optional Attributes | 83

The top block of the JSON file is themain section of the file. It consists of mandatory and optional attributes.

Mandatory Attributes

Table 4 on page 81 describes the mandatory attributes that all JSON files for application packaging musthave in the main section.

Table 4: Mandatory Attributes in the JSON File Main Section

Example ValuesDescriptionAttribute

"sample_pyapp"Specify the name of the application."app-name"

"python/sample_pyapp"Specify the path to the application’s implementation directory.All paths should be relative to sandbox src.

"app-path"

"python", "c", "c++"Specify the language used for developing the application."language"

81

Page 78: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Table 4: Mandatory Attributes in the JSON File Main Section (continued)

Example ValuesDescriptionAttribute

["foo.py", "bar.py"]This is a list attributes. Specify the filename or filenames ofthemain script or scripts that run on the device (do not specifythe module here). The main script files will be deployed underthe /var/db/scripts/jet path on the device.

"main-scripts"

"standalone" or "daemon"Specify whether an application is to be a standalone programor a daemon.

"app-type"

"yes" or "no"Indicate whether the application is to be signed or unsigned."sign"

"bsd6", bsd10, or "bsd11"Specify whether the application is to be deployed on legacyJunos OS (bsd6) or Junos OSwith upgraded FreeBSD (bsd10).

"os-type"

"i386", "powerpc", "octeon","xlr", or "arm"

Specify the target architecture on which the application is tobe deployed.

"target-arch"

"Simple Python test app"Write a brief (one-line) description about the application. Thiswill be displayed in the show version operational commandoutput.

"description"

The following is an example of a simple application JSON file containing only the mandatory attributes:

{

"app-name": "testcapp",

"app-path": "bin/test-c-app",

"language": "c",

"app-type": "standalone",

"sign": "yes",

"os-type": "bsd10",

"target-arch": "i386",

"description": "C Test Application",

"srcs": {

"bin/test-c-app": ["test_app.c"]

}

}

82

Page 79: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Optional Attributes

Table 5 on page 83 describes the optional attributes you can include in the main section of the JSON filefor application packaging.

Table 5: Optional Attributes in the JSON File Main Section

Example ValuesDescriptionAttribute

"flag1 flag2 flag3"Specify the list of C compiler flags, if any.Compilation flags can be defined for the mainsection, dependent libraries (dep-libs), ordependent Python modules (dep-py-modules).

"c-compiler-flags"

"flag1 flag2 flag3"Specify the list of C++ compiler flags, if any.Compilation flags can be defined for the mainsection, dependent libraries (dep-libs), ordependent Python modules (dep-py-modules).

"c++-compiler-flags"

"flag1 flag2 flag3"Specify the list of linker flags, if any. Use these flagsto specify additional libraries to link to or additionallink-specific flags that are required during linking,You can define linker-specific flags either in themain section or in the dep-py-modules section.

"linker-flags"

The following is an example main section with mandatory and optional attributes:

{

"app-name": "sample_pyapp",

"app-path": "python/sample_pyapp",

"language": "python",

"main-scripts": ["foo.py", "bar.py"],

"app-type": "standalone",

"sign": "no",

"os-type": "bsd6",

"target-arch": "i386",

"description": "Simple Python test app",

"c-compiler-flags": "-DFOO -DBAR",

"c++-compiler-flags": "-DAPP_CHECK –DSOMETHING_ON",

"linker-flags": "-lstdc++ -lfoo" }

83

Page 80: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Source Attributes

Table 6 on page 84 shows two source attributes you can use to specify source files for the applicationpackage.

Table 6: Source Attributes You Can Use in a JSON File

Example ValuesDescriptionAttribute

"srcs": {"python/sample_pyapp": ["a.py", "b.py"],"python/sample_pyapp/temp": ["temp1.py","temp2.py"]

}

Specify the list of additional source files. ForPython applications, these source files are theadditional module files. For C or C++ applications,these source files are the source files to becompiled to generate lib/binary. Each entryshould be a key-value pair, where the key is thepath of the source files and the value is an arrayof source filenames.

"srcs"

"extn-srcs": {This section is applicable only for Python. Specifythe list of C or C++ module files to be compiled.

"extn-srcs""python/sample_pyapp": ["foo.c", "bar.c"],

Each entry should be a key-value pair, where the "python/sample_pyapp/temp": ["1.cpp", "2.cpp"]key is the path of the source files and the valueis an array of source filenames.

}

The following is an example Python application with additional module files to be deployed, along withthe main script file:

{

"app-name": "sample_pyapp",

"app-path": "python/sample_pyapp",

"language": "python",

"main-scripts": ["foo.py", "bar.py"],

"app-type": "standalone",

"sign": "no",

"os-type": "bsd6",

"target-arch": "i386",

"description": "Simple Python test app",

"srcs": {

"python/sample_pyapp": ["a.py", "b.py"],

"python/sample_pyapp/temp": ["temp1.py", "temp2.py"]

},

"extn-srcs": {

84

Page 81: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

"python/sample_pyapp": ["foo.c", "bar.c"],

"python/sample_pyapp/temp": ["1.cpp", "2.cpp"]

}

}

Dependent Libraries

Youmust compile any dependent libraries available in the dependent libraries (dep-libs) section. The librarygenerated from this JSON code is packagedwith the application. The dep-libs section is an array of multiplelibrary dependencies, each composed of the following key-name pairs:

• "lib-name" is the name of the library.

• "lib-path" is the path of the library source code in the development sandbox.

• "srcs" is a key-value pair in which the path is the key and its value is a list of source files.

The following is an example of a dep-libs attribute:

"dep-libs": [

{

"lib-name": "xyz",

"lib-path": "lib/xyz",

"srcs": {

"lib/xyz": ["foo.c", "bar.c"]

}

}

]

Dependent Python Modules

The dependent Python modules (dep-py-modules) attribute is used only for Python applications. Thisattribute contains any dependent Python modules that need to be compiled and packaged with the

85

Page 82: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

application. The dep-py-modules attribute is an array in which you can specify multiple Python moduledependencies. Each dependency is composed of the following objects:

• "py-module-name" is the name of the Python module.

• "py-module-path" is the path of the Python module source code in the development sandbox.

• "srcs" is a key-value pair in which the path is the key and its value is a list of source files.

• "extn-srcs" is a key-value pair in which the path is the key and its value is a list of Python extensionsource files.

The following is an example of a dep-py-modules attribute:

"dep-py-modules": [

{

"py-module-name": "module_a",

"py-module-path": "python/module_a",

"srcs": {

"python/module_a": ["foo.py", "bar.py"]

},

"extn-srcs": {

"python/module_a": ["foo.c", "bar.c"],

"python/module_a/sub_mod": ["lmn.cpp"]

}

}

]

86

Page 83: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

language (Scripts)Syntax

language python;

Hierarchy Level

[edit system scripts]

Release InformationStatement introduced in Junos OS Release 16.1 on QFX Series switches and MX Series, PTX Series, andT Series routers.Statement introduced in Junos OS Release 17.1 on EX Series switches.Statement introduced in Junos OS Release 17.3 on SRX1500, SRX4100, SRX4200, SRX5400, SRX5600,and SRX5800 devices and vSRX instances.

DescriptionEnable unsigned Python scripts to be executed on a device running Junos OS.

Configuring the language python statement enables you to execute unsigned Python commit, event, op,and SNMP automation scripts as well as execute unsigned Python scripts developed using the JuniperExtension Toolkit (JET) on devices running Junos OS. To prevent the execution of unauthorized Pythoncode, either the root user or a user in the Junos OS super-user login class must own unsigned Pythonscripts, and only the file owner can have write permission for the file.

NOTE: Starting in Junos OS Release 16.1R3, either root or a user in the Junos OS super-user loginclass must own unsigned Python scripts, and only the file owner can have write permission for thefile. Prior to Junos OS Release 16.1R3, the root user must own unsigned Python scripts.

Python commit, event, op, and SNMP scripts must be configured under the hierarchy level appropriate tothe script type, and the filename must include the .py extension. To execute Python op scripts from aremote site, you must also configure the allow-url-for-python statement at the [edit system scripts op]hierarchy level.

DefaultIf you do not include the language python statement, you cannot execute unsigned Python scripts on thedevice.

Required Privilege Levelmaintenance—To view this statement in the configuration.

87

Page 84: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

maintenance-control—To add this statement to the configuration.

license-typeSyntax

license-type license deployment-scope [ deployments ];

Hierarchy Level

[edit system extensions providers provider-id]

Release InformationStatement introduced in Junos OS Release 10.2.Statement introduced in Junos OS Release 11.1 for the QFX Series.

DescriptionConfigure the license type and the scope of application deployment.

Optionslicense—Type of license. Obtain correct value from the application’s provider.

deployment—Scope of application deployment. You can configure a set of deployments. Obtain correctvalue from the application’s provider.

Required Privilege Leveladmin—To view this statement in the configuration.admin-control—To add this statement to the configuration.

88

Page 85: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

localSyntax

local certificate-name {certificate-key-string;load-key-file URL filename;

}

Hierarchy Level

[edit security certificates]

Release InformationStatement introduced before Junos OS Release 7.4.Statement introduced in Junos OS Release 9.0 for EX Series switches.Statement introduced in Junos OS Release 11.1 for the QFX Series.Statement introduced in Junos OS Release 14.1X53-D20 for the OCX Series.

DescriptionImport a paired X.509 private key and authentication certificate, to enable Junos XML protocol clientapplications to establish Secure Sockets Layer (SSL) connections to the router or switch.

NOTE: For FIPSmode, the digital security certificatesmust be compliant with the National Instituteof Standards and Technology (NIST) SP 800-131A standard.

Optionscertificate-key-string—String of alphanumeric characters that constitute the private key and certificate.

certificate-name—Name that uniquely identifies the certificate.

load-key-file URL filename—File that contains the private key and certificate. It can be one of two typesof values:

• Pathname of a file on the local disk (assuming you have already used another method to copy thecertificate file to the router’s or switch’s local disk)

• URL to the certificate file location (for instance, on the computer where the Junos XML protocolclient application runs)

Required Privilege Level

89

Page 86: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

system—To view this statement in the configuration.system-control—To add this statement to the configuration.

max-connectionsSyntax

max-connections max-connections;

Hierarchy Level

[edit system services extension-service request-response grpc]

Release InformationStatement introduced in Junos OS Release 16.1 for MX80, MX104, MX240, MX480, MX960, MX2010,MX2020, vMX Series.grpc option introduced in Junos OS Release 16.2 for MX80, MX104, MX240, MX480, MX960, MX2010,MX2020, vMX Series.

DescriptionNumber of simultaneous connections for request-response that can be attached to jsd. The higher thenumber, the higher the impact on clients performance.

Optionsmax-connections max-connections—Specify the maximum number of connections.

Range: 1 through 8Default: 8

The remaining statements are explained separately. See CLI Explorer.

Required Privilege Levelsystem—To view this statement in the configuration.system-control—To add this statement to the configuration.

90

Page 87: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

max-datasizeSyntax

max-datasize size;

Hierarchy Level

[edit event-options event-script],[edit system extension extension-service (System Extensions) application],[edit system scripts commit],[edit system scripts op],[edit system scripts snmp],[edit system scripts translation]

Release InformationStatement introduced in Junos OS Release 12.3.Statement introduced in Junos OS Release 13.2X51-D10 for QFX Series switches.Support at the [edit system extension extension-service application] hierarchy level introduced in JunosOS Release 16.1 for MX80, MX104, MX240, MX480, MX960, MX2010, MX2020, and vMX.Support at the [edit system scripts translation] hierarchy level introduced in Junos OS Release 16.1.

DescriptionMaximum amount of memory allocated for the data segment during execution of a script of the configuredtype. JunosOS sets themaximummemory limit for the executing script to the configured value irrespectiveof the total memory available on the system at the time of execution. If the executing script exceeds thespecified maximum memory limit for that script type, it exits gracefully.

NOTE: For op scripts, themax-datasize statement is only enforced for op scripts that are local tothe device. If you execute an op script from a remote location using the op url command, JunosOS uses the default memory allocation settings.

DefaultIf you do not include themax-datasize statement, the system allocates half of the total available memoryof the system up to a maximum value of 128 MB for the data segment portion of the executed script.

Optionssize—Maximum amount of memory allocated for the data segment during execution of a script of the given

type. If you do not specify a unit of measure, the default is bytes.

91

Page 88: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Syntax: size to specify bytes, sizek to specify KB, sizem to specify MB, or sizeg to specify GBRange:

• 32-bit Junos OS—23,068,672 bytes (22 MB) through 1,073,741,824 bytes (1 GB)

• 64-bit Junos OS—23,068,672 bytes (22 MB) through 1,073,741,824 bytes (1 GB) (SNMP scripts)

• 64-bit Junos OS—23,068,672 bytes (22 MB) through 3,221,225,472 bytes (3 GB) (commit, event,op, translation, and extension service scripts)

NOTE: The maximum memory for extension service scripts in 64-bit Junos OS images is3,221,225,472 bytes (3 GB) starting in Junos OS Releases 16.1R4, 16.2R2, and 17.1R1. Priorto these releases, the maximum is 1,073,741,824 bytes (1 GB).

Required Privilege Levelmaintenance—To view this statement in the configuration.maintenance-control—To add this statement to the configuration.

92

Page 89: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

notificationSyntax

notification {port port;max-connections max-connections;allow-clients {address ip-address;

}}

Hierarchy Level

[edit system services extension-service]

Release InformationStatement introduced in Junos OS Release 16.1 for MX80, MX104, MX240, MX480, MX960, MX2010,MX2020, vMX Series.

DescriptionEnable notification services for applications running on devices running Junos OS.

Optionsmax-connections max-connections—Specify the maximum number of connections.

Range: 1 through 8Default: 8

port port—Specify the number of the port to accept incoming connections.Range: 1 through 65535Default: 1883

The remaining statements are explained separately. See CLI Explorer.

Required Privilege Levelsystem—To view this statement in the configuration.system-control—To add this statement to the configuration.

93

Page 90: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

providersSyntax

providers {provider-id {license-type license deployment-scope [ deployments ];

}}

Hierarchy Level

[edit system extensions]

Release InformationStatement introduced in Junos OS Release 9.0.

DescriptionActivate the certificate of the provider of the application and enable the PIC for loading of the application.

Optionsprovider-id—Provider ID for the application package. The provider ID identifies the provider of the applicationto the system. The provider ID must be activated on the router to allow the application to be deployed onthe router and run.

The remaining statements are explained separately. See CLI Explorer.

Required Privilege Leveladmin—To view this statement in the configuration.admin-control—To add this statement to the configuration.

94

Page 91: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

purge-timeout (routing-options programmable-rpd)Syntax

purge-timeout {never;timeout <seconds>

}

Hierarchy Level

[edit routing-options programmable-rpd]

Release InformationStatement introduced in Junos OS Release 16.2.Support of purge-timeout value never introduced in Junos OS Release 18.4.

DescriptionSet the time, in seconds, after which a disconnected client times-out. Upon disconnect, the client stateremain available but no operations occur. If the disconnected client reconnects before the set time haselapsed, the states are restored on the router. If it does not, all client operations are reverted and theprogrammable routing protocol process (prpd) server notifies any other modules of the disconnect so theycan purge any other client operations.

When the purge-timeout is set to never, the prpd client added routes are not deleted when the clientdisconnects and does not reconnect back. The routes are deleted only when the client explicitly deletesthe routes. If routing is restarted, then the client added routes are lost.

The prpd provides public APIs to program routing systems, making it possible for users to directly accessthe APIs to customize, create and modify behavior of their network.

OptionsValues:

never—When this option is configured, purge timeout is infinite (that is, client added routes never timeout) for the BGP route service.

timeout seconds—(Optional) Set the time, in seconds, after which disconnected clients time-out on theprpd server and the routes added by the client is purged.

Range: 1 through 604,800

95

Page 92: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

NOTE: Starting in Junos OS Releases 18.4R1, the maximum purge-timeout value is 604,800 seconds(7 days). Prior to this release, the maximum value was 1000 seconds.

Default: 120

Required Privilege Levelrouting and trace—To view this statement in the configuration.routing-control and trace-control—To add this statement to the configuration.

96

Page 93: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

refresh (JET)Syntax

refresh;

Hierarchy Level

[edit system extensions extension-service application file filename]

Release InformationStatement introduced in Junos OS Release 18.1R1.

DescriptionOverwrite the local copy of all enabled commit scripts or a single enabled commit script with the copylocated at the source URL, as specified in the source statement at the same hierarchy level. If theload-scripts-from-flash statement is configured, the device refreshes the scripts on the flash drive insteadof the hard disk.

The update operation occurs as soon as you issue the set refresh configuration mode command. Issuingthe set refresh command does not add the refresh statement to the configuration. Thus the commandbehaves like an operational mode command by executing an operation, instead of adding a statement tothe configuration.

NOTE: On the QFabric system, commit scripts are stored in the/pbdata/mgd_shared/partition-ip/var/db/scripts/commit/ directory on the Director device.

As of Junos OS Release 18.1R1, you can specify which routing instance the update is done through. Tospecify the routing instance to use for updating commit scripts, configure the routing instance in two placesin the CLI:

user@host# set system routing-instances routing-instance-name description descriptionuser@host# set system extensions extension-service application file filename routing-instance

routing-instance-name

If you enable the non-default managment instance and use mgmt_junos for routing-instance-name, youcan configure scripts to update using the dedicated management instance mgmt_junos.

Required Privilege Levelmaintenance—To view this statement in the configuration.

97

Page 94: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

maintenance-control—To add this statement to the configuration.

98

Page 95: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

refresh-from (JET)Syntax

refresh-from url;

Hierarchy Level

[edit system extensions extension-service application file filename]

Release InformationStatement introduced in Junos OS Release 18.1R1.

DescriptionOverwrite the local copy of all enabled commit scripts or a single enabled commit script with the copylocated at the specified URL. If the load-scripts-from-flash statement is configured, the device refreshesthe scripts on the flash drive instead of the hard disk.

The update operation occurs as soon as you issue the set refresh-from url configuration mode command.Issuing the set refresh-from command does not add the refresh-from statement to the configuration. Thusthe command behaves like an operational mode command by executing an operation, instead of adding astatement to the configuration.

NOTE: This statement is not supported on the QFabric system.

As of Junos OS Release 18.1R1, you can specify which routing instance the update is done through. Tospecify the routing instance to use for updating op scripts, configure the routing instance in two places inthe CLI:

user@host# set system routing-instances routing-instance-name description descriptionuser@host# set system extensions extension-service application file filename routing-instance

routing-instance-name

If you enable the non-default managment instance and use mgmt_junos for routing-instance-name, youcan configure scripts to update using the dedicated management instance mgmt_junos.

Optionsurl—The source specified as a Hypertext Transfer Protocol (HTTP) URL, FTPURL, or secure copy (scp)-style

remote file specification.

99

Page 96: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Required Privilege Levelmaintenance—To view this statement in the configuration.maintenance-control—To add this statement to the configuration.

100

Page 97: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

request-responseSyntax

request-response {grpc {max-connections max-connections;ssl {address ip-address;local-certificate local-certificate-informationport port;

}}

}

Hierarchy Level

[edit system services extension-service]

Release InformationStatement introduced in Junos OS Release 16.1 for MX80, MX104, MX240, MX480, MX960, MX2010,MX2020, vMX Series.grpc option introduced in Junos OS Release 16.2 for MX80, MX104, MX240, MX480, MX960, MX2010,MX2020, vMX Series.

DescriptionAllow request-response API execution.

Statements are explained separately.

Required Privilege Levelsystem—To view this statement in the configuration.system-control—To add this statement to the configuration.

101

Page 98: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

routing-instance (JET Scripts)Syntax

routing-instance routing-instance-name;

Hierarchy Level

[edit system extensions extension-service application file filename]

Release InformationStatement introduced in Junos OS Release 18.1R1.

DescriptionConfigure the routing instance you want to use to update Automation scripts. To use a managementinstance, configure themanagement-instance statement along with the routing-instance statement, thusenabling JET scripts to use the non-default management routing instance mgmt_junos when refreshingthe scripts.

Optionsrouting-instance-name—Name of the routing instance. For the management instance, use mgmt_junos.

Otherwise, you can specify any routing instance name.

NOTE: You must also define the routing instance under the [edit routing-instances] hierarchylevel.

Required Privilege Levelsystem—To view this statement in the configuration.system-control—To add this statement to the configuration.

102

Page 99: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

services (System Services)Syntax

services {dhcp { # DHCP is not supported on a DCFdhcp_services;

}dtcp-onlyflow-tap-dtcp {ssh {connection-limit limit;rate-limit limit;

}}extension-service {request-response{grpc {ssl{address ip-address;local-certificate local-certificate;port port;

}max-connections max-connections;

}}notification {port port;max-connections max-connections;allow-clients {address ip-address;

}}traceoptions {file <filename> <files number> <match regex> <size size> <world-readable | no-world-readable>;flag flag;no-remote-trace;

}}finger {connection-limit limit;rate-limit limit;

}ftp {

103

Page 100: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

authentication-order [authentication-methods];connection-limit limit;rate-limit limit;

}service-deployment {servers address {port-number port-number;

}source-address address;

}ssh {authentication-order [authentication-methods];ciphers [ cipher-1 cipher-2 cipher-3 ...];client-alive-count-max seconds;client-alive-interval seconds;connection-limit limit;fingerprint-hash (md5 | sha2-256);hostkey-algorithm (algorithm | no-algorithm);key-exchange [algorithm];macs [algorithm];max-sessions-per-connection <number>;no-passwords;no-public-keys;no-tcp-forwarding;protocol-version [v1 v2];rate-limit limit;root-login (allow | deny | deny-password);

}

104

Page 101: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

resource-monitor {free-fw-memory-watermark number;free-heap-memory-watermark number;free-nh-memory-watermark number;high-threshold number;no-logging;no-throttle;resource-category jtree {resource-type (continguous-pages | free-dwords | free-pages) {low-watermark number;high-watermark number;

}}subscribers-limit {client-type (any | dhcp | l2tp | pppoe) {chassis {limit limit;

}fpc slot-number {limit limit;pic number {limit limit;port number {limit limit;

}}

}}

}traceoptions {file filename <files number> <match regular-expression> <size maximum-file-size> <world-readable |no-world-readable>;

flag flag;no-remote-trace;

}}

105

Page 102: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

subscriber-management {enable;enforce-strict-scale-limit-license;gres-route-flush-delay;}overrides {interfaces {family (inet | inet6) {layer2-liveness-detection;

}}no-unsolicited-ra;ra-initial-interval-max seconds;ra-initial-interval-min seconds;shmlog {disable;file filename <files maximum-no-files> <size maximum-file-size>;filtering enable;log-name {all;logname {<brief | detail | extensive | none | terse>;<file-logging |no-file-logging>;

}}

log-type (debug | info | notice);|

}traceoptions {file filename <files number> <match regular-expression > <size maximum-file-size> <world-readable |no-world-readable>;

flag flag;}

}telnet {authentication-order [authentication-methods];connection-limit limit;rate-limit limit;

}

106

Page 103: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

web-management {http {interfaces [ names ];port port;

}https {interfaces [ names ];local-certificate name;port port;

}session {idle-timeout [ minutes ];session-limit [ limit ];

}}xnm-ssl {connection-limit limit;local-certificate name;rate-limit limit;ssl-renegotiation;

}}

Hierarchy Level

[edit system]

Release InformationStatement introduced before Junos OS Release 7.4.Statement introduced in Junos OS Release 9.0 for EX Series switches.extension-service option added in Junos OS Release 16.1 for MX80, MX104, MX240, MX480, MX960,MX2010, MX2020, vMX Series.grpc option added in Junos OS Release 16.2 for MX80, MX104, MX240, MX480, MX960, MX2010,MX2020, vMX Series.

107

Page 104: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

DescriptionConfigure the router or switch so that users on remote systems can access the local router or switchthrough the DHCP server, DTCP over SSH, finger, rlogin, SSH, telnet, Web management, Junos XMLprotocol SSL, and network utilities, or enable Junos OS to work with the Session and Resource Control(SRC) software. Also, enable configuration of third-party applications developed using the Juniper ExtensionToolkit (JET) to run on Junos OS.

The remaining statements are explained separately. Search for a statement in CLI Explorer or click a linkedstatement in the Syntax section for details.

Required Privilege Levelsystem—To view this statement in the configuration.system-control—To add this statement to the configuration.

108

Page 105: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

source (JET Scripts)Syntax

source url;

Hierarchy Level

[edit system extensions extension-service application file filename]

Release InformationStatement introduced in Junos OS Release 18.1R1.

DescriptionSpecify the location of themaster source file for a JET script.When you issue the set refresh configurationmode command at the same hierarchy level, the local copy of the script is overwritten by the version storedat the specified URL. If the load-scripts-from-flash statement is configured, the device refreshes the scriptson the flash drive instead of the hard disk.

NOTE: JET scripts are stored in the /var/db/scripts/jet directory.

Optionsurl—Master source file for a JET script specified as an HTTP URL, FTP URL, or scp-style remote file

specification.

Required Privilege Levelmaintenance—To view this statement in the configuration.maintenance-control—To add this statement to the configuration.

109

Page 106: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

sslSyntax

ssl {address ip-address;local-certificate local-certificatemutual-authentication {client-certificate-request {no-certificate;request-certificate;request-certificate-and-verify;require-certificate;require-certificate-and-verfiy;

}}certificate-authority certificate-authority-profile-name;port port;

}

Hierarchy Level

[edit system services extension-service request-response grpc]

Release InformationStatement introduced in Junos OS Release 16.1 for MX80, MX104, MX240, MX480, MX960, MX2010,MX2020, vMX Series.mutual-authentication, client-certificate-request, and certificate-authority options introduced in JunosOS Release 17.4R1.

DescriptionConfigure API connection settings based on Secure Sockets Layer (SSL) technology.

Optionsaddress ip-address—Specify the IP address to listen for incoming connections. If you use the default IP

address 0.0.0.0, the JET service process (jsd) listens on the IP address in the default routing instance.

Default: 0.0.0.0

mutual-authentication—Enable bidirectional authentication. Use this option, in conjunction withclient-certificate-request and certificate-authority profile-name to configure client authenticationusing SSL-based certificates.

client-certificate-request—Specify the requirements for a client certificate.

110

Page 107: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

no-certificate—Client certificate is not requested.

NOTE: We strongly recommend that you use this option in a test environment only.

request-certificate—Request certificate from client but do not verify.

request-certificate-and-verify—Request certificate from client and verify if provided.

require-certificate—Client certificate is mandatory, but do not verify.

require-certificate-and-verfiy—Client certificate is mandatory, and certificate is verified.Default: no-certificate

NOTE: You can specify only one value for a client certificate.

certificate-authority profile-name—Specify the name of a certificate-authorirty profile configured at the[edit security pki ca-profile] hierarchy level. This profile is used to validate the certificate provided bythe client.

port port—Specify the port number to accept incoming connections.

NOTE: For gRPC connections used to stream telemetry data, the required port number is51051.

Range: 1 through 65535Default: 9090

The remaining statement is explained separately. See CLI Explorer.

Required Privilege Levelsystem—To view this statement in the configuration.system-control—To add this statement to the configuration.

111

Page 108: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

topSyntax

top <configuration-command>

Release InformationCommand introduced before Junos OS Release 7.4.

DescriptionReturn to the top level of configuration command mode, which is indicated by the [edit] banner.

Optionsconfiguration-command—(Optional) Issue configuration mode commands from the top of the hierarchy.

Required Privilege Levelconfigure—To enter configuration mode.

112

Page 109: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

traceoptions (Extensions)Syntax

traceoptions {file <filename> <files number> <match regex> <size size> <world-readable | no-world-readable>;flag flag;no-remote-trace;

}

Hierarchy Level

[edit system extensions extension-service application],[edit system extensions extension-service application file script-name]

Release InformationStatement introduced in Junos OS Release 16.1 for MX80, MX104, MX240, MX480, MX960, MX2010,MX2020, vMX Series.Statement introduced in Junos OS Release 19.1R1 for the [edit system extensions extension-serviceapplication file script-name hierarchy level.

DescriptionTrace options for extension-service applications. You can set the traceoptions statement for the applicationlevel or for the file script-name level or for both. If the traceoptions statement is set for both the applicationand file script-name levels, the latter will have a higher priority.

NOTE: Global traceoptions for daemonized applications do not take effect if the daemonizedapplication and global traceoptions are committed separately

Optionsfile—Indicate trace file information.

filename—Name of the file to receive the tracing operation output. Enclose the name in quotationmarks. Traceoption output files are located in the /var/log/ directory.

files number—(Optional) Specify maximum number of trace files.Range: 2 through 1000Default: 3

113

Page 110: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

size size—(Optional) Specify the maximum size of each trace file. When a trace file named trace-filereaches its maximum size, it is renamed trace-file.0. The traceoption output continues in a secondtrace file named trace-file.1. When trace-file.1 reaches its maximum size, output continues in athird file named trace-file.2, and so on. When the maximum number of trace files is reached, theoldest trace file is overwritten.

Range: 10240 through 1073741824Default: 128k

world-readable | no-world-readable—(Optional). Grant all users permission to read log files, or restrictthe permission only to the root user and users who have Junos OS maintenance permission.

flag flag—Specify the tracing operation to perform. To specify more than one tracing operation, includemultiple flag statements:

all—Trace all operations.

config—Trace important events.

general—Trace script input data.

grpc—Trace grpc server events.

notification—Trace notification events.

routing-socket—Trace routing socket calls.

timeouts—Trace timeouts.

timer—Trace internal timer events.

no-remote-trace—Disable remote tracing. This option is valid only when [system tracing] is configured.

Required Privilege Leveltrace—To view this statement in the configuration.trace-control—To add this statement to the configuration.

114

Page 111: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

traceoptions (Services)Syntax

traceoptions {file <filename> <files number> <match regex> <size size> <world-readable | no-world-readable>;flag flag;no-remote-trace;

}

Hierarchy Level

[edit system services ]

Release InformationStatement introduced in Junos OS Release 16.1 for MX80, MX104, MX240, MX480, MX960, MX2010,MX2020, vMX Series.Trace flag options libgrpc-debug, libgrpc-errors, and libgrpc-info introduced in Junos OS Release 19.3R1.

DescriptionDefine tracing operations for the JET service process (jsd).

The libgrpc traceoptions allow you to see events from the grpc libraries in the jsd trace log. Within thegrpc core there are multiple libraries (for example, iomgr, compression, profiling, and so on).

Optionsfile—Indicate trace file information.

filename—Name of the file to receive the tracing operation output. Enclose the name in quotationmarks. Traceoption output files are located in the /var/log/ directory.

files number—(Optional) Specify the maximum number of trace files.Range: 2 through 1000Default: 10

match regex—Specify the regular expression for lines to be logged.

size size—(Optional) Specify the maximum size of each trace file. When a trace file named trace-filereaches its maximum size, it is renamed trace-file.0. The traceoption output continues in a secondtrace file named trace-file.1. When trace-file.1 reaches its maximum size, output continues in athird file named trace-file.2, and so on. When the maximum number of trace files is reached, theoldest trace file is overwritten.

Range: 10,240 through 1,073,741,824 bytes

115

Page 112: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Default: 1000k

world-readable | no-world-readable—(Optional). Grant all users permission to read log files, or restrictthe permission only to the root user and users who have Junos OS maintenance permission.

flag flag—Specify the tracing operation to perform. To specify more than one tracing operation, includemultiple flag statements:

• all—Trace everything.

• config—Trace configuration events.

• general—Trace general events.

• grpc—Trace grpc server events.

• libgrpc-debug—Trace all lib grpc-related events.

• libgrpc-errors—Trace lib grpc errors.

• libgrpc-info—Trace lib grpc info and errors.

• notification—Trace notification events.

• routing-socket—Trace routing socket calls

• timeouts—Trace timeouts.

• timer—Trace internal timer events.

no-remote-trace—Disable remote tracing.

Required Privilege Leveltrace—To view this statement in the configuration.trace-control—To add this statement to the configuration.

116

Page 113: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

traceoptions (routing-options programmable-rpd)Syntax

traceoptions {file filename <files number> <size size> <world-readable | no-world-readable>;flag flag <disable>;

}

Hierarchy Level

[edit routing-options programmable-rpd]flag <flags>file <filename> <size>

Release InformationStatement introduced in Junos OS Release 16.2 for MX Series.

DescriptionStarts logging traces related to the programmable routing protocol process (prpd). The prpd provides publicAPIs to program routing systems, making it possible for users to directly access the APIs to customize,create and modify behavior of their network.

Use the traceoptions command, alongwith related show commands, to help debug client-server interactions,identify the flow of control, and detect errors, get client-level information and statistics.

You can filter traces according to the flag(s) you have enabled.

DefaultIf you do not include this statement, no tracing operations are performed.

OptionsValues:

file filename—Name of the file to receive the output of the tracing operation. Enclose the name withinquotation marks. All files are placed in the directory /var/log.

files number—(Optional) Maximum number of trace files. When a trace file named trace-file reaches itsmaximum size, it is renamed trace-file.0, then trace-file.1, and so on, until the maximum number of tracefiles is reached. Then, the oldest trace file is overwritten. Note that if you specify a maximum number offiles, you also must specify a maximum file size with the size option.

Range: 2 through 1000 filesDefault: 10 files

117

Page 114: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

no-world-readable—(Optional) Prevent any user from reading the log file.

size size—(Optional) Maximum size of each trace file, in kilobytes (KB), megabytes (MB), or gigabytes (GB).When a trace file named trace-file reaches this size, it is renamed trace-file.0. When the trace-file againreaches its maximum size, trace-file.0 is renamed trace-file.1 and trace-file is renamed trace-file.0. Thisrenaming scheme continues until the maximum number of trace files is reached. Then, the oldest trace fileis overwritten. Note that if you specify a maximum file size, you also must specify a maximum number oftrace files with the files option.

Syntax: xk to specify KB, xm to specify MB, or xg to specify GBRange: 1024 to 4,294,967,295 bytesDefault: 128 KB

world-readable—(Optional) Allow any user to read the log file.

flag flag—Specifies the tracing operation to perform. To specify more than one tracing operation, includemultiple flag statements. The options are explained here:

• all—All tracing operations

• client—Client events

• general—All normal operations and routing table changes (a combination of the normal and route traceoperations)

• normal—All normal operations

• policy—Routing policy operations and actions

• route—Routing table changes

• state—State transitions

• task—Interface transactions and processing

• timer—Timer usage

Required Privilege Levelrouting and trace—To view this statement in the configuration.routing-control and trace-control—To add this statement to the configuration.

118

Page 115: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

usernameSyntax

username username;

Hierarchy Level

[edit system login]

Release InformationStatement introduced in Junos OS Release 16.1 for MX80, MX104, MX240, MX480, MX960, MX2010,MX2020, vMX Series.

DescriptionSpecify the name of the user under whose privileges the extension service will execute. If you do notassociate a username with an extension-service application, the application is executed as user nobody.

Default: nobody

Required Privilege Levelmaintenance—To view this statement in the configuration.maintenance-control—To add this statement to the configuration.

119

Page 116: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

7CHAPTER

Operational Commands

request extension-service (start | stop) | 123

show extension-service status | 124

show programmable-rpd clients | 127

show route | 128

show route detail | 157

Page 117: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48
Page 118: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

request extension-service (start | stop)Syntax

request extension-service (start | stop) application-name<invoke-debugger cli>

Release InformationCommand introduced in Junos OS Release 16.1 for MX80, MX104, MX240, MX480, MX960, MX2010,MX2020, vMX Series.

DescriptionStart or stop a JET application running on a device running Junos OS.

NOTE: You do not need this command in Junos OS Evolved. Run JET applications directly using aPython interpreter instead of configuring and invoking them in the CLI.

Optionsapplication-name—Name of application to be started or stopped.

invoke-debugger cli—(Optional) Starts the extension service process in debugger mode.

Required Privilege Levelmaintenance

Output FieldsWhen you enter this command, feedback is provided on the status of your request.

Sample Output

user@device> request extension-service start cmdline_args.py

Extension-service application 'cmdline_args.py' started with pid: 99418

123

Page 119: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

show extension-service statusSyntax

show extension-service status (application-name | all)

Release InformationCommand introduced in Junos OS Release 16.1 for MX80, MX104, MX240, MX480, MX960, MX2010,MX2020, vMX Series.

DescriptionDisplay the status of all JET applications.

NOTE: The show extension-service status operational command is limited to use with Pythonapplications only.

Optionsapplication-name—Display information for a single application.

all—Display information for all JET applications running on the system.

Required Privilege Levelview

List of Sample Outputshow extension-service status on page 125show extension-service status all on page 125show extension-service status all (when no applications are active) on page 125

Output FieldsTable 7 on page 124 lists the output fields for the show extension-service status command.

Table 7: show extension-service status Output Fields

Field DescriptionField Name

Name of the application.Name

Arguments passed to the application.Arguments

Process ID.Process-id

124

Page 120: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Table 7: show extension-service status Output Fields (continued)

Field DescriptionField Name

Size of the stack segment memory.Stack-Segment-Size

Size of the data segment memory.Data-Segment-Size

Sample Output

show extension-service status

user@host> show extension-service status application-one

Extension service application details:

Name : application-one

Arguments: -arg1 foo -arg2 goo

Process-id: 52592

Stack-Segment-Size: 16777216B

Data-Segment-Size: 134217728B

show extension-service status all

user@host> show extension-service status all

Extension service application details:

Name : application-name1

Arguments: -arg1 foo -arg2 goo

Process-id: 54834

Stack-Segment-Size: 16777216B

Data-Segment-Size: 134217728B

Name : application-name2

Arguments: -arg1 foo -arg2 goo

Process-id: 55011

Stack-Segment-Size: 16777216B

Data-Segment-Size: 134217728B

show extension-service status all (when no applications are active)

user@host> show extension-service status all

125

Page 121: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

warning: No active extension-services

126

Page 122: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

show programmable-rpd clientsSyntax

show programmable-rpd clients

Release InformationCommand introduced in Junos OS Release 16.2 for MX80, MX104, MX240, MX480, MX960, MX2010,MX2020, vMX Series.

DescriptionLists clients connected to the programmable routing protocol process (prpd) server. The prpd providespublic APIs to program routing systems, making it possible for users to directly access the APIs to customize,create and modify behavior of their network.

Output provided with the command includes client specific details and statistics such as client ID, protocoland corresponding gateway handle , purge timer, the client up/down status, and if the client is disconnected,the time remaining before the client state is purged (if the client has not registered any protocol, thegateway handle is 0).

Required Privilege Levelview

List of Sample Outputshow programmable-rpd clients on page 127

Sample Output

show programmable-rpd clients

user@host> show programmable-rpd clients

RPD global purge timeout: 120

RPD Server connected client details:

ClientIdentifier PurgeTimer Status Timeout Protocol Gateway

3 150 Up BGP-Static 578

2 75 Up NoGwProtocol 0

1 120 Down 117 BGP-Static 577

127

Page 123: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

show routeList of SyntaxSyntax on page 128Syntax (EX Series Switches) on page 128

Syntax

show route<all><destination-prefix><logical-system (all | logical-system-name)><private><te-ipv4-prefix-ip te-ipv4-prefix-ip><te-ipv4-prefix-node-ip te-ipv4-prefix-node-ip><te-ipv4-prefix-node-iso te-ipv4-prefix-node-iso>

Syntax (EX Series Switches)

show route<all><destination-prefix><private>

Release InformationCommand introduced before Junos OS Release 7.4.Command introduced in Junos OS Release 9.0 for EX Series switches.Option private introduced in Junos OS Release 9.5.Option private introduced in Junos OS Release 9.5 for EX Series switches.Command introduced in Junos OS Release 15.1R3 on MX Series routers for enhanced subscribermanagement.Option display-client-data introduced in Junos OS Release 16.2R1 on MX80, MX104, MX240, MX480,MX960, MX2010, MX2020, vMX Series routers.Options te-ipv4-prefix-ip, te-ipv4-prefix-node-ip, and te-ipv4-prefix-node-iso introduced in Junos OSRelease 17.2R1 on MX Series and PTX Series.

DescriptionDisplay the active entries in the routing tables.

Optionsnone—Display brief information about all active entries in the routing tables.

all—(Optional) Display information about all routing tables, including private, or internal, routing tables.

128

Page 124: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

destination-prefix—(Optional) Display active entries for the specified address or range of addresses.

logical-system (all | logical-system-name)—(Optional) Perform this operation on all logical systems or on aparticular logical system.

private—(Optional) Display information only about all private, or internal, routing tables.

display-client-data—(Optional) Display client id and cookie information for routes installed by the routingprotocol process client applications.

te-ipv4-prefix-ip te-ipv4-prefix-ip—(Optional) Display IPv4 address of the traffic-engineering prefix, withoutthe mask length if present in the routing table.

te-ipv4-prefix-node-ip te-ipv4-prefix-node-ip—(Optional) Display all prefixes that have originated from thetraffic-engineering node. You can filter IPv4 node addresses from the traffic-engineered routes in thelsdist.0 table.

te-ipv4-prefix-node-iso te-ipv4-prefix-node-iso—(Optional) Display all prefixes that have originated fromthe traffic-engineering node. You can filter IPv4 routes with the specified ISO circuit ID from thelsdist.0 table.

Required Privilege Levelview

List of Sample Outputshow route on page 133show route (VPN) on page 134show route (with Destination Prefix) on page 134show route destination-prefix detail on page 135show route extensive on page 135show route extensive ( ECMP) on page 136show route extensive (Multipath Resolution) on page 136show route (Enhanced Subscriber Management) on page 142show route (IPv6 Flow Specification) on page 143show route display-client-data detail on page 143show route te-ipv4-prefix-ip on page 144show route te-ipv4-prefix-ip extensive on page 145show route te-ipv4-prefix-node-iso on page 148show route te-ipv4-prefix-node-iso extensive on page 149show route te-ipv4-prefix-node-iso detail on page 153

Output FieldsTable 8 on page 130 describes the output fields for the show route command. Output fields are listed inthe approximate order in which they appear.

129

Page 125: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Table 8: show route Output Fields

Field DescriptionField Name

Name of the routing table (for example, inet.0).routing-table-name

Number of destinations for which there are routes in the routing table.number destinations

Number of routes in the routing table and total number of routes in the following states:

• active (routes that are active).

• holddown (routes that are in the pending state before being declared inactive). A holddownroute was once the active route and is no longer the active route. The route is in theholddown state because a protocol still has interest in the route, meaning that the interestbit is set. A protocol might have its interest bit set on the previously active route becausethe protocol is still advertising the route. The routewill be deleted after all protocols withdrawtheir advertisement of the route and remove their interest bit. A persistent holddown stateoften means that the interested protocol is not releasing its interest bit properly.

However, if you have configured advertisement of multiple routes (with the add-path oradvertise-inactive statement), the holddown bit is most likely set because BGP is advertisingthe route as an active route. In this case, you can ignore the holddown state because nothingis wrong.

• hidden (routes that are not used because of a routing policy).

number routes

Route destination (for example:10.0.0.1/24). Sometimes the route information is presentedin another format, such as:

• MPLS-label (for example, 80001).

• interface-name (for example, ge-1/0/2).

• neighbor-address:control-word-status:encapsulation type:vc-id :source (Layer 2 circuit only.For example, 10.1.1.195:NoCtrlWord:1:1:Local/96):

• neighbor-address—Address of the neighbor.

• control-word-status—Whether the use of the control word has been negotiated for thisvirtual circuit: NoCtrlWord or CtrlWord.

• encapsulation type—Type of encapsulation, represented by a number: (1) Frame RelayDLCI, (2) ATM AAL5 VCC transport, (3) ATM transparent cell transport, (4) Ethernet, (5)VLAN Ethernet, (6) HDLC, (7) PPP, (8) ATM VCC cell transport, (10) ATM VPC celltransport.

• vc-id—Virtual circuit identifier.

• source—Source of the advertisement: Local or Remote.

destination-prefix

130

Page 126: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Table 8: show route Output Fields (continued)

Field DescriptionField Name

Protocol from which the route was learned and the preference value for the route.

• +—A plus sign indicates the active route, which is the route installed from the routing tableinto the forwarding table.

• - —A hyphen indicates the last active route.

• *—An asterisk indicates that the route is both the active and the last active route. An asteriskbefore a to line indicates the best subpath to the route.

In every routing metric except for the BGP LocalPref attribute, a lesser value is preferred. Inorder to use common comparison routines, JunosOS stores the 1's complement of the LocalPrefvalue in the Preference2 field. For example, if the LocalPref value for Route 1 is 100, thePreference2 value is -101. If the LocalPref value for Route 2 is 155, the Preference2 value is-156. Route 2 is preferred because it has a higher LocalPref value and a lower Preference2value.

[ protocol, preference]

How long the route been known (for example, 2w4d 13:11:14, or 2 weeks, 4 days, 13 hours,11 minutes, and 14 seconds).

weeks:dayshours:minutes:seconds

Cost value of the indicated route. For routes within an AS, the cost is determined by the IGPand the individual protocol metrics. For external routes, destinations, or routing domains, thecost is determined by a preference value.

metric

Local preference value included in the route.localpref

Interface from which the route was received.from

131

Page 127: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Table 8: show route Output Fields (continued)

Field DescriptionField Name

AS path through which the route was learned. The letters at the end of the AS path indicatethe path origin, providing an indication of the state of the route at the point at which the ASpath originated:

• I—IGP.

• E—EGP.

• ?—Incomplete; typically, the AS path was aggregated.

When AS path numbers are included in the route, the format is as follows:

• [ ]—Brackets enclose the local AS number associated with the AS path if more than one ASnumber is configured on the routing device, or if AS path prepending is configured.

• { }—Braces enclose AS sets, which are groups of AS numbers in which the order does notmatter. A set commonly results from route aggregation. The numbers in each AS set aredisplayed in ascending order.

• ( )—Parentheses enclose a confederation.

• ( [ ] )—Parentheses and brackets enclose a confederation set.

NOTE: In JunosOS Release 10.3 and later, the AS path field displays an unrecognized attributeand associated hexadecimal value if BGP receives attribute 128 (attribute set) and you havenot configured an independent domain in any routing instance.

AS path

Extended next-hop encoding capability enabled for the specified BGP community for routingIPv4 traffic over IPv6 tunnels. When BGP receives routes without the tunnel community,IPv4-0ver IPv6 tunnels are not created and BGP routes are resolved without encapsulation.

encapsulated

Stack of labels carried in the BGP route update.Route Labels

(BGP-learned routes) Validation status of the route:

• Invalid—Indicates that the prefix is found, but either the corresponding AS received fromthe EBGP peer is not the AS that appears in the database, or the prefix length in the BGPupdate message is longer than the maximum length permitted in the database.

• Unknown—Indicates that the prefix is not among the prefixes or prefix ranges in the database.

• Unverified—Indicates that the origin of the prefix is not verified against the database. Thisis because the database got populated and the validation is not called for in the BGP importpolicy, although origin validation is enabled, or the origin validation is not enabled for theBGP peers.

• Valid—Indicates that the prefix and autonomous system pair are found in the database.

validation-state

Next hop to the destination. An angle bracket (>) indicates that the route is the selected route.

If the destination is Discard, traffic is dropped.

to

132

Page 128: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Table 8: show route Output Fields (continued)

Field DescriptionField Name

Interface used to reach the next hop. If there is more than one interface available to the nexthop, the interface that is actually used is followed by the word Selected. This field can alsocontain the following information:

• Weight—Value used to distinguish primary, secondary, and fast reroute backup routes.Weight information is available when MPLS label-switched path (LSP) link protection,node-link protection, or fast reroute is enabled, or when the standby state is enabled forsecondary paths. A lower weight value is preferred. Among routes with the same weightvalue, load balancing is possible.

• Balance—Balance coefficient indicating how traffic of unequal cost is distributed amongnext hopswhen a routing device is performing unequal-cost load balancing. This informationis available when you enable BGP multipath load balancing.

• lsp-path-name—Name of the LSP used to reach the next hop.

• label-action—MPLS label and operation occurring at the next hop. The operation can be pop(where a label is removed from the top of the stack), push (where another label is added tothe label stack), or swap (where a label is replaced by another label). For VPNs, expect tosee multiple push operations, corresponding to the inner and outer labels required for VPNroutes (in the case of a direct PE-to-PE connection, the VPN route would have the innerlabel push only).

via

(Enhanced subscriber management for MX Series routers) Indicates that an access-internalroute is managed by enhanced subscriber management. By contrast, access-internal routesnot managed by enhanced subscriber management are displayed with associated next-hopand media access control (MAC) address information.

Private unicast

Distribution of the load based on the underlying operational interface bandwidth for equal-costmultipaths (ECMP) across the nexthop gateways in percentages.

balance

Sample Output

show route

user@host> show route

inet.0: 11 destinations, 12 routes (11 active, 0 holddown, 0 hidden)

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

1:65500:1:10.0.0.20/240

*[MVPN/70] 19:53:41, metric2 1

133

Page 129: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Indirect

1:65500:1:10.0.0.40/240

*[BGP/170] 19:53:29, localpref 100, from 10.0.0.30

AS path: I

> to 10.0.24.4 via lt-0/3/0.24, label-switched-path toD

[BGP/170] 19:53:26, localpref 100, from 10.0.0.33

AS path: I

> to 10.0.24.4 via lt-0/3/0.24, label-switched-path toD

1:65500:1:10.0.0.60/240

*[BGP/170] 19:53:29, localpref 100, from 10.0.0.30

AS path: I

> to 10.0.28.8 via lt-0/3/0.28, label-switched-path toF

[BGP/170] 19:53:25, localpref 100, from 10.0.0.33

AS path: I

> to 10.0.28.8 via lt-0/3/0.28, label-switched-path toF

show route (VPN)

The following sample output shows aVPN routewith composite next hops enabled. The firstPush operationcorresponds to the outer label. The second Push operation corresponds to the inner label.

user@host> show route 192.0.2.0

13979:665001.inet.0: 871 destinations, 3556 routes (871 active, 0 holddown, 0

hidden)

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

192.0.2.0/24 [BGP/170] 00:28:32, localpref 100, from 10.9.9.160

AS path: 13980 ?, validation-state: unverified

> to 10.100.0.42 via ae2.0, Push 16, Push 300368(top)

[BGP/170] 00:28:28, localpref 100, from 10.9.9.169

AS path: 13980 ?, validation-state: unverified

> to 10.100.0.42 via ae2.0, Push 126016, Push 300368(top)

#[Multipath/255] 00:28:28, metric2 102

> to 10.100.0.42 via ae2.0, Push 16, Push 300368(top)

to 10.100.0.42 via ae2.0, Push 16, Push 300368(top)

show route (with Destination Prefix)

user@host> show route 192.168.0.0/12

134

Page 130: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

inet.0: 10 destinations, 10 routes (9 active, 0 holddown, 1 hidden)

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

192.168.0.0/12 *[Static/5] 2w4d 12:54:27

> to 192.168.167.254 via fxp0.0

show route destination-prefix detail

user@host> show route 198.51.100.0 detail

inet.0: 15 destinations, 20 routes (15 active, 0 holddown, 0 hidden)

198.51.100.0/24 (2 entries, 2 announced)

*BGP Preference: 170/-101

...

BGP-Static Preference: 4294967292

Next hop type: Discard

Address: 0x9041ae4

Next-hop reference count: 2

State: <NoReadvrt Int Ext AlwaysFlash>

Inactive reason: Route Preference

Local AS: 200

Age: 4d 1:40:40

Validation State: unverified

Task: RT

Announcement bits (1): 2-BGP_RT_Background

AS path: 4 5 6 I

show route extensive

user@host> show route extensive

v1.mvpn.0: 5 destinations, 8 routes (5 active, 1 holddown, 0 hidden)

1:65500:1:10.0.0.40/240 (1 entry, 1 announced)

*BGP Preference: 170/-101

PMSI: Flags 0x0: Label[0:0:0]: PIM-SM: Sender 10.0.0.40 Group 203.0.113.1

Next hop type: Indirect

Address: 0x92455b8

Next-hop reference count: 2

Source: 10.0.0.30

Protocol next hop: 10.0.0.40

135

Page 131: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Indirect next hop: 2 no-forward

State: <Active Int Ext>

Local AS: 64510 Peer AS: 64511

Age: 3 Metric2: 1

Validation State: unverified

Task: BGP_64510.10.0.0.30+179

Announcement bits (2): 0-PIM.v1 1-mvpn global task

AS path: I (Originator) Cluster list: 10.0.0.30

AS path: Originator ID: 10.0.0.40

Communities: target:64502:100 encapsulation:0L:14 Import

Accepted

Localpref: 100

Router ID: 10.0.0.30

Primary Routing Table bgp.mvpn.0

Indirect next hops: 1

Protocol next hop: 10.0.0.40 Metric: 1

Indirect next hop: 2 no-forward

Indirect path forwarding next hops: 1

Next hop type: Router

Next hop: 10.0.24.4 via lt-0/3/0.24 weight 0x1

10.0.0.40/32 Originating RIB: inet.3

Metric: 1 Node path count: 1

Forwarding nexthops: 1

Nexthop: 10.0.24.4 via lt-0/3/0.24

show route extensive ( ECMP)

user@host> show route extensive

*IS-IS Preference: 15

Level: 1

Next hop type: Router, Next hop index: 1048577

Address: 0xXXXXXXXXXX

Next-hop reference count: YY

Next hop: 198.51.100.2 via ae1.0 balance 43%, selected

Session Id: 0x141

Next hop: 192.0.2.2 via ae0.0 balance 57%

show route extensive (Multipath Resolution)

user@host> show route extensive

136

Page 132: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

inet.0: 37 destinations, 37 routes (36 active, 0 holddown, 1 hidden)

10.1.1.2/32 (1 entry, 1 announced)

TSI:

KRT in-kernel 10.1.1.2/32 -> {indirect(1048574)}

*Static Preference: 5

Next hop type: Indirect, Next hop index: 0

Address: 0xb39d1b0

Next-hop reference count: 2

Next hop type: Router, Next hop index: 581

Next hop: 10.1.1.2 via ge-2/0/1.0, selected

Session Id: 0x144

Next hop: 10.2.1.2 via ge-2/0/2.0, selected

Session Id: 0x145

Protocol next hop: 10.1.1.1

Indirect next hop: 0xb2b20f0 1048574 INH Session ID: 0x143

State: <Active Int Ext>

Age: 2:53 Metric2: 0

Validation State: unverified

Task: RT

Announcement bits (2): 0-KRT 2-Resolve tree 1

AS path: I

Indirect next hops: 1

Protocol next hop: 10.1.1.1

Indirect next hop: 0xb2b20f0 1048574 INH Session ID: 0x143

Indirect path forwarding next hops: 2

Next hop type: Router

Next hop: 10.1.1.2 via ge-2/0/1.0

Session Id: 0x144

Next hop: 10.2.1.2 via ge-2/0/2.0

Session Id: 0x145

10.1.1.1/32 Originating RIB: inet.0

Node path count: 1

Node flags: 1

Forwarding nexthops: 2 (Merged)

Nexthop: 10.1.1.2 via ge-2/0/1.0

Nexthop: 10.2.1.2 via ge-2/0/2.0

user@host> show route active-path extensive

user@host> show route 198.51.100.1 active-path extensive

inet.0: 1000061 destinations, 1000082 routes (1000061 active, 0 holddown, 0 hidden)

198.51.100.1/32 (1 entry, 1 announced)

137

Page 133: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

TSI:

KRT in-kernel 198.51.100.1/32 -> {indirect(1051215)}

unicast reverse-path: 0

[ae0.0 ae1.0]

Page 0 idx 0, (group Internet-IPv4 type External) Type 1 val 0xbb2e53d8 (adv_entry)

Advertised metrics:

Nexthop: Self

AS path: [500] 410 I

Communities:

Path 198.51.100.1 from 10.0.0.11 Vector len 4. Val: 0

*BGP Preference: 170/-101

Next hop type: Indirect, Next hop index: 0

Address: 0x2e9aacdc

Next-hop reference count: 500000

Source: 10.0.0.11

Next hop type: Router, Next hop index: 0

Next hop: 10.0.12.2 via ae0.0 weight 0x1

Label operation: Push 3851, Push 25, Push 20(top)

Label TTL action: prop-ttl, prop-ttl, prop-ttl(top)

Load balance label: Label 3851: None; Label 25: None; Label 20: None;

Label element ptr: 0xb5dc1780

Label parent element ptr: 0x18d48080

Label element references: 2

Label element child references: 0

Label element lsp id: 0

Session Id: 0x0

Next hop: 10.0.12.2 via ae0.0 weight 0x1

Label operation: Push 3851, Push 25, Push 22(top)

Label TTL action: prop-ttl, prop-ttl, prop-ttl(top)

Load balance label: Label 3851: None; Label 25: None; Label 22: None;

Label element ptr: 0xb5dc1700

Label parent element ptr: 0x18d41000

Label element references: 2

Label element child references: 0

Label element lsp id: 0

Session Id: 0x0

Next hop: 10.0.12.2 via ae0.0 weight 0x1

Label operation: Push 3851, Push 24, Push 48(top)

Label TTL action: prop-ttl, prop-ttl, prop-ttl(top)

Load balance label: Label 3851: None; Label 24: None; Label 48: None;

Label element ptr: 0x18d40800

Label parent element ptr: 0x18d49780

Label element references: 3

Label element child references: 0

138

Page 134: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Label element lsp id: 0

Session Id: 0x0

Next hop: 10.0.12.2 via ae0.0 weight 0x1

Label operation: Push 3851, Push 24, Push 49(top)

Label TTL action: prop-ttl, prop-ttl, prop-ttl(top)

Load balance label: Label 3851: None; Label 24: None; Label 49: None;

Label element ptr: 0xb5dc1680

Label parent element ptr: 0x18d48f00

Label element references: 2

Label element child references: 0

Label element lsp id: 0

Session Id: 0x0

Next hop: 10.0.13.3 via ae1.0 weight 0x1

Label operation: Push 3851, Push 25, Push 21(top)

Label TTL action: prop-ttl, prop-ttl, prop-ttl(top)

Load balance label: Label 3851: None; Label 25: None; Label 21: None;

Label element ptr: 0xb5dc1600

Label parent element ptr: 0x18d44d80

Label element references: 2

Label element child references: 0

Label element lsp id: 0

Session Id: 0x0

Next hop: 10.0.13.3 via ae1.0 weight 0x1

Label operation: Push 3851, Push 25, Push 25(top)

Label TTL action: prop-ttl, prop-ttl, prop-ttl(top)

Load balance label: Label 3851: None; Label 25: None; Label 25: None;

Label element ptr: 0xb5dc1580

Label parent element ptr: 0x18d3da80

Label element references: 2

Label element child references: 0

Label element lsp id: 0

Session Id: 0x0

Next hop: 10.0.13.3 via ae1.0 weight 0x1, selected

Label operation: Push 3851, Push 24, Push 68(top)

Label TTL action: prop-ttl, prop-ttl, prop-ttl(top)

Load balance label: Label 3851: None; Label 24: None; Label 68: None;

Label element ptr: 0x18d41500

Label parent element ptr: 0x18d49000

Label element references: 3

Label element child references: 0

Label element lsp id: 0

Session Id: 0x0

Next hop: 10.0.13.3 via ae1.0 weight 0x1

Label operation: Push 3851, Push 24, Push 69(top)

139

Page 135: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Label TTL action: prop-ttl, prop-ttl, prop-ttl(top)

Load balance label: Label 3851: None; Label 24: None; Label 69: None;

Label element ptr: 0xb5dc1500

Label parent element ptr: 0x18d48300

Label element references: 2

Label element child references: 0

Label element lsp id: 0

Session Id: 0x0

Protocol next hop: 10.0.0.11

Label operation: Push 3851

Label TTL action: prop-ttl

Load balance label: Label 3851: None;

Indirect next hop: 0x1883e200 1051215 INH Session ID: 0xb0d

State:

Local AS: 500 Peer AS: 500

Age: 1:40:03 Metric2: 2

Validation State: unverified

Task: BGP_500.10.0.0.11

Announcement bits (5): 0-KRT 8-KRT 9-BGP_RT_Background 10-Resolve tree 5 11-Resolve

tree 8

AS path: 410 I

Accepted

Route Label: 3851

Localpref: 100

Router ID: 10.0.0.11

Indirect next hops: 1

Protocol next hop: 10.0.0.11 Metric: 2

Label operation: Push 3851

Label TTL action: prop-ttl

Load balance label: Label 3851: None;

Indirect next hop: 0x1883e200 1051215 INH Session ID: 0xb0d

Indirect path forwarding next hops (Merged): 8

Next hop type: Router

Next hop: 10.0.12.2 via ae0.0 weight 0x1

Session Id: 0x0

Next hop: 10.0.12.2 via ae0.0 weight 0x1

Session Id: 0x0

Next hop: 10.0.12.2 via ae0.0 weight 0x1

Session Id: 0x0

Next hop: 10.0.12.2 via ae0.0 weight 0x1

Session Id: 0x0

Next hop: 10.0.13.3 via ae1.0 weight 0x1

Session Id: 0x0

Next hop: 10.0.13.3 via ae1.0 weight 0x1

140

Page 136: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Session Id: 0x0

Next hop: 10.0.13.3 via ae1.0 weight 0x1

Session Id: 0x0

Next hop: 10.0.13.3 via ae1.0 weight 0x1

Session Id: 0x0

10.0.0.11/32 Originating RIB: inet.3

Metric: 1 Node path count: 4

Node flags: 1

Indirect nexthops: 4

Protocol Nexthop: 10.0.0.4 Metric: 1 Push 24

Indirect nexthop: 0x1880f200 1048597 INH Session ID: 0xb0c

Path forwarding nexthops link: 0x36120400

Path inh link: 0x0

Indirect path forwarding nexthops: 2

Nexthop: 10.0.12.2 via ae0.0

Session Id: 0

Nexthop: 10.0.13.3 via ae1.0

Session Id: 0

10.0.0.4/32 Originating RIB: inet.3

Metric: 1 Node path count: 1

Forwarding nexthops: 2

Nexthop: 10.0.12.2 via ae0.0

Session Id: 0

Nexthop: 10.0.13.3 via ae1.0

Session Id: 0

Protocol Nexthop: 10.0.0.5 Metric: 1 Push 24

Indirect nexthop: 0x18810000 1048596 INH Session ID: 0xb0b

Path forwarding nexthops link: 0x1545be00

Path inh link: 0x0

Indirect path forwarding nexthops: 2

Nexthop: 10.0.12.2 via ae0.0

Session Id: 0

Nexthop: 10.0.13.3 via ae1.0

Session Id: 0

10.0.0.5/32 Originating RIB: inet.3

Metric: 1 Node path count: 1

Forwarding nexthops: 2

Nexthop: 10.0.12.2 via ae0.0

Session Id: 0

Nexthop: 10.0.13.3 via ae1.0

Session Id: 0

Protocol Nexthop: 10.0.0.6 Metric: 1 Push 25

Indirect nexthop: 0x1880e600 1048588 INH Session ID: 0xb0a

Path forwarding nexthops link: 0x3611f440

141

Page 137: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Path inh link: 0x0

Indirect path forwarding nexthops: 2

Nexthop: 10.0.12.2 via ae0.0

Session Id: 0

Nexthop: 10.0.13.3 via ae1.0

Session Id: 0

10.0.0.6/32 Originating RIB: inet.3

Metric: 1 Node path count: 1

Forwarding nexthops: 2

Nexthop: 10.0.12.2 via ae0.0

Session Id: 0

Nexthop: 10.0.13.3 via ae1.0

Session Id: 0

Protocol Nexthop: 10.0.0.7 Metric: 1 Push 25

Indirect nexthop: 0x1880dc00 1048586 INH Session ID: 0xb09

Path forwarding nexthops link: 0x15466d80

Path inh link: 0x0

Indirect path forwarding nexthops: 2

Nexthop: 10.0.12.2 via ae0.0

Session Id: 0

Nexthop: 10.0.13.3 via ae1.0

Session Id: 0

10.0.0.7/32 Originating RIB: inet.3

Metric: 1 Node path count: 1

Forwarding nexthops: 2

Nexthop: 10.0.12.2 via ae0.0

Session Id: 0

Nexthop: 10.0.13.3 via ae1.0

Session Id: 0

show route (Enhanced Subscriber Management)

user@host> show route

inet.0: 41 destinations, 41 routes (40 active, 0 holddown, 1 hidden)

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

198.51.100.11/24 *[Access-internal/12] 00:00:08

> to #0 10.0.0.1.93.65 via demux0.1073741824

198.51.100.12/24 *[Access-internal/12] 00:00:08

Private unicast

142

Page 138: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

show route (IPv6 Flow Specification)

user@host> show route

inet6.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden)

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

2001:db8::10:255:185:19/128

*[Direct/0] 05:11:27

> via lo0.0

2001:db8::11:11:11:0/120

*[BGP/170] 00:28:58, localpref 100

AS path: 2000 I, validation-state: unverified

> to 2001:db8::13:14:2:2 via ge-1/1/4.0

2001:db8::13:14:2:0/120*[Direct/0] 00:45:07

> via ge-1/1/4.0

2001:db8::13:14:2:1/128*[Local/0] 00:45:18

Local via ge-1/1/4.0

fe80::2a0:a50f:fc71:71d5/128

*[Direct/0] 05:11:27

> via lo0.0

fe80::5e5e:abff:feb0:933e/128

*[Local/0] 00:45:18

Local via ge-1/1/4.0

inet6flow.0: 2 destinations, 2 routes (2 active, 0 holddown, 0 hidden)

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

2001:db8::11:11:11:10/128,*,proto=6,dstport=80,srcport=65535/term:1

*[BGP/170] 00:28:58, localpref 100, from 2001:db8::13:14:2:2

AS path: 2000 I, validation-state: unverified

Fictitious

2001:db8::11:11:11:30/128,*,icmp6-type=128,len=100,dscp=10/term:2

*[BGP/170] 00:20:54, localpref 100, from 2001:db8::13:14:2:2

AS path: 2000 I, validation-state: unverified

Fictitious

show route display-client-data detail

user@host> show route 198.51.100.0/24 display-client-data detail

inet.0: 59 destinations, 70 routes (59 active, 0 holddown, 0 hidden)

198.51.100.0/24 (1 entry, 1 announced)

State: <FlashAll>

143

Page 139: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

*BGP-Static Preference: 5/-101

Next hop type: Indirect, Next hop index: 0

Address: 0xa5c2af8

Next-hop reference count: 2

Next hop type: Router, Next hop index: 1641

Next hop: 192.0.2.1 via ge-2/1/1.0, selected

Session Id: 0x160

Protocol next hop: 192.0.2.1

Indirect next hop: 0xa732cb0 1048621 INH Session ID: 0x17e

State: <Active Int Ext AlwaysFlash NSR-incapable Programmed>

Age: 3:13 Metric2: 0

Validation State: unverified

Announcement bits (3): 0-KRT 5-LDP 6-Resolve tree 3

AS path: I

Client id: 1, Cookie: 1

show route te-ipv4-prefix-ip

user@host> show route te-ipv4-prefix-ip 10.10.10.10

lsdist.0: 283 destinations, 283 routes (283 active, 0 holddown, 0 hidden)

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

PREFIX { Node { AS:64496 ISO:0100.0a0a.0a0a.00 } { IPv4:10.10.10.10/32 } ISIS-L1:0

}/1152

*[IS-IS/15] 00:01:01

Fictitious

PREFIX { Node { AS:64496 ISO:0100.0101.0101.00 } { IPv4:10.10.10.10/32 } ISIS-L2:0

}/1152

*[IS-IS/18] 00:01:01

Fictitious

PREFIX { Node { AS:64496 ISO:0100.0202.0202.00 } { IPv4:10.10.10.10/32 } ISIS-L2:0

}/1152

*[IS-IS/18] 00:01:01

Fictitious

PREFIX { Node { AS:64496 ISO:0100.0303.0303.00 } { IPv4:10.10.10.10/32 } ISIS-L2:0

}/1152

*[IS-IS/18] 00:01:01

Fictitious

PREFIX { Node { AS:64496 ISO:0100.0404.0404.00 } { IPv4:10.10.10.10/32 } ISIS-L2:0

}/1152

*[IS-IS/18] 00:01:01

Fictitious

144

Page 140: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

PREFIX { Node { AS:64496 ISO:0100.0505.0505.00 } { IPv4:10.10.10.10/32 } ISIS-L2:0

}/1152

*[IS-IS/18] 00:01:01

Fictitious

PREFIX { Node { AS:64496 ISO:0100.0606.0606.00 } { IPv4:10.10.10.10/32 } ISIS-L2:0

}/1152

*[IS-IS/18] 00:01:01

Fictitious

PREFIX { Node { AS:64496 ISO:0100.0707.0707.00 } { IPv4:10.10.10.10/32 } ISIS-L2:0

}/1152

*[IS-IS/18] 00:01:01

Fictitious

PREFIX { Node { AS:64496 ISO:0100.0a0a.0a0a.00 } { IPv4:10.10.10.10/32 } ISIS-L2:0

}/1152

*[IS-IS/18] 00:01:01

Fictitious

show route te-ipv4-prefix-ip extensive

user@host>show route te-ipv4-prefix-ip 10.10.10.10 extensive

lsdist.0: 298 destinations, 298 routes (298 active, 0 holddown, 0 hidden)

*IS-IS Preference: 15

Level: 1

Next hop type: Fictitious, Next hop index: 0

Address: 0xa1a2ac4

Next-hop reference count: 298

Next hop:

State:<Active NotInstall>

Local AS: 64496

Age: 7:58

Validation State: unverified

Task: IS-IS

AS path: I

Prefix SID: 1000, Flags: 0x40, Algo: 0

PREFIX { Node { AS:64496 ISO:0100.0101.0101.00 } { IPv4:10.10.10.10/32 } ISIS-L2:0

}/1152 (1 entry, 0 announced)

*IS-IS Preference: 18

Level: 2

Next hop type: Fictitious, Next hop index: 0

Address: 0xa1a2ac4

Next-hop reference count: 298

Next hop:

145

Page 141: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

State: <Active NotInstall

Local AS: 64496

Age: 7:58

Validation State: unverified

Task: IS-IS

AS path: I

Prefix SID: 1000, Flags: 0xe0, Algo: 0>

PREFIX { Node { AS:64496 ISO:0100.0202.0202.00 } { IPv4:10.10.10.10/32 } ISIS-L2:0

}/1152 (1 entry, 0 announced)

*IS-IS Preference: 18

Level: 2

Next hop type: Fictitious, Next hop index: 0

Address: 0xa1a2ac4

Next-hop reference count: 298

Next hop:

State: <Active NotInstall>

Local AS: 64496

Age: 7:58

Validation State: unverified

Task: IS-IS

AS path: I

Prefix SID: 1000, Flags: 0xe0, Algo: 0

PREFIX { Node { AS:64496 ISO:0100.0303.0303.00 } { IPv4:10.10.10.10/32 } ISIS-L2:0

}/1152 (1 entry, 0 announced)

*IS-IS Preference: 18

Level: 2

Next hop type: Fictitious, Next hop index: 0

Address: 0xa1a2ac4

Next-hop reference count: 298

Next hop:

State: <Active NotInstall>

Local AS: 64496

Age: 7:58

Validation State: unverified

Task: IS-IS

AS path: I

Prefix SID: 1000, Flags: 0xe0, Algo: 0

PREFIX { Node { AS:64496 ISO:0100.0404.0404.00 } { IPv4:10.10.10.10/32 } ISIS-L2:0

}/1152 (1 entry, 0 announced)

*IS-IS Preference: 18

Level: 2

146

Page 142: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Next hop type: Fictitious, Next hop index: 0

Address: 0xa1a2ac4

Next-hop reference count: 298

Next hop:

State: <Active NotInstall>

Local AS: 64496

Age: 7:58

Validation State: unverified

Task: IS-IS

AS path: I

Prefix SID: 1000, Flags: 0xe0, Algo: 0

PREFIX { Node { AS:64496 ISO:0100.0505.0505.00 } { IPv4:10.10.10.10/32 } ISIS-L2:0

}/1152 (1 entry, 0 announced)

*IS-IS Preference: 18

Level: 2

Next hop type: Fictitious, Next hop index: 0

Address: 0xa1a2ac4

Next-hop reference count: 298

Next hop:

State: <Active NotInstall>

Local AS: 64496

Age: 7:58

Validation State: unverified

Task: IS-IS

AS path: I

Prefix SID: 1000, Flags: 0xe0, Algo: 0

PREFIX { Node { AS:64496 ISO:0100.0606.0606.00 } { IPv4:10.10.10.10/32 } ISIS-L2:0

}/1152 (1 entry, 0 announced)

*IS-IS Preference: 18

Level: 2

Next hop type: Fictitious, Next hop index: 0

Address: 0xa1a2ac4

Next-hop reference count: 298

Next hop:

State: <Active NotInstall>

Local AS: 64496

Age: 7:58

Validation State: unverified

Task: IS-IS

AS path: I

Prefix SID: 1000, Flags: 0xe0, Algo: 0

147

Page 143: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

PREFIX { Node { AS:64496 ISO:0100.0707.0707.00 } { IPv4:10.10.10.10/32 } ISIS-L2:0

}/1152 (1 entry, 0 announced)

*IS-IS Preference: 18

Level: 2

Next hop type: Fictitious, Next hop index: 0

Address: 0xa1a2ac4

Next-hop reference count: 298

Next hop:

State: <Active NotInstall>

Local AS: 64496

Age: 7:58

Validation State: unverified

Task: IS-IS

AS path: I

Prefix SID: 1000, Flags: 0xe0, Algo: 0

PREFIX { Node { AS:64496 ISO:0100.0a0a.0a0a.00 } { IPv4:10.10.10.10/32 } ISIS-L2:0

}/1152 (1 entry, 0 announced)

*IS-IS Preference: 18

Level: 2

Next hop type: Fictitious, Next hop index: 0

Address: 0xa1a2ac4

Next-hop reference count: 298

Next hop:

State: <Active NotInstall>

Local AS: 64496

Age: 7:58

Validation State: unverified

Task: IS-IS

AS path: I

Prefix SID: 1000, Flags: 0x40, Algo: 0

show route te-ipv4-prefix-node-iso

user@host> show route te-ipv4-prefix-node-iso 0100.0a0a.0a0a.00

lsdist.0: 283 destinations, 283 routes (283 active, 0 holddown, 0 hidden)

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

PREFIX { Node { AS:64496 ISO:0100.0a0a.0a0a.00 } { IPv4:10.10.10.10/32 } ISIS-L1:0

}/1152

*[IS-IS/15] 00:05:20

Fictitious

PREFIX { Node { AS:64496 ISO:0100.0a0a.0a0a.00 } { IPv4:10.1.1.1/32 } ISIS-L2:0

148

Page 144: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

}/1152

*[IS-IS/18] 00:05:20

Fictitious

PREFIX { Node { AS:64496 ISO:0100.0a0a.0a0a.00 } { IPv4:10.2.2.2/32 } ISIS-L2:0

}/1152

*[IS-IS/18] 00:05:20

Fictitious

PREFIX { Node { AS:64496 ISO:0100.0a0a.0a0a.00 } { IPv4:10.3.3.3/32 } ISIS-L2:0

}/1152

*[IS-IS/18] 00:05:20

Fictitious

PREFIX { Node { AS:64496 ISO:0100.0a0a.0a0a.00 } { IPv4:10.4.4.4/32 } ISIS-L2:0

}/1152

*[IS-IS/18] 00:05:20

Fictitious

PREFIX { Node { AS:64496 ISO:0100.0a0a.0a0a.00 } { IPv4:10.5.5.5/32 } ISIS-L2:0

}/1152

*[IS-IS/18] 00:05:20

Fictitious

PREFIX { Node { AS:64496 ISO:0100.0a0a.0a0a.00 } { IPv4:10.6.6.6/32 } ISIS-L2:0

}/1152

*[IS-IS/18] 00:05:20

Fictitious

PREFIX { Node { AS:64496 ISO:0100.0a0a.0a0a.00 } { IPv4:10.7.7.7/32 } ISIS-L2:0

}/1152

*[IS-IS/18] 00:05:20

Fictitious

PREFIX { Node { AS:64496 ISO:0100.0a0a.0a0a.00 } { IPv4:10.10.10.10/32 } ISIS-L2:0

}/1152

*[IS-IS/18] 00:05:20

Fictitious

show route te-ipv4-prefix-node-iso extensive

user@host> show route te-ipv4-prefix-node-iso 0100.0a0a.0a0a.00 extensive

lsdist.0: 283 destinations, 283 routes (283 active, 0 holddown, 0 hidden)

PREFIX { Node { AS:64496 ISO:0100.0a0a.0a0a.00 } { IPv4:10.10.10.10/32 } ISIS-L1:0

}/1152 (1 entry, 0 announced)

*IS-IS Preference: 15

Level: 1

Next hop type: Fictitious, Next hop index: 0

Address: 0xa1a2ac4

149

Page 145: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Next-hop reference count: 283

Next hop:

State: <Active NotInstall>

Local AS: 64496

Age: 6:47

Validation State: unverified

Task: IS-IS

AS path: I

Prefix SID: 1000, Flags: 0x40, Algo: 0

PREFIX { Node { AS:64496 ISO:0100.0a0a.0a0a.00 } { IPv4:10.1.1.1/32 } ISIS-L2:0

}/1152 (1 entry, 0 announced)

*IS-IS Preference: 18

Level: 2

Next hop type: Fictitious, Next hop index: 0

Address: 0xa1a2ac4

Next-hop reference count: 283

Next hop:

State: <Active NotInstall>

Local AS: 64496

Age: 6:47

Validation State: unverified

Task: IS-IS

AS path: I

Prefix SID: 1001, Flags: 0xe0, Algo: 0

PREFIX { Node { AS:64496 ISO:0100.0a0a.0a0a.00 } { IPv4:10.2.2.2/32 } ISIS-L2:0

}/1152 (1 entry, 0 announced)

*IS-IS Preference: 18

Level: 2

Next hop type: Fictitious, Next hop index: 0

Address: 0xa1a2ac4

Next-hop reference count: 283

Next hop:

State: <Active NotInstall>

Local AS: 64496

Age: 6:47

Validation State: unverified

Task: IS-IS

AS path: I

Prefix SID: 1002, Flags: 0xe0, Algo: 0

PREFIX { Node { AS:64496 ISO:0100.0a0a.0a0a.00 } { IPv4:10.3.3.3/32 } ISIS-L2:0

}/1152 (1 entry, 0 announced)

150

Page 146: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

*IS-IS Preference: 18

Level: 2

Next hop type: Fictitious, Next hop index: 0

Address: 0xa1a2ac4

Next-hop reference count: 283

Next hop:

State: <Active NotInstall>

Local AS: 64496

Age: 6:47

Validation State: unverified

Task: IS-IS

AS path: I

Prefix SID: 1003, Flags: 0xe0, Algo: 0

PREFIX { Node { AS:64496 ISO:0100.0a0a.0a0a.00 } { IPv4:10.4.4.4/32 } ISIS-L2:0

}/1152 (1 entry, 0 announced)

*IS-IS Preference: 18

Level: 2

Next hop type: Fictitious, Next hop index: 0

Address: 0xa1a2ac4

Next-hop reference count: 283

Next hop:

State: <Active NotInstall>

Local AS: 64496

Age: 6:47

Validation State: unverified

Task: IS-IS

AS path: I

Prefix SID: 1004, Flags: 0xe0, Algo: 0

PREFIX { Node { AS:64496 ISO:0100.0a0a.0a0a.00 } { IPv4:10.5.5.5/32 } ISIS-L2:0

}/1152 (1 entry, 0 announced)

*IS-IS Preference: 18

Level: 2

Next hop type: Fictitious, Next hop index: 0

Address: 0xa1a2ac4

Next-hop reference count: 283

Next hop:

State: <Active NotInstall>

Local AS: 64496

Age: 6:47

Validation State: unverified

Task: IS-IS

AS path: I

151

Page 147: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Prefix SID: 1005, Flags: 0xe0, Algo: 0

PREFIX { Node { AS:64496 ISO:0100.0a0a.0a0a.00 } { IPv4:10.6.6.6/32 } ISIS-L2:0

}/1152 (1 entry, 0 announced)

*IS-IS Preference: 18

Level: 2

Next hop type: Fictitious, Next hop index: 0

Address: 0xa1a2ac4

Next-hop reference count: 283

Next hop:

State: <Active NotInstall>

Local AS: 64496

Age: 6:47

Validation State: unverified

Task: IS-IS

AS path: I

Prefix SID: 1006, Flags: 0xe0, Algo: 0

PREFIX { Node { AS:64496 ISO:0100.0a0a.0a0a.00 } { IPv4:10.7.7.7/32 } ISIS-L2:0

}/1152 (1 entry, 0 announced)

*IS-IS Preference: 18

Level: 2

Next hop type: Fictitious, Next hop index: 0

Address: 0xa1a2ac4

Next-hop reference count: 283

Next hop:

State: <Active NotInstall>

Local AS: 64496

Age: 6:47

Validation State: unverified

Task: IS-IS

AS path: I

Prefix SID: 1007, Flags: 0xe0, Algo: 0

PREFIX { Node { AS:64496 ISO:0100.0a0a.0a0a.00 } { IPv4:10.10.10.10/32 } ISIS-L2:0

}/1152 (1 entry, 0 announced)

*IS-IS Preference: 18

Level: 2

Next hop type: Fictitious, Next hop index: 0

Address: 0xa1a2ac4

Next-hop reference count: 283

Next hop:

State: <Active NotInstall>

Local AS: 64496

152

Page 148: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Age: 6:47

Validation State: unverified

Task: IS-IS

AS path: I

Prefix SID: 1000, Flags: 0x40, Algo: 0

show route te-ipv4-prefix-node-iso detail

user@host> show route te-ipv4-prefix-node-iso 0100.0a0a.0a0a.00 detail

lsdist.0: 283 destinations, 283 routes (283 active, 0 holddown, 0 hidden)

PREFIX { Node { AS:64496 ISO:0100.0a0a.0a0a.00 } { IPv4:10.10.10.10/32 } ISIS-L1:0

}/1152 (1 entry, 0 announced)

*IS-IS Preference: 15

Level: 1

Next hop type: Fictitious, Next hop index: 0

Address: 0xa1a2ac4

Next-hop reference count: 283

Next hop:

State: <Active NotInstall>

Local AS: 64496

Age: 6:54

Validation State: unverified

Task: IS-IS

AS path: I

Prefix SID: 1000, Flags: 0x40, Algo: 0

PREFIX { Node { AS:64496 ISO:0100.0a0a.0a0a.00 } { IPv4:10.1.1.1/32 } ISIS-L2:0

}/1152 (1 entry, 0 announced)

*IS-IS Preference: 18

Level: 2

Next hop type: Fictitious, Next hop index: 0

Address: 0xa1a2ac4

Next-hop reference count: 283

Next hop:

State: <Active NotInstall>

Local AS: 64496

Age: 6:54

Validation State: unverified

Task: IS-IS

AS path: I

Prefix SID: 1001, Flags: 0xe0, Algo: 0

153

Page 149: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

PREFIX { Node { AS:64496 ISO:0100.0a0a.0a0a.00 } { IPv4:10.2.2.2/32 } ISIS-L2:0

}/1152 (1 entry, 0 announced)

*IS-IS Preference: 18

Level: 2

Next hop type: Fictitious, Next hop index: 0

Address: 0xa1a2ac4

Next-hop reference count: 283

Next hop:

State: <Active NotInstall>

Local AS: 64496

Age: 6:54

Validation State: unverified

Task: IS-IS

AS path: I

Prefix SID: 1002, Flags: 0xe0, Algo: 0

PREFIX { Node { AS:64496 ISO:0100.0a0a.0a0a.00 } { IPv4:10.3.3.3/32 } ISIS-L2:0

}/1152 (1 entry, 0 announced)

*IS-IS Preference: 18

Level: 2

Next hop type: Fictitious, Next hop index: 0

Address: 0xa1a2ac4

Next-hop reference count: 283

Next hop:

State: <Active NotInstall>

Local AS: 64496

Age: 6:54

Validation State: unverified

Task: IS-IS

AS path: I

Prefix SID: 1003, Flags: 0xe0, Algo: 0

PREFIX { Node { AS:64496 ISO:0100.0a0a.0a0a.00 } { IPv4:10.4.4.4/32 } ISIS-L2:0

}/1152 (1 entry, 0 announced)

*IS-IS Preference: 18

Level: 2

Next hop type: Fictitious, Next hop index: 0

Address: 0xa1a2ac4

Next-hop reference count: 283

Next hop:

State: <Active NotInstall>

Local AS: 64496

Age: 6:54

Validation State: unverified

154

Page 150: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Task: IS-IS

AS path: I

Prefix SID: 1004, Flags: 0xe0, Algo: 0

PREFIX { Node { AS:64496 ISO:0100.0a0a.0a0a.00 } { IPv4:10.5.5.5/32 } ISIS-L2:0

}/1152 (1 entry, 0 announced)

*IS-IS Preference: 18

Level: 2

Next hop type: Fictitious, Next hop index: 0

Address: 0xa1a2ac4

Next-hop reference count: 283

Next hop:

State: <Active NotInstall>

Local AS: 64496

Age: 6:54

Validation State: unverified

Task: IS-IS

AS path: I

Prefix SID: 1005, Flags: 0xe0, Algo: 0

PREFIX { Node { AS:64496 ISO:0100.0a0a.0a0a.00 } { IPv4:10.6.6.6/32 } ISIS-L2:0

}/1152 (1 entry, 0 announced)

*IS-IS Preference: 18

Level: 2

Next hop type: Fictitious, Next hop index: 0

Address: 0xa1a2ac4

Next-hop reference count: 283

Next hop:

State: <Active NotInstall>

Local AS: 64496

Age: 6:54

Validation State: unverified

Task: IS-IS

AS path: I

Prefix SID: 1006, Flags: 0xe0, Algo: 0

PREFIX { Node { AS:64496 ISO:0100.0a0a.0a0a.00 } { IPv4:10.7.7.7/32 } ISIS-L2:0

}/1152 (1 entry, 0 announced)

*IS-IS Preference: 18

Level: 2

Next hop type: Fictitious, Next hop index: 0

Address: 0xa1a2ac4

Next-hop reference count: 283

Next hop:

155

Page 151: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

State: <Active NotInstall>

Local AS: 64496

Age: 6:54

Validation State: unverified

Task: IS-IS

AS path: I

Prefix SID: 1007, Flags: 0xe0, Algo: 0

PREFIX { Node { AS:64496 ISO:0100.0a0a.0a0a.00 } { IPv4:10.10.10.10/32 } ISIS-L2:0

}/1152 (1 entry, 0 announced)

*IS-IS Preference: 18

Level: 2

Next hop type: Fictitious, Next hop index: 0

Address: 0xa1a2ac4

Next-hop reference count: 283

Next hop:

State: <Active NotInstall>

Local AS: 64496

Age: 6:54

Validation State: unverified

Task: IS-IS

AS path: I

Prefix SID: 1000, Flags: 0x40, Algo: 0

156

Page 152: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

show route detailList of SyntaxSyntax on page 157Syntax (EX Series Switches) on page 157

Syntax

show route detail<destination-prefix><logical-system (all | logical-system-name)>

Syntax (EX Series Switches)

show route detail<destination-prefix>

Release InformationCommand introduced before Junos OS Release 7.4.Command introduced in Junos OS Release 9.0 for EX Series switches.Command introduced in Junos OS Release 13.2X51-D15 for the QFX Series.Command introduced in Junos OS Release 14.1X53-D20 for the OCX Series.

DescriptionDisplay detailed information about the active entries in the routing tables.

Optionsnone—Display all active entries in the routing table on all systems.

destination-prefix—(Optional) Display active entries for the specified address or range of addresses.

logical-system (all | logical-system-name)—(Optional) Perform this operation on all logical systems or on aparticular logical system.

Required Privilege Levelview

List of Sample Outputshow route detail on page 170show route detail (with BGP Multipath) on page 178show route label detail (Multipoint LDP Inband Signaling for Point-to-Multipoint LSPs) on page 179show route label detail (Multipoint LDP with Multicast-Only Fast Reroute) on page 180

Output Fields

157

Page 153: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Table 9 on page 158 describes the output fields for the show route detail command. Output fields are listedin the approximate order in which they appear.

Table 9: show route detail Output Fields

Field DescriptionField Name

Name of the routing table (for example, inet.0).routing-table-name

Number of destinations for which there are routes in the routing table.number destinations

Number of routes in the routing table and total number of routes in the following states:

• active (routes that are active)

• holddown (routes that are in the pending state before being declared inactive)

• hidden (routes that are not used because of a routing policy)

number routes

Route destination (for example:10.0.0.1/24). The entry value is the number of routes for thisdestination, and the announced value is the number of routes being announced for thisdestination. Sometimes the route destination is presented in another format, such as:

• MPLS-label (for example, 80001).

• interface-name (for example, ge-1/0/2).

• neighbor-address:control-word-status:encapsulation type:vc-id:source (Layer 2 circuit only;for example, 10.1.1.195:NoCtrlWord:1:1:Local/96).

• neighbor-address—Address of the neighbor.

• control-word-status—Whether the use of the control word has been negotiated for thisvirtual circuit: NoCtrlWord or CtrlWord.

• encapsulation type—Type of encapsulation, represented by a number: (1) Frame RelayDLCI, (2) ATM AAL5 VCC transport, (3) ATM transparent cell transport, (4) Ethernet, (5)VLAN Ethernet, (6) HDLC, (7) PPP, (8) ATM VCC cell transport, (10) ATM VPC celltransport.

• vc-id—Virtual circuit identifier.

• source—Source of the advertisement: Local or Remote.

• source—Source of the advertisement: Local or Remote.

route-destination(entry, announced)

(Next-to-the-last-hop routing device for MPLS only) Depth of the MPLS label stack, wherethe label-popping operation is needed to remove one or more labels from the top of the stack.A pair of routes is displayed, because the pop operation is performed only when the stackdepth is two or more labels.

• S=0 route indicates that a packet with an incoming label stack depth of 2 or more exits thisrouting device with one fewer label (the label-popping operation is performed).

• If there is no S= information, the route is a normal MPLS route, which has a stack depth of1 (the label-popping operation is not performed).

label stacking

158

Page 154: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Table 9: show route detail Output Fields (continued)

Field DescriptionField Name

Protocol from which the route was learned and the preference value for the route.

• +—A plus sign indicates the active route, which is the route installed from the routing tableinto the forwarding table.

• - —A hyphen indicates the last active route.

• *—An asterisk indicates that the route is both the active and the last active route. An asteriskbefore a to line indicates the best subpath to the route.

In every routing metric except for the BGP LocalPref attribute, a lesser value is preferred. Inorder to use common comparison routines, JunosOS stores the 1's complement of the LocalPrefvalue in the Preference2 field. For example, if the LocalPref value for Route 1 is 100, thePreference2 value is -101. If the LocalPref value for Route 2 is 155, the Preference2 value is-156. Route 2 is preferred because it has a higher LocalPref value.

Preference2 values are signed integers, that is, Preference2 values can be either positive ornegative values. However, Junos OS evaluates Preference2 values as unsigned integers thatare represented by positive values. Based on the Preference2 values, Junos OS evaluates apreferred route differently in the following scenarios:

• Both Signed Preference2 values

• Route A = -101

• Route B = -156

Where both the Preference2 values are signed, Junos OS evaluates only the unsigned valueof Preference2 and Route A, which has a lower Preference2 value is preferred.

• Unsigned Preference2 values

Now consider both unsigned Preference2 values:

• Route A = 4294967096

• Route B = 200

Here, Junos OS considers the lesser Preference2 value and Route B with a Preference2value of 200 is preferred because it is less than 4294967096.

• Combination of signed and unsigned Preference2 values

When Preference2 values of two routes are compared, and for one route the Preference2is a signed value, and for the other route it is an unsigned value, Junos OS prefers the routewith the positive Preference2 value over the negative Preference2 value. For example,consider the following signed and unsigned Preference2 values:

• Route A = -200

• Route B = 200

In this case, Route B with a Preference2 value of 200 is preferred although this value isgreater than -200, because Junos OS evaluates only the unsigned value of the Preference2value.

[protocol, preference]

159

Page 155: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Table 9: show route detail Output Fields (continued)

Field DescriptionField Name

(IS-IS only). In IS-IS, a single AS can be divided into smaller groups called areas. Routing betweenareas is organized hierarchically, allowing a domain to be administratively divided into smallerareas. This organization is accomplished by configuring Level 1 and Level 2 intermediatesystems. Level 1 systems route within an area. When the destination is outside an area, theyroute toward a Level 2 system. Level 2 intermediate systems route between areas and towardother ASs.

Level

IP subnet augmented with a 64-bit prefix.Route Distinguisher

Provider multicast service interface (MVPN routing table).PMSI

Type of next hop. For a description of possible values for this field, see Table 10 on page 164.Next-hop type

Number of references made to the next hop.Next-hop referencecount

Indicates that the number of flood next-hop branches exceeded the system limit of 32 branches,and only a subset of the flood next-hop branches were installed in the kernel.

Flood nexthopbranches exceedmaximum message

IP address of the route source.Source

Network layer address of the directly reachable neighboring system.Next hop

Interface used to reach the next hop. If there is more than one interface available to the nexthop, the name of the interface that is actually used is followed by the word Selected. Thisfield can also contain the following information:

• Weight—Value used to distinguish primary, secondary, and fast reroute backup routes.Weight information is available when MPLS label-switched path (LSP) link protection,node-link protection, or fast reroute is enabled, or when the standby state is enabled forsecondary paths. A lower weight value is preferred. Among routes with the same weightvalue, load balancing is possible.

• Balance—Balance coefficient indicating how traffic of unequal cost is distributed amongnext hopswhen a routing device is performing unequal-cost load balancing. This informationis available when you enable BGP multipath load balancing.

via

Name of the LSP used to reach the next hop.Label-switched-pathlsp-path-name

160

Page 156: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Table 9: show route detail Output Fields (continued)

Field DescriptionField Name

MPLS label and operation occurring at this routing device. The operation can be pop (wherea label is removed from the top of the stack), push (where another label is added to the labelstack), or swap (where a label is replaced by another label).

Label operation

(Local only) Local interface name.Interface

Network layer address of the remote routing device that advertised the prefix. This addressis used to derive a forwarding next hop.

Protocol next hop

Index designation used to specify themapping between protocol next hops, tags, kernel exportpolicy, and the forwarding next hops.

Indirect next hop

State of the route (a route can be in more than one state). See Table 11 on page 166.State

AS number of the local routing device.Local AS

How long the route has been known.Age

Accumulated interior gateway protocol (AIGP) BGP attribute.AIGP

Cost value of the indicated route. For routes within an AS, the cost is determined by IGP andthe individual protocol metrics. For external routes, destinations, or routing domains, the costis determined by a preference value.

Metricn

Metric value for BGP path selection to which the IGP cost to the next-hop destination hasbeen added.

MED-plus-IGP

For MPLS LSPs, state of the TTL propagation attribute. Can be enabled or disabled for allRSVP-signaled and LDP-signaled LSPs or for specific VRF routing instances.

For sample output, see show route table.

TTL-Action

Name of the protocol that has added the route.Task

The number of BGP peers or protocols to which Junos OS has announced this route, followedby the list of the recipients of the announcement. Junos OS can also announce the route tothe KRT for installing the route into the Packet Forwarding Engine, to a resolve tree, a L2 VC,or even a VPN. For example, n-Resolve inet indicates that the specified route is used for routeresolution for next hops found in the routing table.

• n—An index used by Juniper Networks customer support only.

Announcement bits

161

Page 157: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Table 9: show route detail Output Fields (continued)

Field DescriptionField Name

AS path through which the route was learned. The letters at the end of the AS path indicatethe path origin, providing an indication of the state of the route at the point at which the ASpath originated:

• I—IGP.

• E—EGP.

• Recorded—The AS path is recorded by the sample process (sampled).

• ?—Incomplete; typically, the AS path was aggregated.

When AS path numbers are included in the route, the format is as follows:

• [ ]—Brackets enclose the number that precedes the AS path. This number represents thenumber of ASs present in the AS path, when calculated as defined in RFC 4271. This valueis used in the AS-path merge process, as defined in RFC 4893.

• [ ]—If more than one AS number is configured on the routing device, or if AS path prependingis configured, brackets enclose the local AS number associated with the AS path.

• { }—Braces enclose AS sets, which are groups of AS numbers in which the order does notmatter. A set commonly results from route aggregation. The numbers in each AS set aredisplayed in ascending order.

• ( )—Parentheses enclose a confederation.

• ( [ ] )—Parentheses and brackets enclose a confederation set.

NOTE: In JunosOS Release 10.3 and later, the AS path field displays an unrecognized attributeand associated hexadecimal value if BGP receives attribute 128 (attribute set) and you havenot configured an independent domain in any routing instance.

AS path

(BGP-learned routes) Validation status of the route:

• Invalid—Indicates that the prefix is found, but either the corresponding AS received fromthe EBGP peer is not the AS that appears in the database, or the prefix length in the BGPupdate message is longer than the maximum length permitted in the database.

• Unknown—Indicates that the prefix is not among the prefixes or prefix ranges in the database.

• Unverified—Indicates that the origin of the prefix is not verified against the database. Thisis because the database got populated and the validation is not called for in the BGP importpolicy, although origin validation is enabled, or the origin validation is not enabled for theBGP peers.

• Valid—Indicates that the prefix and autonomous system pair are found in the database.

validation-state

Displays the optimal route reflection (ORR) generation identifier. ISIS and OSPF interiorgateway protocol (IGP) updates filed whenever any of the corresponding ORR route has itsmetric valued changed, or if the ORR route is added or deleted.

ORR Generation-ID

162

Page 158: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Table 9: show route detail Output Fields (continued)

Field DescriptionField Name

Point-to-multipoint root address, multicast source address, andmulticast group address whenmultipoint LDP (M-LDP) inband signaling is configured.

FECs bound to route

When multipoint LDP with multicast-only fast reroute (MoFRR) is configured, the primaryupstream path. MoFRR transmits a multicast join message from a receiver toward a sourceon a primary path, while also transmitting a secondarymulticast join message from the receivertoward the source on a backup path.

Primary Upstream

Whenmultipoint LDPwithMoFRR is configured, the reverse-path forwarding (RPF) next-hopinformation. Data packets are received from both the primary path and the secondary paths.The redundant packets are discarded at topology merge points due to the RPF checks.

RPF Nexthops

Multiple MPLS labels are used to control MoFRR stream selection. Each label represents aseparate route, but each references the same interface list check. Only the primary label isforwardedwhile all others are dropped.Multiple interfaces can receive packets using the samelabel.

Label

Value used to distinguishMoFRR primary and backup routes. A lowerweight value is preferred.Among routes with the same weight value, load balancing is possible.

weight

MPLS label assigned to the Layer 2 circuit virtual connection.VC Label

Maximum transmission unit (MTU) of the Layer 2 circuit.MTU

VLAN identifier of the Layer 2 circuit.VLAN ID

Forwarding equivalent class (FEC) bound to this route. Applicable only to routes installed byLDP.

Prefixes bound toroute

Community path attribute for the route. See Table 12 on page 169 for all possible values forthis field.

Communities

Layer 2 encapsulation (for example, VPLS).Layer2-info: encaps

Control flags: none or Site Down.control flags

Maximum transmission unit (MTU) information.mtu

First label in a block of labels and label block size. A remote PE routing device uses this firstlabel when sending traffic toward the advertising PE routing device.

Label-Base, range

163

Page 159: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Table 9: show route detail Output Fields (continued)

Field DescriptionField Name

Layer 2 VPN and VPLS network layer reachability information (NLRI).status vector

Current active path when BGP multipath is configured.Accepted Multipath

The LongLivedStale flag indicates that the route was marked LLGR-stale by this router, as partof the operation of LLGR receiver mode. Either this flag or the LongLivedStaleImport flag maybe displayed for a route. Neither of these flags are displayed at the same time as the Stale(ordinary GR stale) flag.

AcceptedLongLivedStale

The LongLivedStaleImport flag indicates that the route was marked LLGR-stale when it wasreceived from a peer, or by import policy. Either this flag or the LongLivedStale flag may bedisplayed for a route. Neither of these flags are displayed at the same time as the Stale (ordinaryGR stale) flag.

Accept all received BGP long-lived graceful restart (LLGR) and LLGR stale routes learned fromconfigured neighbors and import into the inet.0 routing table

AcceptedLongLivedStaleImport

Accept all received BGP long-lived graceful restart (LLGR) and LLGR stale routes learned fromconfigured neighbors and imported into the inet.0 routing table

The LongLivedStaleImport flag indicates that the route was marked LLGR-stale when it wasreceived from a peer, or by import policy.

ImportAcceptedLongLivedStaleImport

Path currently contributing to BGP multipath.AcceptedMultipathContrib

Local preference value included in the route.Localpref

BGP router ID as advertised by the neighbor in the open message.Router ID

In a routing table group, the name of the primary routing table in which the route resides.Primary RoutingTable

In a routing table group, the name of one or more secondary tables in which the route resides.Secondary Tables

Table 10 on page 164 describes all possible values for the Next-hop Types output field.

Table 10: Next-hop Types Output Field Values

DescriptionNext-Hop Type

Broadcast next hop.Broadcast (bcast)

164

Page 160: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Table 10: Next-hop Types Output Field Values (continued)

DescriptionNext-Hop Type

Deny next hop.Deny

Discard next hop.Discard

Dynamic list next hopDynamic List

Flood next hop. Consists of components called branches, up to amaximum of 32 branches. Each flood next-hop branch sends a copy ofthe traffic to the forwarding interface. Used by point-to-multipointRSVP, point-to-multipoint LDP, point-to-multipoint CCC, andmulticast.

Flood

Next hop is waiting to be resolved into a unicast or multicast type.Hold

Indexed next hop.Indexed (idxd)

Used with applications that have a protocol next hop address that isremote. You are likely to see this next-hop type for internal BGP (IBGP)routes when the BGP next hop is a BGP neighbor that is not directlyconnected.

Indirect (indr)

Used for a network address assigned to an interface. Unlike the routernext hop, the interface next hop does not reference any specific nodeon the network.

Interface

Local address on an interface. This next-hop type causes packets withthis destination address to be received locally.

Local (locl)

Wire multicast next hop (limited to the LAN).Multicast (mcst)

Multicast discard.Multicast discard (mdsc)

Multicast group member.Multicast group (mgrp)

Receive.Receive (recv)

Discard. An ICMP unreachable message was sent.Reject (rjct)

Resolving next hop.Resolve (rslv)

Regular multicast next hop.Routed multicast (mcrt)

165

Page 161: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Table 10: Next-hop Types Output Field Values (continued)

DescriptionNext-Hop Type

A specific node or set of nodes to which the routing device forwardspackets that match the route prefix.

To qualify as next-hop type router, the route must meet the followingcriteria:

• Must not be a direct or local subnet for the routing device.

• Must have a next hop that is directly connected to the routing device.

Router

Routing table next hop.Table

Unicast.Unicast (ucst)

List of unicast next hops. A packet sent to this next hop goes to anynext hop in the list.

Unilist (ulst)

Table 11 on page 166 describes all possible values for the State output field. A route can be in more thanone state (for example, <Active NoReadvrt Int Ext>).

Table 11: State Output Field Values

DescriptionValue

Route needs accounting.Accounting

Route is active.Active

Path with a lower multiple exit discriminator (MED) is available.Always Compare MED

Shorter AS path is available.AS path

Cisco nondeterministic MED is enabled, and a path with a lower MED isavailable.

CiscoNon-deterministicMED selection

Route is a clone.Clone

Length of cluster list sent by the route reflector.Cluster list length

Route has been deleted.Delete

Exterior route.Ex

166

Page 162: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Table 11: State Output Field Values (continued)

DescriptionValue

BGP route received from an external BGP neighbor.Ext

Forces all protocols to be notified of a change to any route, active or inactive,for a prefix. When not set, protocols are informed of a prefix only whenthe active route changes.

FlashAll

Route not used because of routing policy.Hidden

Route needs forwarding RPF check.IfCheck

Path through next hop with lower IGP metric is available.IGP metric

Flags for this route, which was not selected as best for a particulardestination.

Inactive reason

Route being added.Initial

Interior route.Int

BGP route received from an internal BGP peer or a BGP confederation peer.Int Ext

Direct, static, IGP, or EBGP path is available.Interior > Exterior > Exterior via Interior

Path with a higher local preference value is available.Local Preference

Route is a martian (ignored because it is obviously invalid).Martian

Route exempt from martian filtering.MartianOK

Path with lower metric next hop is available.Next hop address

Path from neighbor with lower IP address is available.No difference

Route not to be advertised.NoReadvrt

Route not chosen because it does not have the lowest MED.NotBest

Incoming BGP AS is not the best of a group (only one AS can be the best).Not Best in its group

Route not to be installed in the forwarding table.NotInstall

167

Page 163: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Table 11: State Output Field Values (continued)

DescriptionValue

Route added by non-NSR supported protocols.NSR-incapable

Path with a greater number of next hops is available.Number of gateways

Path with a lower origin code is available.Origin

Route pending because of a hold-down configured on another route.Pending

Route installed programatically by on-device or off-device applications usingAPI.

Programmed

Route scheduled for release.Release

Route from a higher-numbered routing table is available.RIB preference

64-bit prefix added to IP subnets to make them unique.Route Distinguisher

Route with a lower metric or MED is available.Route Metric or MED comparison

Route with lower preference value is availableRoute Preference

Path through a neighbor with lower ID is available.Router ID

Route not a primary route.Secondary

Path is not usable because of one of the following conditions:

• The route is damped.

• The route is rejected by an import policy.

• The route is unresolved.

Unusable path

Last tiebreaker is the lowest IP address value.Update source

Indicates paths requesting protection.ProtectionCand

Indicates the route entry that can be used as a protection path.ProtectionPath

Table 12 on page 169 describes the possible values for the Communities output field.

168

Page 164: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Table 12: Communities Output Field Values

DescriptionValue

4 bytes, encoding a 32-bit area number. For AS-external routes, the value is 0. Anonzero value identifies the route as internal to the OSPF domain, and as withinthe identified area. Area numbers are relative to a particular OSPF domain.

area-number

Link-bandwidth community value used for unequal-cost load balancing.When BGPhas several candidate paths available for multipath purposes, it does not performunequal-cost load balancing according to the link-bandwidth community unless allcandidate paths have this attribute.

bandwidth: local ASnumber:link-bandwidth-number

Unique configurable number that identifies the OSPF domain.domain-id

Unique configurable number that further identifies the OSPF domain.domain-id-vendor

Link-bandwidth number: from 0 through 4,294,967,295 (bytes per second).link-bandwidth-number

Local AS number: from 1 through 65,535.local AS number

1 byte. Currently this is only used if the route type is 5 or 7. Setting the leastsignificant bit in the field indicates that the route carries a type 2 metric.

options

(Used with VPNs) Identifies where the route came from.origin

1 byte, encoded as 1 or 2 for intra-area routes (depending on whether the routecame from a type 1 or a type 2 LSA); 3 for summary routes; 5 for external routes(area numbermust be0); 7 for NSSA routes; or 129 for sham link endpoint addresses.

ospf-route-type

Displays the area number, OSPF route type, and option of the route. This isconfigured using the BGP extended community attribute 0x8000. The format isarea-number:ospf-route-type:options.

route-type-vendor

Displays the area number, OSPF route type, and option of the route. This isconfigured using the BGP extended community attribute 0x0306. The format isarea-number:ospf-route-type:options.

rte-type

Defines which VPN the route participates in; target has the format 32-bit IPaddress:16-bit number. For example, 10.19.0.0:100.

target

Incoming IANA codes with a value between 0x1 and 0x7fff. This code of the BGPextended community attribute is accepted, but it is not recognized.

unknown IANA

Incoming IANA codes with a value above 0x8000. This code of the BGP extendedcommunity attribute is accepted, but it is not recognized.

unknown OSPF vendorcommunity

169

Page 165: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Sample Output

show route detail

user@host> show route detail

inet.0: 22 destinations, 23 routes (21 active, 0 holddown, 1 hidden)

10.10.0.0/16 (1 entry, 1 announced)

*Static Preference: 5

Next-hop reference count: 29

Next hop: 192.168.71.254 via fxp0.0, selected

State: <Active NoReadvrt Int Ext>

Local AS: 69

Age: 1:31:43

Task: RT

Announcement bits (2): 0-KRT 3-Resolve tree 2

AS path: I

10.31.1.0/30 (2 entries, 1 announced)

*Direct Preference: 0

Next hop type: Interface

Next-hop reference count: 2

Next hop: via so-0/3/0.0, selected

State: <Active Int>

Local AS: 69

Age: 1:30:17

Task: IF

Announcement bits (1): 3-Resolve tree 2

AS path: I

OSPF Preference: 10

Next-hop reference count: 1

Next hop: via so-0/3/0.0, selected

State: <Int>

Inactive reason: Route Preference

Local AS: 69

Age: 1:30:17 Metric: 1

ORR Generation-ID: 1

Area: 0.0.0.0

Task: OSPF

AS path: I

10.31.1.1/32 (1 entry, 1 announced)

*Local Preference: 0

Next hop type: Local

170

Page 166: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Next-hop reference count: 7

Interface: so-0/3/0.0

State: <Active NoReadvrt Int>

Local AS: 69

Age: 1:30:20

Task: IF

Announcement bits (1): 3-Resolve tree 2

AS path: I

...

10.31.2.0/30 (1 entry, 1 announced)

*OSPF Preference: 10

Next-hop reference count: 9

Next hop: via so-0/3/0.0

Next hop: 10.31.1.6 via ge-3/1/0.0, selected

State: <Active Int>

Local AS: 69

Age: 1:29:56 Metric: 2

Area: 0.0.0.0

ORR Generation-ID: 1

Task: OSPF

Announcement bits (2): 0-KRT 3-Resolve tree 2

AS path: I

...

172.16.233.2/32 (1 entry, 1 announced)

*PIM Preference: 0

Next-hop reference count: 18

State: <Active NoReadvrt Int>

Local AS: 69

Age: 1:31:45

Task: PIM Recv

Announcement bits (2): 0-KRT 3-Resolve tree 2

AS path: I

...

172.16.233.22/32 (1 entry, 1 announced)

*IGMP Preference: 0

Next-hop reference count: 18

State: <Active NoReadvrt Int>

Local AS: 69

171

Page 167: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Age: 1:31:43

Task: IGMP

Announcement bits (2): 0-KRT 3-Resolve tree 2

AS path: I

inet.3: 2 destinations, 2 routes (2 active, 0 holddown, 0 hidden)

10.255.70.103/32 (1 entry, 1 announced)

State: <FlashAll>

*RSVP Preference: 7

Next-hop reference count: 6

Next hop: 10.31.1.6 via ge-3/1/0.0 weight 0x1, selected

Label-switched-path green-r1-r3

Label operation: Push 100096

State: <Active Int>

Local AS: 69

Age: 1:25:49 Metric: 2

Task: RSVP

Announcement bits (2): 1-Resolve tree 1 2-Resolve tree 2

AS path: I

10.255.71.238/32 (1 entry, 1 announced)

State: <FlashAll>

*RSVP Preference: 7

Next-hop reference count: 6

Next hop: via so-0/3/0.0 weight 0x1, selected

Label-switched-path green-r1-r2

State: <Active Int>

Local AS: 69

Age: 1:25:49 Metric: 1

Task: RSVP

Announcement bits (2): 1-Resolve tree 1 2-Resolve tree 2

AS path: I

private__.inet.0: 2 destinations, 3 routes (2 active, 0 holddown, 0 hidden)

iso.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)

47.0005.80ff.f800.0000.0108.0001.0102.5507.1052/152 (1 entry, 0 announced)

*Direct Preference: 0

Next hop type: Interface

Next-hop reference count: 1

Next hop: via lo0.0, selected

State: <Active Int>

172

Page 168: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Local AS: 69

Age: 1:31:44

Task: IF

AS path: I

mpls.0: 5 destinations, 5 routes (5 active, 0 holddown, 0 hidden)

0 (1 entry, 1 announced)

*MPLS Preference: 0

Next hop type: Receive

Next-hop reference count: 6

State: <Active Int>

Local AS: 69

Age: 1:31:45 Metric: 1

Task: MPLS

Announcement bits (1): 0-KRT

AS path: I

...

mpls.0: 5 destinations, 5 routes (5 active, 0 holddown, 0 hidden)

299840 (1 entry, 1 announced)

TSI:

KRT in-kernel 299840 /52 -> {indirect(1048575)}

*RSVP Preference: 7/2

Next hop type: Flood

Address: 0x9174a30

Next-hop reference count: 4

Next hop type: Router, Next hop index: 798

Address: 0x9174c28

Next-hop reference count: 2

Next hop: 172.16.0.2 via lt-1/2/0.9 weight 0x1

Label-switched-path R2-to-R4-2p2mp

Label operation: Pop

Next hop type: Router, Next hop index: 1048574

Address: 0x92544f0

Next-hop reference count: 2

Next hop: 172.16.0.2 via lt-1/2/0.7 weight 0x1

Label-switched-path R2-to-R200-p2mp

Label operation: Pop

Next hop: 172.16.0.2 via lt-1/2/0.5 weight 0x8001

Label operation: Pop

State: <Active Int>

Age: 1:29 Metric: 1

173

Page 169: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Task: RSVP

Announcement bits (1): 0-KRT

AS path: I...

800010 (1 entry, 1 announced)

*VPLS Preference: 7

Next-hop reference count: 2

Next hop: via vt-3/2/0.32769, selected

Label operation: Pop

State: <Active Int>

Age: 1:29:30

Task: Common L2 VC

Announcement bits (1): 0-KRT

AS path: I

vt-3/2/0.32769 (1 entry, 1 announced)

*VPLS Preference: 7

Next-hop reference count: 2

Next hop: 10.31.1.6 via ge-3/1/0.0 weight 0x1, selected

Label-switched-path green-r1-r3

Label operation: Push 800012, Push 100096(top)

Protocol next hop: 10.255.70.103

Push 800012

Indirect next hop: 87272e4 1048574

State: <Active Int>

Age: 1:29:30 Metric2: 2

Task: Common L2 VC

Announcement bits (2): 0-KRT 1-Common L2 VC

AS path: I

Communities: target:11111:1 Layer2-info: encaps:VPLS,

control flags:, mtu: 0

inet6.0: 5 destinations, 5 routes (5 active, 0 holddown, 0 hidden)

abcd::10:255:71:52/128 (1 entry, 0 announced)

*Direct Preference: 0

Next hop type: Interface

Next-hop reference count: 1

Next hop: via lo0.0, selected

State: <Active Int>

Local AS: 69

Age: 1:31:44

Task: IF

AS path: I

174

Page 170: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

fe80::280:42ff:fe10:f179/128 (1 entry, 0 announced)

*Direct Preference: 0

Next hop type: Interface

Next-hop reference count: 1

Next hop: via lo0.0, selected

State: <Active NoReadvrt Int>

Local AS: 69

Age: 1:31:44

Task: IF

AS path: I

ff02::2/128 (1 entry, 1 announced)

*PIM Preference: 0

Next-hop reference count: 18

State: <Active NoReadvrt Int>

Local AS: 69

Age: 1:31:45

Task: PIM Recv6

Announcement bits (1): 0-KRT

AS path: I

ff02::d/128 (1 entry, 1 announced)

*PIM Preference: 0

Next-hop reference count: 18

State: <Active NoReadvrt Int>

Local AS: 69

Age: 1:31:45

Task: PIM Recv6

Announcement bits (1): 0-KRT

AS path: I

ff02::16/128 (1 entry, 1 announced)

*MLD Preference: 0

Next-hop reference count: 18

State: <Active NoReadvrt Int>

Local AS: 69

Age: 1:31:43

Task: MLD

Announcement bits (1): 0-KRT

AS path: I

private.inet6.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)

175

Page 171: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

fe80::280:42ff:fe10:f179/128 (1 entry, 0 announced)

*Direct Preference: 0

Next hop type: Interface

Next-hop reference count: 1

Next hop: via lo0.16385, selected

State: <Active NoReadvrt Int>

Age: 1:31:44

Task: IF

AS path: I

green.l2vpn.0: 4 destinations, 4 routes (4 active, 0 holddown, 0 hidden)

10.255.70.103:1:3:1/96 (1 entry, 1 announced)

*BGP Preference: 170/-101

Route Distinguisher: 10.255.70.103:1

Next-hop reference count: 7

Source: 10.255.70.103

Protocol next hop: 10.255.70.103

Indirect next hop: 2 no-forward

State: <Secondary Active Int Ext>

Local AS: 69 Peer AS: 69

Age: 1:25:49 Metric2: 1

AIGP 210

Task: BGP_69.10.255.70.103+179

Announcement bits (1): 0-green-l2vpn

AS path: I

Communities: target:11111:1 Layer2-info: encaps:VPLS,

control flags:, mtu: 0

Label-base: 800008, range: 8

Localpref: 100

Router ID: 10.255.70.103

Primary Routing Table bgp.l2vpn.0

10.255.71.52:1:1:1/96 (1 entry, 1 announced)

*L2VPN Preference: 170/-1

Next-hop reference count: 5

Protocol next hop: 10.255.71.52

Indirect next hop: 0 -

State: <Active Int Ext>

Age: 1:31:40 Metric2: 1

Task: green-l2vpn

Announcement bits (1): 1-BGP.0.0.0.0+179

AS path: I

Communities: Layer2-info: encaps:VPLS, control flags:Site-Down,

176

Page 172: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

mtu: 0

Label-base: 800016, range: 8, status-vector: 0x9F

10.255.71.52:1:5:1/96 (1 entry, 1 announced)

*L2VPN Preference: 170/-101

Next-hop reference count: 5

Protocol next hop: 10.255.71.52

Indirect next hop: 0 -

State: <Active Int Ext>

Age: 1:31:40 Metric2: 1

Task: green-l2vpn

Announcement bits (1): 1-BGP.0.0.0.0+179

AS path: I

Communities: Layer2-info: encaps:VPLS, control flags:, mtu: 0

Label-base: 800008, range: 8, status-vector: 0x9F

...

l2circuit.0: 2 destinations, 2 routes (2 active, 0 holddown, 0 hidden)

10.245.255.63:CtrlWord:4:3:Local/96 (1 entry, 1 announced)

*L2CKT Preference: 7

Next hop: via so-1/1/2.0 weight 1, selected

Label-switched-path my-lsp

Label operation: Push 100000[0]

Protocol next hop: 10.245.255.63 Indirect next hop: 86af000 296

State: <Active Int>

Local AS: 99

Age: 10:21

Task: l2 circuit

Announcement bits (1): 0-LDP

AS path: I

VC Label 100000, MTU 1500, VLAN ID 512

inet.0: 45 destinations, 47 routes (44 active, 0 holddown, 1 hidden)

1.1.1.3/32 (1 entry, 1 announced)

*IS-IS Preference: 18

Level: 2

Next hop type: Router, Next hop index: 580

Address: 0x9db6ed0

Next-hop reference count: 8

Next hop: 10.1.1.6 via lt-1/0/10.5, selected

Session Id: 0x18a

State: <Active Int>

Local AS: 2

177

Page 173: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Age: 1:32 Metric: 10

Validation State: unverified

ORR Generation-ID: 1

Task: IS-IS

Announcement bits (3): 0-KRT 5-Resolve tree 4 6-Resolve_IGP_FRR

task

AS path: I

inet.0: 61 destinations, 77 routes (61 active, 1 holddown, 0 hidden)

1.1.1.1/32 (2 entries, 1 announced)

*OSPF Preference: 10

Next hop type: Router, Next hop index: 673

Address: 0xc008830

Next-hop reference count: 3

Next hop: 10.1.1.1 via ge-0/0/2.0, selected

Session Id: 0x1b7

State: <Active Int>

Local AS: 1

Age: 3:06:59 Metric: 100

Validation State: unverified

ORR Generation-ID: 1

Area: 0.0.0.0

Task: OSPF

Announcement bits (2): 1-KRT 9-Resolve tree 2

AS path: I

show route detail (with BGP Multipath)

user@host> show route detail

10.1.1.8/30 (2 entries, 1 announced)

*BGP Preference: 170/-101

Next hop type: Router, Next hop index: 262142

Address: 0x901a010

Next-hop reference count: 2

Source: 10.1.1.2

Next hop: 10.1.1.2 via ge-0/3/0.1, selected

Next hop: 10.1.1.6 via ge-0/3/0.5

State: <Active Ext>

Local AS: 1 Peer AS: 2

Age: 5:04:43

Validation State: unverified

Task: BGP_2.10.1.1.2+59955

178

Page 174: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Announcement bits (1): 0-KRT

AS path: 2 I

Accepted Multipath

Localpref: 100

Router ID: 172.16.1.2

BGP Preference: 170/-101

Next hop type: Router, Next hop index: 678

Address: 0x8f97520

Next-hop reference count: 9

Source: 10.1.1.6

Next hop: 10.1.1.6 via ge-0/3/0.5, selected

State: <NotBest Ext>

Inactive reason: Not Best in its group - Active preferred

Local AS: 1 Peer AS: 2

Age: 5:04:43

Validation State: unverified

Task: BGP_2.10.1.1.6+58198

AS path: 2 I

Accepted MultipathContrib

Localpref: 100

Router ID: 172.16.1.3

show route label detail (Multipoint LDP Inband Signaling for Point-to-Multipoint LSPs)

user@host> show route label 299872 detail

mpls.0: 13 destinations, 13 routes (13 active, 0 holddown, 0 hidden)

299872 (1 entry, 1 announced)

*LDP Preference: 9

Next hop type: Flood

Next-hop reference count: 3

Address: 0x9097d90

Next hop: via vt-0/1/0.1

Next-hop index: 661

Label operation: Pop

Address: 0x9172130

Next hop: via so-0/0/3.0

Next-hop index: 654

Label operation: Swap 299872

State: **Active Int>

Local AS: 1001

Age: 8:20 Metric: 1

Task: LDP

Announcement bits (1): 0-KRT

179

Page 175: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

AS path: I

FECs bound to route: P2MP root-addr 10.255.72.166, grp 232.1.1.1,

src 192.168.142.2

show route label detail (Multipoint LDP with Multicast-Only Fast Reroute)

user@host> show route label 301568 detail

mpls.0: 18 destinations, 18 routes (18 active, 0 holddown, 0 hidden)

301568 (1 entry, 1 announced)

*LDP Preference: 9

Next hop type: Flood

Address: 0x2735208

Next-hop reference count: 3

Next hop type: Router, Next hop index: 1397

Address: 0x2735d2c

Next-hop reference count: 3

Next hop: 1.3.8.2 via ge-1/2/22.0

Label operation: Pop

Load balance label: None;

Next hop type: Router, Next hop index: 1395

Address: 0x2736290

Next-hop reference count: 3

Next hop: 1.3.4.2 via ge-1/2/18.0

Label operation: Pop

Load balance label: None;

State: <Active Int AckRequest MulticastRPF>

Local AS: 10

Age: 54:05 Metric: 1

Validation State: unverified

Task: LDP

Announcement bits (1): 0-KRT

AS path: I

FECs bound to route: P2MP root-addr 172.16.1.1, grp: 232.1.1.1,

src: 192.168.219.11

Primary Upstream : 172.16.1.3:0--172.16.1.2:0

RPF Nexthops :

ge-1/2/15.0, 1.2.94.1, Label: 301568, weight: 0x1

ge-1/2/14.0, 1.2.3.1, Label: 301568, weight: 0x1

Backup Upstream : 172.16.1.3:0--172.16.1.6:0

RPF Nexthops :

ge-1/2/20.0, 1.2.96.1, Label: 301584, weight: 0xfffe

ge-1/2/19.0, 1.3.6.1, Label: 301584, weight: 0xfffe

180

Page 176: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

8CHAPTER

API Reference

JET APIs | 183

Page 177: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48
Page 178: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

JET APIs

JET supports the following APIs:

• Service APIs:

• Routing:

• PRPD Common API

• PRPD Service API

• RIB Service API

• MPLS Service API

• BGP Route Service API

• Firewall—Firewall Service API

• Interfaces—Interfaces Service API

• Management—Management Service API

• Base Types:

• jnx Address API

• jnx Base Types API

• Notification—Notification APIs

For more information on the APIs, see the Juniper Engineering Network (Eng.juniper.net) website.

183

Page 179: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

9CHAPTER

Additional Resources

Additional Resources | 187

Page 180: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48
Page 181: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

Additional Resources

• Getting Started with JET: Video Tutorials

• Expert Advice: Junos Extension Toolkit (JET)

• FAQ: Learning About JET Part 1--Python on Junos OS

• FAQ: Learning About JET Part 2--JavaScript Object Notation (JSON)

• FAQ: Learning About JET Part 3--JET APIs

• FAQ: Learning About JET Part 4--Fast Programmatic Configuration

• An Intro to Juniper’s JET Automation framework and how to use it

• Junos OS Has the Toolkit to Make You an Automation Wizard

• The Modern, Autonomous Enterprise - Four Essential Network Solutions

187

Page 182: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48

10CHAPTER

Downloads

Downloads | 191

Page 183: Juniper Extension Toolkit Developer Guide · CreateaCertificateRequest|39 On-DeviceApplications|40 Overview|41 SignedCPackage|41 SignedPythonPackageWithoutCDependencies|44 SignedPythonPackagewithCDependencies|48