Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 

Zero Touch Provisioning Using DHCP Options

 

Zero Touch Provisioning (ZTP) allows for automatic provisioning of Juniper Network devices that you add to your network. You can provision any supported device by using either a script to be executed or a configuration file to be loaded. You will also need to configure a DHCP server with required information, which is provided in this procedure, to use ZTP.

ZTP requires that your device is in a factory default state. The device from the factory boots with preinstalled software and factory default configuration. On a device that does not currently have the factory default configuration, you can issue the request system zeroize command.

Note

The request system zeroize command is not supported on PTX1000, PTX10001-20C, QFX10002-60C, PTX10002-60C devices. You must issue the request vmhost zeroize command (instead of request system zeroize) for factory default configuration on PTX1000 routers.

Note

On PTX10001-20C devices, after you issue the the request vmhost zeroize command, you will see the following message twice: VMHost Zeroization : Erase all data, including configuration and log files ? [yes,no] (no) yes

warning: Vmhost will reboot and may not boot without configuration

Erase all data, including configuration and log files? [yes,no] (no) yes

Before you begin:

  • Ensure that the device has access to the following network resources:

    • The DHCP server that provides the location of the software image and configuration files on the network

      Refer to your DHCP server documentation for configuration instructions.

    • The File Transfer Protocol (anonymous FTP), Hypertext Transfer Protocol (HTTP), or Trivial File Transfer Protocol (TFTP) server on which the software image and configuration files are stored

      Note

      Although TFTP is supported, we recommend that you use FTP or HTTP instead, because these transport protocols are more reliable.

      Caution

      HTTP URLs are limited to 256 characters in length.

    • A Domain Name System (DNS) server to perform reverse DNS lookup (not supported).

    • (Optional) An NTP server to perform time synchronization on the network

    • (Optional) A system log (syslog) server to manage system log messages and alerts.

      Syslog messages will be forwarded to this syslog server during ZTP.

  • Locate and record the MAC address for your device.

    On PTX10008 devices, the management MAC addresses are located on routing engines.

Caution

You cannot commit a configuration while the device is performing the software update process. If you commit a configuration while the device is performing the configuration file autoinstallation process, the process stops, and the configuration file is not downloaded from the network.

To enable zero touch provisioning for a device using DHCP options:

  1. Boot the device.
  2. Make sure the device has the default factory configuration installed.

    Issue the request system zeroize command on the device that you want to provision.

    Note

    The request system zeroize command is not supported on PTX1000 devices. You must issue the request vmhost zeroize command (instead of request system zeroize) for factory default configuration on PTX1000 devices.

    Starting in Junos OS Evolved Release 19.3R1, on QFX5220-128C device, in Zero Touch Provisioning (ZTP), you can use either WAN interfaces or management interfaces, to automatically download and install the appropriate software and the configuration file on your device during the bootstrap process. ZTP automatically configures on WAN port that has default port speed of 100-Gbps, and then connects your device to the Dynamic Host Configuration Protocol (DHCP) server to perform the bootstrap process:

    • If multiple DHCP replies arrive, the ZTP chooses the best set of arguments.

    • If multiple interfaces provide the same arguments, ZTP chooses one of the interfaces.

    • If there is an error while connecting to DHCP server, ZTP retry to connect DHCP server, and if multiple interfaces again provide same arguments, ZTP choose one of the interfaces.

    We recommend you to provision the DHCP server and save the software and configuration file in the specified DHCP server path on the file server.

  3. Download the software image file and/or the configuration file to the FTP, HTTP, or TFTP server from which the device will download these files.Note

    If you are performing zero touch provisioning with a Junos OS image that contains enhanced automation for the QFX5100 device, configure root authentication and the provider name, license type, and deployment scope for Chef and Puppet at the [edit system] hierarchy in the configuration file that is fetched from the server:

    { master:0}
    root# set root-authentication (encrypted-password password | plain-text-password password | ssh-dsa public-key | ssh-rsa public-key)
    root# set extensions providers juniper license-type customer deployment-scope commercial
    root# set extensions providers chef license-type customer deployment-scope commercial
  4. Configure the DHCP server to provide the necessary information to the device.

    Configure IP address assignment.

    You can configure dynamic or static IP address assignment for the management address of the device. To determine the management MAC address for static IP address mapping, add 1 to the last byte of the MAC address of the device, which you noted before you began this procedure.

    Note

    This address can be any address from the pool.

  5. Define the format of the vendor-specific information for DHCP option 43 in the dhcpd.conf file.

    Here is an example of an ISC DHCP 4.2 server dhcpd.conf file:

    Note

    Starting in Junos OS Release 18.2R1, a new DHCP option is introduced to set the timeout value for the file downloads over FTP. If the transfer-mode is set as FTP, the default value for the timeout is automatically set as 120 minutes, that is, in case the FTP session gets interrupted due to loss of connectivity in the middle of a file transfer, it will timeout after 120 minutes and ZTP will attempt to retry the file fetching process. This value can be overridden using the DHCP option as follows:

    where “val” is the user configurable timeout value in seconds and must be provided within quotes (like, "val”).

  6. Configure the following DHCP option 43 suboptions:
    • Suboption 00: The name of the software image file to install.

      Note

      When the DHCP server cannot use suboption 00, configure the software image filename using suboption 04. If both suboption 00 and suboption 4 are defined, suboption 04 is ignored.

    • Suboption 01: The name of the script or configuration file to install.

      Note

      ZTP determines if the file is a script file based on the first line of the file. If the first line contains the characters #! followed by an interpreter path, ZTP treats the file as a script and executes it with the specified interpreter path. In order for a script to execute, the script file must provide the ability to fetch and load a valid configuration file on the device during the ZTP process.

      The following list provides the types of scripts and their associated interpreter paths:

      • Shell script interpreter path: #!/bin/sh

      • SLAX script interpreter path: #!/usr/libexec/ui/cscript

      • Python script interpreter path: #!/usr/bin/python

        For security reasons, Junos OS has strict requirements for running unsigned Python scripts on devices running Junos OS. Only devices running Junos OS with Enhanced Automation and devices running Junos OS Evolved support running unsigned Python scripts as part of the ZTP process.

      If the file does not contain special characters (#!) , ZTP determines that the file is a configuration file and loads the configuration file.

    • Suboption 02: The symbolic link to the software image file to install.

      Note

      If you do not specify suboption 2, the ZTP process handles the image filename as a filename, not a symbolic link.

    • Suboption 03: The transfer mode that the device uses to access the TFTP, FTP, or HTTP server. If you select FTP as the transfer mode, Junos OS uses the anonymous FTP login to download files from the FTP server.

      Note

      If suboption 03 is not configured, TFTP becomes the transfer mode by default.

    • Suboption 04: The name of the software image file to install.

      Note

      If the DHCP server does not support suboption 00, configure the image file using suboption 04. If both suboption 00 and suboption 4 are defined, suboption 04 is ignored.

    • Suboption 05: The HTTP port that the device uses to download either the image or configuration file or both instead of the default HTTP port.

  7. (Mandatory) Configure either option 150 or option 66.Note

    You must configure either option 150 or option 66. If you configure both option 150 and option 66, option 150 takes precedence, and option 66 is ignored. Also, make sure you specify an IP address, not a hostname, because name resolution is not supported.

    • Configure DHCP option 150 to specify the IP address of the FTP, HTTP, or TFTP server.

    • Configure DHCP option 66 to specify the IP address of the FTP, HTTP, or TFTP server.

  8. (Optional) Configure DHCP option 7 to specify one or more system log (syslog) servers.
  9. (Optional) Configure DHCP option 42 to specify one or more NTP servers.

    List each NTP server separated by a space.

  10. (Optional) Configure DHCP option 12 to specify the hostname of the device.

    The following sample configuration shows the DHCP options you just configured in this procedure:

    Based on the DHCP options configured in this example, the following items are added to the [edit system] hierarchy:

  11. Connect the device to the network that includes the DHCP server and the FTP, HTTP, or TFTP server.
  12. Power on the device.
  13. Monitor the ZTP process by looking at the console. Note

    When SLAX scripts are executed, the op-script.log and event-script.log files are produced.

    You can use these log files to troubleshoot in case something goes wrong.

    • /var/log/dhcp_logfile

      Use this file to check DHCP client logs.

    • /var/log/event-script.log

      Use this file to check configuration commit status.

    • /var/log/image_load_log

      Use this file to check software image and configuration file fetch and installation status.

    • /var/log/messages

      Use this file to check system-level logs.

    • /var/log/op-script.log

      Use this file to check configuration commit status.

    • /var/log/script_output

      Use this file to check script execution output.

    For Junos OS Evolved, use the /var/log/ztp.log file to troubleshoot.

    You can also monitor the ZTP process by looking at error messages and issuing operational commands. See Monitoring Zero Touch Provisioning for more information.

Release History Table
Release
Description
Starting in Junos OS Evolved Release 19.3R1, on QFX5220-128C device, in Zero Touch Provisioning (ZTP), you can use either WAN interfaces or management interfaces, to automatically download and install the appropriate software and the configuration file on your device during the bootstrap process.