Skip to content
Ask AI

File Management

Table 1 FTP Config

CommandPurpose
ftp server enableEnable FTP server.
ftp server source {vrf vrf_name|interface {mgmt 0|ethernet interface_name|link-aggregation lag-id |vlan vlan-id}}Configure the source interface for the FTP server.
**ftp ** [ip|ipv6] ip_address [autologin|vrf vrf_name|downloadtip]Login to other devices using FTP protocol.

[Command] ftp server enable

[Purpose] Enable FTP server.

[View] Global Configuration View

[Notes] FTP server is not enabled by default. The current FTP server only allows the ‘admin’ user to log in, and the corresponding FTP file root directory is /home/admin. Run command no ftp server enable to disable FTP server.

[Use Cases]

sonic# configure terminal
sonic(config)# ftp server enable

[Command] ftp server source{vrf vrf_name|interface {mgmt 0|ethernet interface_name|link-aggregation lag-id |vlan vlan-id}}

[Purpose] Configure the source interface for the FTP server.

[Parameters]

ParameterDescription
vrf_nameVRF name, the default VRF is default.
interface_nameInterface name (eg.0/1).
lag-idLAG ID, the range is [1,9999].
vlan-idVLAN ID, the range is [1,4094].

[View] Global Configuration View

[Notes] Run command no ftp server source to delete the source interface for the FTP server.

[Use Cases]

sonic# configure terminal
sonic(config)# ftp server source interface ethernet 0/0

[Command] **ftp ** [ip|ipv6] ip_address [autologin|vrf vrf_name|downloadtip]

[Purpose] Login to other devices using FTP protocol.

[Parameters]

ParameterDescription
ip_addressIP address of devices.
vrf_nameVRF name, the default VRF is default.

[View] Privileged User View

[Use Cases]

sonic# ftp ip 10.250.0.167 autologin
Connected to 10.250.0.167.
220 (vsFTPd 3.0.3)
Name (10.250.0.167:admin): admin
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>

Table 2 TFTP Config

CommandPurpose
tftp server enableEnable TFTP server.
tftp server source {vrf vrf_name|interface {mgmt 0|ethernet interface_name|link-aggregation lag-id |vlan vlan-id}}Configure the source interface for the TFTP server.
**tftp ** [ip|ipv6] ip_address [vrf vrf_name|port port_id]Login to other devices using TFTP protocol.

[Command] tftp server enable

[Purpose] Enable TFTP server.

[View] Global Configuration View

[Notes] TFTP server is not enabled by default. The corresponding TFTP file root directory is /srv/tftp/, which belongs to the ‘admin’ user, and only the ‘admin’ user is allowed to add or delete files within it. TFTP clients cannot add new files to the server or delete files from the server.They can download existing files on the server and also upload and update files on the server that have global write permissions. Run command no tftp server enable to disable TFTP server.

[Use Cases]

sonic# configure terminal
sonic(config)# tftp server enable

[Command] tftp server source {vrf vrf_name|interface {mgmt 0|ethernet interface_name|link-aggregation lag-id|vlan vlan-id}}

[Purpose] Configure the source interface for the TFTP server.

[Parameters]

ParameterDescription
vrf_nameVRF name, the default VRF is default.
interface_nameInterface name (eg.0/1).
lag-idLAG ID, the range is [1,9999].
vlan-idVLAN ID, the range is [1,4094].

[View] Global Configuration View

[Notes] Run command no tftp server source to delete the source interface for the TFTP server.

[Use Cases]

sonic# configure terminal
sonic(config)# tftp server source interface ethernet 0/0

[Command] **tftp ** [ip|ipv6] ip_address [vrf vrf_name|port port_id]

[Purpose] Login to other devices using TFTP protocol.

[Parameters]

ParameterDescription
vrf_nameVRF name, the default VRF is default.
interface_nameInterface name (eg.0/1).
port_idPort id

[View] Privileged User View

[Use Cases]

sonic# tftp ip 10.250.0.167
tftp>

Table 3 SCP Config

CommandPurpose
**scp ** [ip|ipv6] source sourcefile target destinationfile [vrf vrf_name|src source_ip|interface interface_name|foldercopy]Transfer files using SCP protocol

[Command] **scp ** [ip|ipv6] source sourcefile target destinationfile [vrf vrf_name|src source_ip|interface interface_name|foldercopy]

[Purpose] Transfer files using SCP protocol.

[Parameters]

ParameterDescription
vrf_nameVRF name, the default VRF is default.
interface_nameInterface name (eg.0/1).
interface_nameInterface name (eg.0/1).
source_ipSource IPaddress.
foldercopyBatch copying files from a folder.

[View] Privileged User View

[Use Cases]

sonic# scp ip source admin@10.250.0.167:/home/admin/1.txt target 114.txt
admin@10.250.0.167's password:
1.txt 100% 5 1.7KB/s 00:00
sonic#