Support Support Downloads Knowledge Base Case Manager My Juniper Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

[EX] ZTP DHCP option length limitation



Article ID: KB31153 KB Last Updated: 14 Sep 2016Version: 1.0

When using ZTP, the DHCP option has a length limitation. When the total length is over this limitation, the ZTP will fail.


On the EX3200 and EX3300 platforms, when you process ZTP, if the length of the config-file-name or image-file-name option is greater than 256 characters, then the AIU will fail.


option ztp-server code 150 = ip-address;
option JUNOS-ZTP.image-file-name code 0 = text;
option JUNOS-ZTP.config-file-name code 1 = text;
option JUNOS-ZTP.image-file-type code 2 = text;
option JUNOS-ZTP.transfer-mode code 3 = text;
option JUNOS-ZTP.alt,g-image-file-name code 4 = text;
option JUNOS-ZTP.jloader-file code 5 = text;
option JUNOS-ZTP-encap code 43 = encapsulate JUNOS-ZTP;

subnet x.x.x.x netmask {
option routers x.x.x.x;
option subnet-mask;
option ztp-server x.x.x.x;
option JUNOS-ZTP.transfer-mode "http";
option JUNOS-ZTP.image-file-type "symlink";
pool {
     range x.x.x.x y.y.y.y;
host juniper123 {
     hardware ethernet x:x:x:x:x:x;
     option JUNOS-ZTP.config-file-name "path for config-file"; <-----              
     option JUNOS-ZTP.image-file-name "path for image file";   <-----

In the process of ZTP, the DHCP server will create a data structure AIU. Below is the content of AIU:

Successful AIU:

"/bin/sh /usr/sbin/image_load -G -I me0 -O install_reboot -D /var/tmp -C /tftpboot/aaa.conf -E symlink -F /tftpboot/jinstall-ex-3200-12.3R9-domestic-signed.tgz -T tftp"

Failed AIU:

"/bin/sh /usr/sbin/image_load -G -I me0 -O install_reboot -D /var/tmp -C /tftpboot/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.conf -E symlink -F /tftpboot/jinstall-ex-3200-12.3R9-domestic-s"

The total length of AIU cannot be over 256 bytes; otherwise, the ZTP will fail.


In Junos EX3200 or EX3300 platform on version 12.3, the maximum length of AIU is 256, including option 150, option 43, source interface, and some fix bytes. If the total length is over 256, it will be cut off and the ZTP will fail.

Fix bytes are shown below. The total length is 78 (including space):

"/bin/sh /usr/sbin/image_load -G"
" -I "
" -O install_reboot -D /var/tmp -C "
" -E "
" -F "

The total length for variable bytes will be 256-78=178. The 178 bytes include source interface, dhcp server address and all option 43 characters.


Use a shorter filename for the config-file-name or image-file-name options.

Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search