tftp
Use tftp to download a file from the TFTP server to the local device or upload a local file to the TFTP server in an IPv4 network.
Syntax
tftp tftp-server { get | put | sget } source-filename [ destination-filename ] [ vpn-instance vpn-instance-name ] [ dscp dscp-value | source { interface interface-type interface-number | ip source-ip-address } ]
Views
User view
Predefined user roles
network-admin
mdc-admin
Parameters
tftp-server: Specifies the IPv4 address or host name of a TFTP server. The host name can be a case-insensitive string of 1 to 253 characters and can contain only letters, digits, hyphens (-), underscores (_), and dots (.).
get: Downloads a file and writes the file directly to the destination folder. If the destination folder already has a file using the same name, the system deletes the existing file before starting the download operation. The existing file is permanently deleted even if the download operation fails.
put: Uploads a file.
sget: Downloads a file and saves the file to memory before writing it to the destination folder. The system starts to write the file to the destination folder only after the file is downloaded and saved to memory successfully. If the destination folder already has a file using the same name, the system overwrites the existing file. If the download or save-to-memory operation fails, the existing file in the destination folder is not overwritten.
source-filename: Specifies the source file name, a case-insensitive string of 1 to 1 to 255 characters.
destination-filename: Specifies the destination file name, a case-insensitive string of 1 to 255 characters. If this argument is not specified, the file uses the source file name.
vpn-instance vpn-instance-name: Specifies the VPN instance to which the remote host belongs, where vpn-instance-name is a case-sensitive string of 1 to 31 characters. If the remote host belongs to the public network, do not specify this option.
dscp dscp-value: Specifies the DSCP value for IPv4 to use for outgoing TFTP packets to indicate the packet transmission priority, in the range of 0 to 63. The default is 0.
source { interface interface-type interface-number | ip source-ip-address }: Specifies the source address for outgoing TFTP packets. If this keyword is not specified, the device uses the primary IPv4 address of the output interface for the route to the server as the source IPv4 address of outgoing TFTP packets.
interface interface-type interface-number: Specifies an interface by its type and number. The primary IPv4 address of this interface will be used as the source IPv4 address for outgoing TFTP packets. Make sure the interface is up and has the primary IPv4 address configured. Otherwise, the transmission fails.
ip source-ip-address: Specifies an IPv4 address. This address must be the IPv4 address of an interface in up state. Otherwise, the transmission fails.
Usage guidelines
The source address specified with the tftp command takes precedence over the source address specified with the tftp client source command.
The source address specified with the tftp client source command applies to all TFTP connections. The source address specified with the tftp command applies only to the current TFTP connection.
Examples
# Download the new.bin file from the TFTP server at 192.168.1.1 and save it as new.bin.
<Sysname> tftp 192.168.1.1 get new.bin Press CTRL+C to abort. % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 13.9M 100 13.9M 0 0 1206k 0 0:00:11 0:00:11 --:--:-- 1206k <System>
Table 16: Command output
Field | Description |
---|---|
% | Percentage of file transmission progress. |
Total | Size of files to be transmitted, in bytes. |
% | Percentage of received file size to total file size. |
Received | Received file size, in bytes. |
% | Percentage of sent file size to total file size. |
Xferd | Sent file size, in bytes. |
Average Dload | Average download speed, in bps. |
Speed Upload | Average upload speed, in bps. |
Related commands
tftp client source