File Management
Table 1 FTP Config
| Command | Purpose |
|---|---|
| ftp server enable | Enable 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. |
ftp server enable
Section titled “ftp server enable”[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 terminalsonic(config)# ftp server enableftp server source {vrf
Section titled “ftp server source {vrf”[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]
| Parameter | Description |
|---|---|
| vrf_name | VRF name, the default VRF is default. |
| interface_name | Interface name (eg.0/1). |
| lag-id | LAG ID, the range is [1,9999]. |
| vlan-id | VLAN 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 terminalsonic(config)# ftp server source interface ethernet 0/0ftp [ip|ipv6]
Section titled “ftp [ip|ipv6]”[Command] **ftp ** [ip|ipv6] ip_address [autologin|vrf vrf_name|downloadtip]
[Purpose] Login to other devices using FTP protocol.
[Parameters]
| Parameter | Description |
|---|---|
| ip_address | IP address of devices. |
| vrf_name | VRF name, the default VRF is default. |
[View] Privileged User View
[Use Cases]
sonic# ftp ip 10.250.0.167 autologinConnected to 10.250.0.167.220 (vsFTPd 3.0.3)Name (10.250.0.167:admin): admin331 Please specify the password.Password:230 Login successful.Remote system type is UNIX.Using binary mode to transfer files.ftp>Table 2 TFTP Config
| Command | Purpose |
|---|---|
| tftp server enable | Enable 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. |
tftp server enable
Section titled “tftp server enable”[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 terminalsonic(config)# tftp server enabletftp server source {vrf
Section titled “tftp server source {vrf”[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]
| Parameter | Description |
|---|---|
| vrf_name | VRF name, the default VRF is default. |
| interface_name | Interface name (eg.0/1). |
| lag-id | LAG ID, the range is [1,9999]. |
| vlan-id | VLAN 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 terminalsonic(config)# tftp server source interface ethernet 0/0tftp [ip|ipv6]
Section titled “tftp [ip|ipv6]”[Command] **tftp ** [ip|ipv6] ip_address [vrf vrf_name|port port_id]
[Purpose] Login to other devices using TFTP protocol.
[Parameters]
| Parameter | Description |
|---|---|
| vrf_name | VRF name, the default VRF is default. |
| interface_name | Interface name (eg.0/1). |
| port_id | Port id |
[View] Privileged User View
[Use Cases]
sonic# tftp ip 10.250.0.167tftp>Table 3 SCP Config
| Command | Purpose |
|---|---|
| **scp ** [ip|ipv6] source sourcefile target destinationfile [vrf vrf_name|src source_ip|interface interface_name|foldercopy] | Transfer files using SCP protocol |
scp [ip|ipv6] source
Section titled “scp [ip|ipv6] source”[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]
| Parameter | Description |
|---|---|
| vrf_name | VRF name, the default VRF is default. |
| interface_name | Interface name (eg.0/1). |
| interface_name | Interface name (eg.0/1). |
| source_ip | Source IPaddress. |
| foldercopy | Batch 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.txtadmin@10.250.0.167's password:1.txt 100% 5 1.7KB/s 00:00sonic#