top of page

Managing Junos using Rest API

The Managing Junos Devices using REST API learning byte demonstrates how to manage Junos devices using REST API. Since most programming languages can communicate with REST API , programmers can easily integrate with Junos devices with REST without learning Junos CLI.

The REST API is a "Representational State Transfer" (REST) interface that enables you to securely connect to Juniper Networks Junos operating system (Junos OS) devices, execute remote procedure calls (rpc commands), use a REST API Explorer GUI enabling you to conveniently experiment with any of the REST APIs, and use a variety of formatting and display options, including JavaScript Object Notation (JSON).

The REST API can be configured on Junos OS devices using commands available under the [edit system services rest] hierarchy level. Once configured, the REST API becomes available as the rest service, a REST-based interface that enables you to submit rpc commands to the device from a remote location, and supports GET and POST requests. With the REST API you can:

  • Use GET requests to submit rpc commands;

  • Use POST requests to submit information via rpc commands;

  • Retrieve configuration information in XML, ASCII (plain text), or JSON;

  • Retrieve operational data in XML, ASCII, or JSON.

Once the REST API is configured on the device, new REST endpoints are available for executing either single rpc commands via GET or POST requests, or executing multiple rpc commands via a single POST request.

Enabling commands on router:

#set system services netconf ssh
#set system services rest enable-explorer

#set system services rest http 
#set system service rest https server-certificate REST_CERT

Now you can go to your browser and insert your IP router and your port enabled: (http or https)

Open a browser, and go to the following URL: scheme://device-name:port (for example,

Some other security commands:

set system services rest control allowed-sources [ip-address]
set system services rest http addresses [ip-address]
set system services rest https addresses [ip-address]
set system services rest control connection-limit [number]
set system services rest https server-certificate [name]
set system services rest https cipher-list rsa-with-3des-ede-cbc-sha
set system services rest https mutual-authentication certificate-authority [name]
set system services rest traceoptions flag all

494 views0 comments

Recent Posts

See All

Juniper | Recovery Root Password

Recovering Root Password for Juniper Devices can be done in few simple steps. ➪ This procedure is applicable for Juniper MX, M, EX, SRX, ACX, T, and PTX series devices. Step#1: Connect your Juniper de

Junos-PythonEZ | XcvrTable & Counter

The following script show how to using Junos PyEZ "XcvrTable" and "Counter" widget to get the number of transceivers on the Junos router on a fast way. In this case, I used a router Juniper model MX 4

Junos-PythonEZ (PyEZ) | Connection

Junos PyEZ is a microframework for Python that enables you to manage and automate devices running the Junos operating system (Junos OS). Junos PyEZ is designed to provide the capabilities that a user


bottom of page