Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?


Example: Configuring the REST API

This example demonstrates how to configure the REST API on a Junos OS device.


  • A routing, switching, or security device running Junos OS Release 14.2 or later is required.


This example configures the REST API on a Juniper Networks M10i Multiservice Edge Router. The example configures both HTTP and HTTPS access, with both lighttpd and juise tracing.


CLI Quick Configuration

To quickly configure this example, copy the following commands, paste them in a text file, remove any line breaks, change any details necessary to match your network configuration, copy and paste the commands into the CLI at the [edit] hierarchy level, and then enter commit from configuration mode.

Configuring the REST API

Step-by-Step Procedure

To configure the REST API:

  1. Specify allowed IP addresses for incoming HTTP and HTTPS connections.

  2. Specify the maximum number of allowed connections over both HTTP and HTTPS.

  3. Set the TCP port for incoming HTTP connections.

  4. Set the addresses on which the server listens for incoming HTTP connections.

  5. Set the TCP port for incoming HTTPS connections.

  6. Set the addresses on which the server listens for incoming HTTPS connections.

  7. Set the server certificate.

  8. Configure the set of ciphers the server can use to perform encryption and decryption functions.

  9. (Optional) Set up TLS mutual authentication on both the server and client with a certificate.

  10. (Optional) Configure trace options for lighttpd, juise, or both.

  11. (Optional) Enable the REST API Explorer.

  12. Commit the configuration.



Verifying REST API Configuration


Confirm that the REST API configuration is working properly on the device.


Display the REST API configuration by issuing the show configuration system services rest operational mode command.


This example configured both HTTP and HTTPS access on a Juniper Networks M10i Multiservice Edge Router. For HTTP access, the device listens on port 3000 and permits traffic from IP addresses,,, and For a more secure connection, HTTPS access was configured with mutual authentication, using port 3443 and allowed IP addresses of,,, and A connection limit of 100 has been configured for both HTTP and HTTPS, and both juise and lighttpd tracing has been enabled. By default, the REST API Explorer is disabled (see Example: Using the REST API Explorer).