Intermediate File in the CFG Format

ZTP supports CFG intermediate files that store device and version file information.

A CFG intermediate file must be suffixed with .cfg. The file content format is as follows:

The SHA256 checksum in the following file is only an example.

#sha256sum="fffcd63f5e31f0891a0349686969969c1ee429dedeaf7726ed304f2d08ce1bc7"fileserver=ftp://username:password@hostname/path;mac=00e0-fc12-3456;esn=2102351931P0C3000154;devicetype=DEFAULT;system-version=V800R021C00SPC100;system-software=V800R021C00SPC100.cc;system-config=test.cfg;system-pat=V800R021C00SPC100SPH001.PAT;
Table 1 Fields in a CFG file

Field

Mandatory

Description

#sha256sum

Yes

SHA256 checksum of the file.

NOTE:

The SHA256 checksum is calculated based on the content following #sha256sum=. 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.

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.

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 this field is different from the actual device type, the ZTP process is performed again.

system-version

No

System version number, which is specific to the C version, for example V800R021C00SPC100.

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.

  • The device matches configuration lines in the .cfg file in sequence.
  • If the devicetype field does not match the criteria, the device considers the configuration in this line invalid and moves on to the next line.
  • If the devicetype field does not need to be checked (the field value is set to DEFAULT) or the devicetype field matches the criteria, the device moves on to check the esn or mac field. If either the esn or mac field matches the criteria, the device considers the configuration in this line valid. Otherwise, the device considers the configuration in this line invalid. If the values of both the esn and mac fields are both DEFAULT, the configuration in this line is also valid.
  • If the intermediate file contains the version number, the system software name must be included and the version number of the system software must be the same as the version number in the intermediate file.
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >