Description

When attempting to initiate Zero Touch Provisioning (ZTP) on a device, you may encounter the following error:

ERROR: ZTP: DHCP/DHCPv6 server did not send image or config file / script

Symptoms

INFO: ZTP: loading config

ERROR: ZTP: dhcp client failed attempt 11. Retrying

INFO: ZTP: loading config

ERROR: ZTP: dhcp client failed attempt 12. Retrying

INFO: ZTP: Running DHCP on Mgmt Intf vmb0

INFO: ZTP: Running DHCPv6 on Mgmt Intf vmb0v6

INFO: ZTP:(vmb0) dhclient client started, pid is 12345

INFO: ZTP: loading options config

INFO: ZTP:(vmb0v6) DHCPv6 request timed out

,134 pyinotify WARNING] Unable to retrieve Watch object associated to <_RawEvent cookie=0 mask=0x8 name='' wd=3896 >

,134 pyinotify WARNING] Unable to retrieve Watch object associated to <_RawEvent cookie=0 mask=0x8 name='' wd=3897 >

INFO: ZTP: Dhcp protocol state is timedout

ERROR: ZTP: DHCP/DHCPv6 server did not send image or config file / script

INFO: ZTP: retrying ZTP

INFO: ZTP: loading config

Solution

Upon further investigation, the DHCP for IPv4 appears to be successful, but the DHCP response from the server does not include the expected Option 67 or Option 43. These options are critical for the proper functioning of the ZTP process as they provide essential configuration details, such as the configuration file's location, software image, and other necessary parameters.


Cause:

The absence of Option 67 or Option 43 in the DHCP response suggests that the DHCP server is not sending the required vendor-specific information. 

-Option 67 is typically used to specify the location of the configuration file.

-Option 43 is used to pass additional vendor-specific information, such as:

 - image-file-name: The name of the software image file.

 - configuration-file-name: The name of the configuration file.

 - image-file-type: The type of the image file (e.g., symbolic link).

 - transfer-type: The method used to transfer the file (e.g., FTP, HTTP, HTTPS, TFTP).

 - ftp-ip: The IP address of the FTP server (if FTP is used).


Without these options, the device is unable to obtain the necessary files or configurations to complete the ZTP process.


For more detailed information on DHCP Option 43, refer to the Juniper Documentation:

https://www.juniper.net/documentation/us/en/software/junos/junos-install-upgrade-evo/topics/concept/evo-ztp-dhcp-options.html


Steps to Troubleshoot:

1. Verify DHCP Response:

- Ensure that the DHCP server is configured correctly to include Option 67 or Option 43 in its response.

- You can use a packet capture (PCAP) tool to capture the DHCP packets and verify if these options are being sent by the DHCP server.


2. Collect the PCAP File:

- Capture a PCAP file during the ZTP process to inspect the DHCP packets. 

- Look for Option 43 or Option 67 in the DHCP response. If these options are missing or misconfigured, this will confirm that the server is not sending the necessary information.


3. Check Server Logs:

- Review the logs from the DHCP server to check for any errors or warnings. Look for entries similar to the following:

INFO: ZTP: DHCP protocol state is timed out

ERROR:ZTP: DHCP/DHCPv6 server did not send image or config file / script

INFO: ZTP: retrying ZTP

INFO: ZTP: loading config


- These log entries can provide additional context on why the DHCP server failed to deliver the necessary files.


4. Reset the Device:

- If the DHCP server configuration seems correct, you may need to "restart the router" to initiate a fresh ZTP process.

- You can use the `zeroize` command to reset the router, which will clear all configurations and initiate the ZTP process again.


5. Reinitiate ZTP:

- After resetting the device, reinitiate the ZTP process to see if the issue persists. Ensure that the device receives the correct DHCP options.

Modification History

2025-03-11 : Article Created