Intermediate File in the INI Format

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
Table 1 Fields in an INI file

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:

  1. Use the SHA256 calculation tool, such as HashMyFiles.
  2. Run the certutil -hashfile filename SHA256 command provided by the Windows operating system.

;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:
  • tftp://hostname/path

  • ftp://[username[:password]@]hostname/path

  • sftp://[username[:password]@]hostname[:port]/path

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:
  • You can obtain the ESN of the device from the nameplate on the device package.
  • The ESN is case-insensitive.
  • You are advised to use the ESN of a device to specify the configuration information of the device, but not to use DEFAULT to perform batch configuration.

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:
  • You can obtain the MAC address of the device from the nameplate on the device package.
  • The MAC address is case-insensitive.
  • You need to fill in the intermediate file in strict accordance with the MAC address format displayed on the device. For example, if the MAC address displayed on the device is 00e0-fc12-3456, the MAC address 00e0fc123456 is incorrect because "-" is also verified.
  • You are advised to use the MAC address of a device to specify the configuration of the device, but not to use DEFAULT to perform batch configuration.

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:
  • For details about the device type, see "Chassis" in Hardware Description.
  • If the value of DEVICETYPE is different from the actual device type, the ZTP process is performed again.

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.

The DEVICETYPE option is the first check item.
  • If the value of the DEVICETYPE field is DEFAULT, or this field does not exist or is empty, the device only checks ESN or MAC. If ESN or MAC matches the criteria, the device considers the DESCRIPTION configuration valid. Otherwise, the device considers the DESCRIPTION configuration invalid.
  • If the DEVICETYPE field has a value that is not DEFAULT, the device checks whether the value is the same as the device type. If the value is different from the device type, the device considers the DESCRIPTION configuration invalid and checks the next one. If the value is the same as the device type, the device moves on to check ESN or MAC. If ESN or MAC matches the criteria, the device considers the DESCRIPTION configuration valid. Otherwise, the device considers the DESCRIPTION configuration invalid.
  • If the values of ESN and MAC are both DEFAULT, the two fields are not checked.
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >