ZTP supports INI intermediate files that store device and version file information.
An INI intermediate file must be suffixed with .ini. The file content format is as follows:
The SHA256 checksum in the following file is only an example.
#sha256sum="88298f97c634cb04b1eb4fe9ad2255abffc0a246112e1960cb6402f6b799f8b6" ;BEGIN ROUTER [GLOBAL CONFIG] FILESERVER=ftp://username:password@hostname/path [DEVICEn DESCRIPTION] ESN=2102351931P0C3000154 MAC=00e0-fc12-3456 DEVICETYPE=DEFAULT SYSTEM-SOFTWARE=V800R021C00SPC100.cc SYSTEM-CONFIG=test.cfg SYSTEM-PAT=V800R021C00SPC100SPH001.PAT ;END ROUTER
Field |
Mandatory |
Description |
---|---|---|
#sha256sum |
Yes |
SHA256 checksum of the INI file. NOTE:
The SHA256 checksum is calculated based on the content from ;BEGIN ROUTER to ;END ROUTER. In practice, you need to delete the first line in the file, move the following part one line above, calculate the SHA256 checksum, and write #sha256sum= plus the generated SHA256 checksum at the beginning of the file. The SHA256 algorithm can be used to verify the integrity of files. This algorithm has high security. You can use either of the following methods to generate an SHA256 checksum for a script file:
|
;BEGIN ROUTER |
Yes |
Start flag of the file. This field cannot be modified. |
[GLOBAL CONFIG] |
Yes |
Start flag of the global configuration. This field cannot be modified. |
FILESERVER |
Yes |
Address of the server from which version files are obtained. Files can be obtained in TFTP, FTP, or SFTP mode. The format is as follows:
username, password, and port are optional. The path parameter specifies the directory where version files are saved on the file server. hostname identifies a server. The value can be an IPv4 address, domain name, or an IPv6 address. The value of port ranges from 0 to 65535. If the specified value is out of the range, the default value 22 is used. A port number can be configured only when hostname of an SFTP server is set to an IPv4 address. |
[DEVICEn DESCRIPTION] |
Yes |
Start tag of the file description. n indicates the device number. The value is an integer and starts from 0. |
ESN |
No |
ESN of a device. If this field is set to DEFAULT, the ESN of the device is not checked. If this field is set to another value, the device needs to check whether the value is the same as its ESN. The default value is DEFAULT. If this field does not exist or is empty, the default value is used. NOTE:
|
MAC |
No |
MAC address of a device, in the XXXX-XXXX-XXXX format, in which X is a hexadecimal number. If this field is set to DEFAULT, the device MAC address is not checked. If this field is set to another value, the device needs to check whether the value is the same as its MAC address. The device ESN check takes place ahead of the MAC address check. The default value is DEFAULT. If this field does not exist or is empty, the default value is used. NOTE:
|
DEVICETYPE |
No |
Device type. If this field is set to DEFAULT, the device type is not checked. If this field is set to another value, the device needs to check whether the value is the same as its device type. The default value is DEFAULT. If this field does not exist or is empty, the default value is used. NOTE:
|
SYSTEM-SOFTWARE |
No |
System software file name, suffixed with .cc. |
SYSTEM-CONFIG |
Yes |
Configuration file name, suffixed with .cfg, .zip, or .dat. NOTE:
Do not use the default configuration file name vrpcfg.zip as the configuration file name. |
SYSTEM-PAT |
No |
Patch file name, suffixed with .pat. |
;END ROUTER |
Yes |
End flag of the file. This field cannot be modified. |
The device checks the content of [DEVICEn DESCRIPTION] in the INI file in sequence.