02-TFTP Commands
Chapters Download (31.59 KB)
Syntax
tftp-server [ ipv6 ] acl acl-number
undo tftp-server [ ipv6 ] acl
View
System view
Default Level
3: Manage level
Parameters
ipv6: References an IPv6 ACL. If it is not specified, an IPv4 ACL is referenced.
acl-number: Number of a basic ACL, in the range 2000 to 2999.
Description
Use the tftp server acl command to control the device’s access to a specific TFTP server using an ACL.
Use the undo tftp server acl command to restore the default.
By default, no ACL is used to control the device’s access to TFTP servers.
You can use the rules in an ACL to allow or permit the device’s access to a specific TFTP server in a network.
For more information about ACL, see ACL Overview or IPv4 ACL Configuration or IPv6 ACL Configuration in the Configuration Guide - Part 7 - ACL – QoS.
Examples
# Allow the device to access the TFTP server with the IP address of 1.1.1.1 only (in IPv4 networking environment).
<Sysname> system-view
[Sysname] acl number 2000
[Sysname-acl-basic-2000] rule permit source 1.1.1.1 0
[Sysname-acl-basic-2000] quit
[Sysname] tftp-server acl 2000
# Allow the device to access the TFTP server with the IP address of 2001::1 only (in IPv6 networking environment).
<Sysname> system-view
[Sysname] acl ipv6 number 2001
[Sysname-acl6-basic-2001] rule permit source 2001::1/128
[Sysname-acl6-basic-2001] quit
[Sysname] tftp-server ipv6 acl 2001
Syntax
tftp server-address { get | put | sget } source-filename [ destination-filename ] [ [ vpn-instance vpn-instance-name ] | [ source { interface interface-type interface-number | ip source-ip-address } ] ]
View
User view
Default Level
3: Manage level
Parameters
server-address: IP address or host name of a TFTP server.
get: Downloads a file in normal mode.
put: Uploads a file.
sget: Downloads a file in secure mode.
source-filename: Source file name.
destination-filename: Destination file name.
vpn-instance vpn-instance-name: Specifies the VPN where a TFTP server resides. The vpn-instance-name argument refers to the name of a VPN instance, which is a case-sensitive string of 1 to 31 characters.
source: Configures parameters for source address binding.
l interface interface-type interface-number: Specifies the source interface by its type and number. The primary IP address configured on the source interface is the source IP address of the packets sent by TFTP. If no primary IP address is configured on the source interface, the transmission fails.
l ip source-ip-address: Specifies the source IP address for the current TFTP client to transmit packets. This source address must be an IP address that has been configured on the device.
Description
Use the tftp command to upload files from the local device to a TFTP server or download files from the TFTP server to the local device.
If no destination file name is specified, a file is saved using the same name as that on the remote FTP server to the current working directory of the user (namely, the working directory where the tftp command is executed).
This command applies to IPv4 networks.
Examples
# To upgrade the device, download the newest.bin file from the TFTP server with the IP address of 192.168.1.26 and save it to both the root directory on the flash of the master and the root directory on the flash of the slave (with the member ID 2).
<Sysname> tftp 192.168.1.26 get newest.bin startup.bin
.
File will be transferred in binary mode
Downloading file from remote TFTP server, please wait..................
TFTP: 2737556 bytes received in 13 second(s)
File downloaded successfully.
// Download the file from the TFTP server to the root directory on the flash of the master.
<Sysname> tftp 192.168.1.26 get newest.bin slot2#flash:/startup.bin
File will be transferred in binary mode
Downloading file from remote TFTP server, please wait...|
TFTP: 2737556 bytes received in 14 second(s)
File downloaded successfully.
// Download the file from the TFTP server to the root directory on the flash of the slave.
Syntax
tftp ipv6 tftp-ipv6-server [ -i interface-type interface-number ] { get | put } source-file [ destination-file ]
View
User view
Default Level
3: Manage level
Parameters
tftp-ipv6-server: IPv6 address or host name (a string of 1 to 46 characters) of a TFTP server.
-i interface-type interface-number: Specifies the egress interface by its type and number. This parameter can be used only in case that the TFTP server address is a link local address and the specified egress interface must have a link local address (For the configuration of link local address, see IPv6 Basics Configuration in the Configuration Guide - Part 4 - IP Services).
get: Downloads a file.
put: Uploads a file.
source-filename: Source filename.
destination-filename: Destination filename. If not specified, this filename is the same as the source filename.
Description
Use the tftp ipv6 command to download a specified file from a TFTP server or upload a specified local file to a TFTP server.
This command applies to IPv6 networks.
Examples
# Download filetoget.txt from the TFTP server.
<Sysname> tftp ipv6 fe80::250:daff:fe91:e058 -i vlan-interface 1 get filetoget.txt
...
File will be transferred in binary mode
Downloading file from remote TFTP server, please wait....
TFTP: 411100 bytes received in 2 second(s)