- Table of Contents
-
- H3C S5500-SI Series Ethernet Switches Operation Manual(V1.01)
- 00-1Cover
- 00-2Overview
- 01-Login Configuration
- 02-VLAN Configuration
- 03-IP Addressing and IP Performance Configuration
- 04-QinQ-BPDU TUNNEL Configuration
- 05-Port Correlation Configuration
- 06-Link Aggregation Configuration
- 07-MAC Address Table Management Configuration
- 08-Port Security Configuration
- 09-MSTP Configuration
- 10-IPv6 Configuration
- 11-IP Routing Overview Configuration
- 12-IPv4 Routing Configuration
- 13-IPv6 Routing Configuration
- 14-Multicast Configuration
- 15-802.1x-HABP-MAC Authentication Configuration
- 16-AAA-RADIUS-HWTACACS Configuration
- 17-ARP Configuration
- 18-DHCP Configuration
- 19-ACL Configuration
- 20-QoS Configuration
- 21-Port Mirroring Configuration
- 22-UDP Helper Configuration
- 23-Cluster Management Configuration
- 24-SNMP-RMON Configuration
- 25-NTP Configuration
- 26-DNS Configuration
- 27-File System Management Configuration
- 28-Information Center Configuration
- 29-System Maintaining and Debugging Configuration
- 30-NQA Configuration
- 31-SSH Configuration
- 32-Track Configuration
- 33-PoE Configuration
- 34-SSL-HTTPS Configuration
- 35-PKI Configuration
- 36-Stack Management Configuration
- 37-Appendix
- Related Documents
-
Title | Size | Download |
---|---|---|
27-File System Management Configuration | 191 KB |
Table of Contents
Chapter 1 File System Management Configuration
1.1.4 Storage Device Operations
1.1.5 File System Prompt Mode Setting
1.1.6 File System Operations Example
1.2 Configuration File Management
1.2.1 Configuration File Overview
1.2.2 Saving the Current Configuration
1.2.3 Erasing the Startup Configuration File
1.2.4 Specifying a Configuration File for Next Startup
1.2.5 Backing up/Restoring the Configuration File for Next Startup
1.3 Displaying and Maintaining Device Configuration
2.2 Configuring the FTP Client
2.2.1 Establishing an FTP Connection
2.2.2 Configuring the FTP Client
2.2.3 FTP Client Configuration Example
2.3 Configuring the FTP Server
2.3.1 Configuring FTP Server Operating Parameters
2.3.2 Configuring Authentication and Authorization for Accessing FTP Server
2.3.3 FTP Server Configuration Example
2.4 Displaying and Maintaining FTP
3.2 Configuring the TFTP Client
3.3 Displaying and Maintaining the TFTP Client
3.4 TFTP Client Configuration Example
Chapter 1 File System Management Configuration
When configuring the file system management, go to these sections for information you are interested in:
l Configuration File Management
l Displaying and Maintaining Device Configuration
& Note:
Throughout this document, a filename can be entered as either of the following:
l A fully qualified filename with the path included to indicate a file under a specific path. The filename can be 1 to 135 characters in length.
l A short filename with the path excluded to indicate a file in the current path. The filename can be 1 to 91 characters in length.
1.1 File System Management
This section covers these topics:
l File System Prompt Mode Setting
1.1.1 File System Overview
A major function of the file system is to manage storage devices. It allows you to perform operations such as directory create and delete, and file copy and display. If an operation, delete or overwrite for example, may cause problems such as data loss or corruption, the file system will ask you to confirm the operation by default.
Depending on the managed object, file system operations fall into Directory Operations, File Operations, Storage Device Operations, and File System Prompt Mode Setting.
1.1.2 Directory Operations
Directory operations include create, delete, display the current path, display specified directory or file information as shown in the following table:
To do… |
Use the command… |
Remarks |
Create a directory |
mkdir directory |
Optional Available in user view |
Remove a directory |
rmdir directory |
Optional Available in user view |
Display the current path |
pwd |
Optional Available in user view |
Display files or directories |
dir [ /all ] [ file-url ] |
Optional Available in user view |
Change the current path |
cd directory |
Optional Available in user view |
& Note:
l The directory to be removed must be empty, meaning before you remove a directory, you must delete all the files and the subdirectory under this directory. For file deletion, refer to the delete command and for subdirectory deletion, refer to the rmdir command.
l After the execution of the rmdir command, the files in this directory will be automatically deleted for ever.
1.1.3 File Operations
File operations include delete (removing files into the recycle bin), restore the deleted, permanently delete (deleting files from the recycle bin), display, rename, copy, and move files, and display specified directory or file information as shown in the following table:
To do… |
Use the command… |
Remarks |
Remove a file to the recycle bin or delete it permanently |
delete [ /unreserved ] file-url |
Optional Available in user view |
Restore a file from the recycle bin |
undelete file-url |
Optional Available in user view |
Empty the recycle bin |
reset recycle-bin [ /force ] |
Optional Available in user view |
Display the contents of a file |
more file-url |
Optional Currently only a .txt file can be displayed. Available in user view |
Rename a file |
rename fileurl-source fileurl-dest |
Optional Available in user view |
Copy a file |
copy fileurl-source fileurl-dest |
Optional Available in user view |
Move a file |
move fileurl-source fileurl-dest |
Optional Available in user view |
Display files or directories |
dir [ /all ] [ file-url ] |
Optional Available in user view |
Enter system view |
system-view |
— |
Execute the batch file |
execute filename |
Optional |
& Note:
You can create a file by copying or downloading or using the save command.
Caution:
l Empty the recycle bin timely with the reset recycle-bin command to save memory space.
l As the delete /unreserved file-url command deletes a file permanently and the action cannot be undone, use it with caution.
l The execute command cannot ensure the execution of each command. For example, if a certain command is not correctly configured, the system will omit this command and go to the next one. Therefore, each configuration command in a batch file must be a standard configuration command, meaning the valid configuration information which can be displayed with the display current-configuration command after this command is configured successfully; otherwise, this command may not be executed correctly.
1.1.4 Storage Device Operations
I. Naming rules
Naming rules of the storage devices are as follows:
l If there is only one storage device of the same type on the device, the physical device name of the storage device is the storage device name.
l If there are multiple storage devices with the same type on the device, the physical device name of the storage device is composed of the storage device type and the serial number of the storage device. The serial number is displayed in English letters such as a, b or c.
l If storage device partitioning is supported on the device, the name of the partition device is composed of the physical device name and partition number. The serial numbers of partitions are displayed in numbers such as 0, 1 or 2.
& Note:
Currently, the storage device on an S5500-SI series Ethernet switch is the Flash only, which is named flash:.
II. Memory space management
You can use the fixdisk command to restore the space of a storage device or the format command to format a specified storage device as shown in the following table:
To do… |
Use the command… |
Remarks |
Restore the space of a storage device |
fixdisk device |
Optional Available in user view |
Format a storage device |
format device |
Optional Available in user view |
You may use the two commands when some space of a storage device becomes inaccessible due to abnormal operations for example.
Caution:
When you format a storage device, all the files stored on it are erased and cannot be restored. In particular, if there is a startup configuration file on the storage device, formatting the storage device results in loss of the startup configuration file.
1.1.5 File System Prompt Mode Setting
The file system provides the following two prompt modes:
l alert: where the system warns you about operations that may bring undesirable consequence such as file corruption or data loss.
l quiet: where the system does not do that in any cases.
To prevent undesirable consequence resulted from misoperations, the alert mode is preferred.
To do… |
Use the command… |
Remarks |
Enter system view |
system-view |
— |
Set the operation prompt mode of the file system |
file prompt { alert | quiet } |
Optional The default is alert. |
1.1.6 File System Operations Example
# Display the files and the subdirectory under the current directory.
<Sysname> dir
Directory of flash:/
0 drw- - Feb 16 2006 11:45:36 logfile
1 -rw- 1218 Feb 16 2006 11:46:19 config.cfg
2 drw- - Feb 16 2006 15:20:27 test
3 -rw- 184108 Feb 16 2006 15:30:20 aaa.bin
14605 KB total (6890 KB free)
# Create a new folder called mytest under the test directory.
<Sysname> cd test
<Sysname> mkdir mytest
%Created dir flash:/test/mytest.
# Display the current working directory.
<Sysname> pwd
flash:/test
# Display the files and the subdirectory under the test directory.
<Sysname> dir
Directory of flash:/test/
0 drw- - Feb 16 2006 15:28:14 mytest
2540 KB total (2519 KB free)
# Return to the upper directory.
<Sysname> cd ..
# Display the current working directory.
<Sysname> pwd
flash:/
1.2 Configuration File Management
The device provides the configuration file management function with a user-friendly operating interface for you to manage the configuration files conveniently.
This section covers these topics:
l Saving the Current Configuration
l Erasing the Startup Configuration File
l Specifying a Configuration File for Next Startup
l Backing up/Restoring the Configuration File for Next Startup
1.2.1 Configuration File Overview
A configuration file saves the device configurations in command lines in text format. You can view configuration information conveniently through the configuration files.
I. Types of configuration
The configuration of a device falls into two types:
l Saved configuration, a configuration file used for initialization. If this file does not exist, the default parameters are used.
l Current configuration, which refers to the user’s configuration during the operation of a device. This configuration is stored in the flash. It is removed when the device is rebooting.
II. Format of configuration file
Configuration files are saved as text files. They:
l Save configuration in the form of commands.
l Save only non-default configuration settings.
l List commands in sections by view in this view order: system, interface, routing protocol, and so on. Sections are separated with one or multiple blank lines or comment lines that start with a pound sign (#).
l End with a return.
III. Main/backup attribute of the configuration file
A main configuration file and a backup configuration file can exist simultaneously if the device supports main/backup configuration file attribute. As such, when the main configuration file is missing or damaged, the backup file can be used instead. This increases the safety and reliability of the file system compared with the device that only supports one configuration file. You can configure a file to have both the main and backup attributes, but only one file of either main or backup attribute is allowed on a device.
The following three situations are concerned with the main/backup attribute:
l When saving the current configuration, you can specify the file to be a main or backup or normal configuration file.
l When removing a configuration file from a device, you can specify to remove the main or backup configuration file. Or, if it is a file having both the main and backup attributes, you can specify to erase the main or backup attribute of the file.
l When setting the configuration file for next startup, you can specify the main/backup attribute of the file.
IV. Startup with the configuration file
The following steps are taken during system startup:
1) If the main configuration file exists, the device initializes with this configuration.
2) If the main configuration file does not exist but the backup configuration file exists, the device initializes with the backup configuration.
3) If neither the main nor the backup configuration file exists, the device will:
l Initialize with the default configuration file if it exists;
l Or initialize with empty configuration if the default configuration file does not exist.
1.2.2 Saving the Current Configuration
You can modify the configuration on your device at the command line interface (CLI). To use the modified configuration for your subsequent startups, you must save it (using the save command) as a configuration file.
I. Modes in saving the configuration
l Fast saving mode. This is the mode when you use the save command without the safely keyword. The mode saves the file quicker but is likely to lose the original configuration file if the device reboots or the power fails during the process.
l Safe mode. This is the mode when you use the save command with the safely keyword. The mode saves the file slower but can retain the configuration file in the device even if the device reboots or the power fails during the process.
Caution:
Device reboot or the power failure during configuration file saving may result in loss of the configuration file for next startup. In this case, the device should be started with empty configuration and after the device starts, you need to re-specify a configuration file for next startup. Refer to Specifying a Configuration File for Next Startup for details.
II. Attributes of the configuration file when main/backup attribute is supported
l Main attribute. When you use the save [ safely ] [ main ] command to save the current configuration, the configuration file you get has main attribute. If this configuration file already exists and has backup attribute, the file will have both main and backup attributes after execution of this command. If the filename you entered is different from that existing in the system, this command will erase its main attribute to allow only one main attribute configuration file in the device.
l Backup attribute. When you use the save [ safely ] backup command to save the current configuration, the configuration file you get has backup attribute. If this configuration file already exists and has main attribute, the file will have both main and backup attributes after execution of this command. If the filename you entered is different from that existing in the system, this command will erase its backup attribute to allow only one backup attribute configuration file in the device.
l Normal attribute. When you use the save file-name command to save the current configuration, the configuration file you get has normal attribute if it is not an existing file. Otherwise, the attribute is the original attribute of the file.
Follow the step below to save the current configuration:
To do… |
Use the command… |
Remarks |
Save the current configuration |
save [ file-name | [ safely ] [ backup | main ] ] |
Required Available in any view |
& Note:
l Fast saving mode is suitable for environments where power supply is stable. The safe mode, however, is preferred where stable power supply is unavailable or remote maintenance is involved.
l The extension name of the configuration file must be .cfg.
l If you press <Enter> after entering the save command, you can save the configuration file in an interactive way. In this way, you can use the default path or enter a filename to specify a new path, but the suffix of the filename must be “.cfg”.
l In interactive mode, if you use the non-default path (that is, entering a new filename), the system sets the file as the main configuration file for next startup
1.2.3 Erasing the Startup Configuration File
With the configuration file erased, your device will boot up with the default configuration next time it is powered on.
You may need to erase the configuration file for one of these reasons:
l After you upgrade software, the original configuration file does not match the new software.
l The startup configuration file is corrupted or not the one you need.
When main/backup attributes are supported, the following two situations exist:
l While the reset saved-configuration [ main ] command erases the configuration file with main attribute, it only deletes the main attribute of a configuration file having both main and backup attribute.
l While the reset saved-configuration backup command erases the configuration file with backup attribute, it only deletes the backup attribute of a configuration file having both main and backup attribute.
Follow the step below to erase the configuration file:
To do… |
Use the command… |
Remarks |
Erase the startup configuration file from the storage device |
reset saved-configuration [ backup | main ] |
Required Available in user view |
Caution:
This command will permanently delete the configuration file from the device. Use it with caution.
1.2.4 Specifying a Configuration File for Next Startup
You can assign main or backup attribute to the configuration file for next startup when main/backup attributes are supported on your device.
I. Assigning main attribute to the configuration file for next startup
l If you save the current configuration to the main configuration file, the system will automatically set the file as the main startup configuration file.
l You can also use the startup saved-configuration cfgfile main command to set the file as main startup configuration file.
II. Assigning backup attribute to the configuration file for next startup
l If you save the current configuration to the backup configuration file, the system will automatically set the file as the backup startup configuration file.
l You can also use the startup saved-configuration cfgfile backup command to set the file as backup startup configuration file.
Follow the step below to specify a configuration file for next startup:
To do… |
Use the command… |
Remarks |
Specify a configuration file for next startup |
startup saved-configuration cfgfile [ backup | main ] |
Required Available in user view |
Caution:
The configuration file must use “.cfg” as its extension name and the startup configuration file must be saved under the root directory of the device.
1.2.5 Backing up/Restoring the Configuration File for Next Startup
I. Backup/restore function overview
The backup/restore function allows you to backup or restore a configuration file for next startup through operations at the CLI. TFTP is used for intercommunication between the device and the server. The backup function enables you to backup a configuration file to the TFTP server, while the restore function enables you to download the configuration file from the TFTP server for next startup.
& Note:
For H3C S5500-SI series Ethernet swithces, the file to be backed up or restored is the main confiugration file for next startup.
II. Backing up the configuration file for next startup
To do… |
Use the command… |
Remarks |
Back up the configuration file for next startup |
backup startup-configuration to dest-addr [ filename ] |
Required Available in user view |
& Note:
Before backup, you should:
l Ensure that the server is reachable, the server is enabled with TFTP service, and the client has permission to read and write.
l Use the display startup command (in user view) to verify if you have set the startup configuration file, and use the dir command to verify if this file exists. If the file is set as NULL or does not exist, the backup will be unsuccessful.
III. Restoring the startup configuration file
To do… |
Use the command… |
Remarks |
Restore the startup configuration file |
restore startup-configuration from src-addr filename |
Required Available in user view |
& Note:
l Before restoring a configuration file, you should ensure that the server is reachable, the server is enabled with TFTP service, and the client has permission to read and write.
l After the command is successfully executed, you can use the display startup command (in user view) to verify if the filename of the startup configuration file is the same with the filename argument, and use the dir command to verify if the restored file exists.
1.3 Displaying and Maintaining Device Configuration
To do… |
Use the command… |
Remarks |
Display the configuration file saved in the storage device |
display saved-configuration [ by-linenum ] |
Available in any view |
Display the configuration file used for this and next startup |
display startup |
Available in any view |
Display the validated configuration in current view |
display this [ by-linenum ] |
Available in any view |
Display current configuration |
display current-configuration [ [ configuration [ configuration ] | controller | interface [ interface-type ] [ interface-number ] ] [ by-linenum ] [ | { begin | include | exclude } text ] ] |
Available in any view |
& Note:
For detailed description of the display this and display current-configuration commands, refer to the System Maintaining and Debugging Configuration part of the manual.
Chapter 2 FTP Configuration
When configuring FTP, go to these sections for information you are interested in:
l Displaying and Maintaining FTP
2.1 FTP Overview
2.1.1 Introduction to FTP
The File Transfer Protocol (FTP) is an application layer protocol for sharing files between server and client over a TCP/IP network.
FTP uses TCP ports 20 and 21 for file transfer. Port 20 is used to transmit data, and port 21 to transmit control commands. Refer to RFC 959 for details of FTP basic operation.
FTP transmits files in two modes:
l Binary mode for program file transmission
l ASCII mode for text file transmission
2.1.2 Implementation of FTP
FTP adopts the server/client model. Your switch can function either as client or as server (as shown in Figure 2-1). They work in the following way:
l When the switch serves as the FTP client, a PC user first telnets or connects to the switch through an emulation program, then executes the ftp command to establish the connection to the remote FTP server, and gain access to the files on the server. If the remote FTP server supports anonymous FTP, the device can log onto it directly; if not, the device must obtain FTP username and password first to log onto the remote FTP server.
l When the switch serves as the FTP server, it must be configured with an IP address so that a user running FTP client program can access it. For the sake of security, the switch does not support anonymous FTP. Therefore, you must use an authenticated username and password. By default, authenticated users can access the root directory of the switch.
Figure 2-1 Network diagram for FTP
l The FTP function is available when a route exists between the FTP server and the FTP client.
l When a device serving as the FTP server logs onto the device using IE, some IE functions are not supported because multiple user connections are established, and the device supports only one connection currently.
2.2 Configuring the FTP Client
2.2.1 Establishing an FTP Connection
To access an FTP server, the FTP client must connect with it. Two ways are available for the connection: using the ftp command to establish the connection directly; using the open command in FTP client view.
Multiple routes may exist for the FTP client to successfully access the FTP server. You can specify one by configuring the source address of the packets of the FTP client to meet the requirement of the security policy of the FTP client. You can configure the source address by configuring the source interface or source IP address. The primary IP address configured on the source interface is the source address of the transmitted packets. The source address of the transmitted packets is selected following these rules:
l If no source address of the FTP client is specified, a device uses the IP address of the interface determined by the routing protocol as the source IP address to communicate with an FTP server.
l If the source address is specified with the ftp client source or ftp command, this source address is used to communicate with an FTP server.
l If the source address is specified with the ftp client source command and then with the ftp command, the address specified with the latter one is used to communicate with an FTP server.
The source address specified with the ftp client source command is valid for all ftp connections and the source address specified with the ftp command is valid only for the current FTP connection.
Follow these steps to establish an FTP connection (In IPv4 networking):
To do… |
Use the command… |
Remarks |
Enter system view |
system-view |
— |
Configure the source address of the FTP client |
ftp client source { interface interface-type interface-number | ip source-ip-address } |
Optional A device uses the IP address of the interface determined by the routing protocol as the source IP address to communicate with the FTP server by default. |
Exit to system view |
quit |
— |
Log onto the remote FTP server directly in user view |
ftp [ server-address [ service-port ] [ source { interface interface-type interface-number | ip source-ip-address } ] ] |
Use either approach. Available in user view |
Log onto the remote FTP server indirectly in FTP client view |
ftp |
|
open server-address [ service-port ] |
& Note:
l If no primary IP address is configured on the source interface, the FTP connection fails.
l If you use the ftp client source command to first configure the source interface and then the source IP address of the transmitted packets, the new source IP address will overwrite the current one, and vice versa.
Follow these steps to establish an FTP connection (In IPv6 networking):
To do… |
Use the command… |
Remarks |
Log onto the remote FTP server directly in user view |
ftp ipv6 [ server-address [ service-port ] [ source ipv6 source-ipv6-address ] [ -i interface-type interface-number ] ] |
Use either approach. Available in user view |
Log onto the remote FTP server indirectly in FTP client view |
ftp ipv6 |
|
open ipv6 server-address [ service-port ] [ -i interface-type interface-number ] |
2.2.2 Configuring the FTP Client
After a device serving as the FTP client has established a connection with the FTP server (For establishing FTP connection, refer to Establishing an FTP Connection.), the device can perform the following operations for the authorized directory:
To do… |
Use the command… |
Remarks |
Display help information of FTP-related commands supported by the remote FTP server |
remotehelp [ protocol-command ] |
Optional |
Enable information display in a detailed manner |
verbose |
Optional Enabled by default |
Use other username to relog after logging onto the FTP server successfully |
user username [ password ] |
Optional |
Enable FTP client debugging |
debugging |
Optional Disabled by default |
Set the file transfer mode to ASCII |
ascii |
Optional ASCII by default |
Set the file transfer mode to binary |
binary |
Optional ASCII by default |
Change the working path on the remote FTP server |
cd pathname |
Optional |
Exit the current directory and enter the upper level directory |
cdup |
Optional |
Display files/directories information on the FTP server |
dir [ remotefile [ localfile ] ] |
Optional |
Check files/directories on the FTP server |
ls [ remotefile [ localfile ] ] |
Optional |
Download a file from the FTP server |
get remotefile [ localfile ] |
Optional |
Upload a file to the FTP server |
put localfile [ remotefile ] |
Optional |
View the working directory of the remote FTP server |
pwd |
Optional |
Find the working path of the FTP client |
lcd |
Optional |
Create a directory on the FTP server |
mkdir directory |
Optional |
Set the data transfer mode to passive |
passive |
Optional Passive by default |
Delete specified file on the FTP server |
delete remotefile |
Optional |
Delete specified directory on the FTP server |
rmdir directory |
Optional |
Disconnect with the FTP server without exiting the FTP client view |
disconnect |
Optional Equal to the close command |
Disconnect with the FTP server without exiting the FTP client view |
close |
Optional Equal to the disconnect command |
Disconnect with the FTP server and exit to user view |
bye |
Optional |
Terminate the connection with the remote FTP server, and exit to user view |
quit |
Optional Available in FTP client view, equal to the bye command |
& Note:
l FTP uses two modes for file transfer: ASCII mode and binary mode.
l The Is command can only display the file/directory name, while the dir command can display more information, such as the size and date of creation of files or directories.
2.2.3 FTP Client Configuration Example
I. Network requirements
l Use your device as an FTP client to download a startup file from the FTP server.
l The IP address of the FTP server is 10.1.1.1/16.
l On the FTP server, an FTP user account has been created for the FTP client, with the username being abc and the password being pwd.
l The PC performs operations on the device through Console port.
II. Network diagram
Figure 2-2 Network diagram for FTPing an image file from an FTP server
III. Configuration procedure
# Check files on your device. Remove those redundant to ensure adequate space for the startup file to be downloaded.
<Sysname> dir
Directory of flash:/
0 drw- - Dec 07 2005 10:00:57 filename
1 drw- - Jan 02 2006 14:27:51 logfile
2 -rw- 1216 Jan 02 2006 14:28:59 config.cfg
3 -rw- 1216 Jan 02 2006 16:27:26 backup.cfg
14605 KB total (6890 KB free)
<Sysname> delete /unreserved flash:/backup.cfg
# Download the startup file from the server.
<Sysname> ftp 10.1.1.1
Trying 10.1.1.1.
Press CTRL+K to abort
Connected to 10.1.1.1
220 FTP service ready
User(10.1.1.1:(none)):abc
331 Give me your password, please
Password:
331 Password required for abc.
Password:
230 User logged in.
[ftp] binary
200 Type set to I.
[ftp] get aaa.bin bbb.bin
227 Entering Passive Mode (10.1.1.1,4,1).
125 BINARY mode data connection already open, transfer starting for aaa.bin.
.....226 Transfer complete.
FTP: 5805100 byte(s) received in 19.898 second(s) 291.74Kbyte(s)/sec.
[ftp] bye
# You can use the boot-loader command to specify the downloaded file as the main startup file for next startup. Then restart the device and the startup file of the device is updated.
<Sysname> boot-loader file bbb.bin main
<Sysname> reboot
Caution:
Startup files for next startup must be saved under the root directory. You can copy or move a file to change the path of it to the root directory. For description of the corresponding command, refer to the System Maintaining and Debugging part of the manual.
2.3 Configuring the FTP Server
2.3.1 Configuring FTP Server Operating Parameters
The FTP server uses two modes to update files when you upload files (use the put command) to the FTP server:
l In fast mode, the FTP server starts writing data to the Flash after file transfer completes. This protects the files intended to be overwritten on the device from being corrupted in the event that anomalies, power failure for example, occur during a file transfer.
l In normal mode, the FTP server writes data to the Flash during file transfer. This means that any anomaly, power failure for example, during file transfer might result in file corruption on the router. This mode, however, consumes less memory space than the fast mode.
Follow these steps to configure the FTP server:
To do… |
Use the command… |
Remarks |
Enter system view |
system-view |
— |
Enable the FTP server |
ftp server enable |
Required Disabled by default. |
Configure the idle-timeout timer |
ftp timeout minutes |
Optional 30 minutes by default. In idle-timeout time, if there is no information interaction between the FTP server and client, the connection between them is terminated. |
Set the file update mode in FTP |
ftp update { fast | normal } |
Optional Normal update is used by default. |
2.3.2 Configuring Authentication and Authorization for Accessing FTP Server
To allow an FTP user to access certain directories on the FTP server, you need to create an account for the user, authorizing access to the directories and associating the username and password with the account.
Follow these steps to configure authentication and authorization for FTP server:
To do… |
Use the command… |
Remarks |
Enter system view |
system-view |
— |
Create a local user and enter its view |
local-user user-name |
Required No local user exists by default, and the system does not support FTP anonymous user access. |
Assign a password to the user |
password { simple | cipher } password |
Required |
Assign the FTP service to the user |
service-type ftp |
Required By default, the system does not support anonymous FTP access, and does not assign any service. If the FTP service is assigned, the root directory of the device is used by default. |
Specify the directory an FTP user can access |
work-directory directory-name |
Optional By default, the FTP/SFTP users can access the root directory of the device. |
Set the priority level of the FTP user |
level level |
Optional 0 by default To upload files to an FTP server, you need to set the FTP user level to 3. |
& Note:
If FTP server performs authentication, authorization and accounting (AAA) policy on FTP client, AAA related parameters should be configured on the FTP server. For more information about the local-user, password, service-type ftp, work-directory,and level commands and the AAA related configuration, refer to the AAA-RADIUS-HWTACACS Configuration part of the manual.
2.3.3 FTP Server Configuration Example
I. Network requirements
l Use your device as an FTP server. Create a user account for an FTP user on it, setting the username to abc and the password to pwd.
l The IP address of the Ethernet interface is 1.1.1.1/16.
l The PC serves as the FTP client.
II. Network diagram
Figure 2-3 Smooth upgrading using the FTP server
III. Configuration procedure
1) Configure Device (FTP Server)
# Create an FTP user account abc, setting its password to pwd.
<Sysname> system-view
[Sysname] local-user abc
[Sysname-luser-abc] password simple pwd
# Specify abc to use FTP, and authorize its access to certain directory.
[Sysname-luser-abc] service-type ftp
[Sysname-luser-abc] work-directory flash:/
[Sysname-luser-abc] quit
# Enable FTP server.
[Sysname] ftp server enable
[Sysname] quit
# Check files on your device. Remove those redundant to ensure adequate space for the startup file to be uploaded.
<Sysname> dir
Directory of flash:/
0 drw- - Dec 07 2005 10:00:57 filename
1 drw- - Jan 02 2006 14:27:51 logfile
2 -rw- 1216 Jan 02 2006 14:28:59 config.cfg
3 -rw- 1216 Jan 02 2006 16:27:26 back.cfg
4 drw- - Jan 02 2006 15:20:21 ftp
2540 KB total (2511 KB free)
<Sysname> delete /unreserved flash:/back.cfg
2) Configure the PC (FTP Client)
# Upload the startup file to the FTP server and save it under the root directory of the FTP server.
c:\> ftp 1.1.1.1
Connected to 1.1.1.1.
220 FTP service ready.
User(1.1.1.1:(none)):abc
331 Password required for abc.
Password:
230 User logged in.
ftp> put aaa.bin bbb.bin
& Note:
l When upgrading the configuration file with FTP, put the new file under the root directory.
l After you finish upgrading the Boot ROM program through FTP, you must execute the bootrom upgrade command to refresh the system configuration.
# You can use the boot-loader command to specify the uploaded file as the main startup file for next startup. Then restart the device and the startup file of the device is updated.
<Sysname> boot-loader file bbb.bin main
<Sysname> reboot
Caution:
Startup files for next startup must be saved under the root directory. You can copy or move a file to change the path of it to the root directory. For description of the corresponding command, refer to the System Maintaining and Debugging part of the manual.
2.4 Displaying and Maintaining FTP
To do… |
Use the command… |
Remarks |
Display the configuration of the FTP client |
display ftp client configuration |
Available in any view |
Display the configuration of the FTP server |
display ftp-server |
Available in any view |
Display detailed information about logged-in FTP users |
display ftp-user |
Available in any view |
Chapter 3 TFTP Configuration
When configuring TFTP, go to these sections for information you are interested in:
l Displaying and Maintaining the TFTP Client
l TFTP Client Configuration Example
3.1 TFTP Overview
3.1.1 Introduction to TFTP
The Trivial File Transfer Protocol (TFTP) provides functions similar to those provided by FTP, but it is not as complex as FTP in interactive access interface and authentication. Therefore, it is more suitable where complex interaction is not needed between client and server.
TFTP uses the UDP port 69 for data transmission. For TFTP basic operation, refer to RFC 1350.
In TFTP, file transfer is initiated by the client.
l In a normal file downloading process, the client sends a read request to the TFTP server, receives data from the server, and then sends the acknowledgement to the server.
l In a normal file uploading process, the client sends a write request to the TFTP server, sends data to the server, and receives the acknowledgement from the server.
TFTP transfers files in two modes:
l Binary for program files
l ASCII for text files.
3.1.2 Implementation of TFTP
& Note:
Only the TFTP client service is available with your device at present.
Figure 3-1 TFTP configuration diagram
Before using TFTP, the administrator needs to configure IP addresses for the TFTP client and server, and make sure that there is a route between the TFTP client and server.
3.2 Configuring the TFTP Client
When a device acts as a TFTP client, you can upload files on the device to a TFTP server and download files from the TFTP server to the local device. You can use either of the following ways to download files:
l Normal download: The device writes the obtained files to the storage device directly. In this way, the original system file will be overwritten and if file download fails (for example, due to network disconnection), the device cannot start up normally because the original system file has been deleted.
l Secure download: The device saves the obtained files to its memory and does not write them to the storage device until all user files are obtained. In this way, if file download fails (for example, due to network disconnection), the device can still start up because the original system file is not overwritten. This mode is securer but consumes more memory.
You are recommended to use the latter mode or use a filename not existing in the current directory as the target filename when downloading startup file or configuration file.
Multiple routes may exist for a TFTP client to successfully access the TFTP server. You can specify one by configuring the source address of the packets from the TFTP client to meet the requirement of the security policy of the TFTP client. You can configure the source address by configuring the source interface or source IP address. The primary IP address configured on the source interface is the source address of the transmitted packets. The source address of the transmitted packets is selected following these rules:
l If no source address of the TFTP client is specified, a device uses the IP address of the interface determined by the routing protocol as the source IP address to communicate with a TFTP server.
l If the source address is specified with the tftp client source or tftp command, this source address is adopted.
l If the source address is specified with the tftp client source command and then with the tftp command, the source address configured with the latter one is used to communicate with a TFTP server.
The source address specified with the tftp client source command is valid for all tftp connections and the source address specified with the tftp command is valid only for the current tftp connection.
Follow these steps to configure the TFTP client:
To do… |
Use the command… |
Remarks |
Enter system view |
system-view |
— |
Reference an access control list (ACL) to the TFTP server |
tftp-server [ ipv6 ] acl acl-number |
Optional |
Configure the source address of the TFTP client |
tftp client source { interface interface-type interface-number | ip source-ip-address } |
Optional A device uses the source address determined by the routing protocol to communicate with the TFTP server by default. |
Return to user view |
quit |
— |
Download or upload a file in IPv4 network |
tftp server-address { get | put | sget } source-filename [ destination-filename ] [ source { interface interface-type interface-number | ip source-ip-address } ] |
Optional |
Download or upload a file in IPv6 network |
tftp ipv6 tftp-ipv6-server [ -i interface-type interface-number ] { get | put } source-file [ destination-file ] |
Optional |
& Note:
l If no primary IP address is configured on the source interface, TFTP connection fails.
l If you use the ftp client source command to first configure the source interface and then the source IP address of the packets of the TFTP client, the new source IP address will overwrite the current one, and vice versa.
3.3 Displaying and Maintaining the TFTP Client
To do… |
Use the command… |
Remarks |
Display the configuration of the TFTP client |
display tftp client configuration |
Available in any view |
3.4 TFTP Client Configuration Example
I. Network requirements
l Use a PC as the TFTP server and your device as the TFTP client.
l PC uses IP address 1.2.1.1./16 and a TFTP working directory has been defined for the client.
l On your device, VLAN-interface 1 is assigned an IP address 1.1.1.1/16. Make sure that the port connected to PC belongs to the same VLAN.
l TFTP a startup file from PC for upgrading and a configuration file config.cfg to PC for backup.
II. Network diagram
Figure 3-2 Smooth upgrading using the TFTP client function
III. Configuration procedure
1) Configure PC (TFTP Server), the configuration procedure omitted.
l On the PC, enable TFTP server
l Configure a TFTP working directory
2) Configure the device (TFTP Client)
Caution:
If the free memory space of the device is not big enough, you should delete the existing programs before downloading new ones.
# Enter system view.
<Sysname> system-view
# Assign VLAN-interface 1 an IP address 1.1.1.1/16, making sure that the port connected to PC belongs to the same VLAN.
[Sysname] interface vlan-interface 1
[Sysname-Vlan-interface1] ip address 1.1.1.1 255.255.0.0
[Sysname-Vlan-interface1] return
# Download an application file aaa.bin from the TFTP server. (Before that, make sure that adequate memory is available.)
<Sysname> tftp 1.2.1.1 get aaa.bin bbb.bin
# Upload a configuration file config.cfg to the TFTP server.
<Sysname> tftp 1.2.1.1 put config.cfg configback.cfg
# You can use the boot-loader command to specify the uploaded file as the main startup file for next startup. Then restart the device and the startup file of the device is updated.
<Sysname> boot-loader file bbb.bin main
<Sysname> reboot
Caution:
Startup files for next startup must be saved under the root directory. You can copy or move a file to change the path of it to the root directory. For description of the corresponding command, refer to the System Maintaining and Debugging part of the manual.