An app file is an executable file, with .bin
as the extension. A configuration file is used to store and restore
configuration, with .cfg as the extension. A Web file is used for Web-based
network management, with .web as the extension.
The app file, configuration file, and Web
file have three kinds of attributes: main, backup and none, as described in Table 1-1.
Table 1-1 Descriptions on file attributes
|
Attribute name
|
Description
|
Feature
|
Identifier
|
|
main
|
Identifies main startup files. The main
startup file is used first for a switch to start up.
|
In the Flash memory, there can be only
one app file, one configuration file and one Web file with the main
attribute.
|
(*)
|
|
backup
|
Identifies backup startup files. The backup
startup file is used after a switch fails to start up using the main startup
file.
|
In the Flash memory, there can be only
one app file, one configuration file and one Web file with the backup
attribute.
|
(b)
|
|
none
|
Identifies files that are neither of main
attribute nor backup attribute.
|
—
|
None
|
A file can have
both the main and backup attributes. Files of this kind are labeled *b.
If a newly created file is configured to be
with the main attribute, the existing file with the main attribute in the Flash
memory will be changed to other attribute. This ensures that there can be only
one app file, one configuration file and one Web file with the main attribute
in the Flash memory. This circumstance also applies to the file with the backup
attribute in the Flash memory.
File operations and file attribute
operations are independent. For example, if you delete a file with the main
attribute from the Flash memory, the other files in the flash memory will not
possess the main attribute. If you download a file with the same name as the original
file with the main attribute to the flash memory, the file will possess the
main attribute.
After the BootROM of a switch is upgraded,
the original default APP startup file has the main attribute.
You can configure and view the main
attribute or backup attribute of the startup file used for the next startup of a
switch, and change the main or backup attribute of the file.
Perform the configuration listed in Table 1-2 in user view. The display commands can be executed in any
view.
Table 1-2 Configure file attributes
|
To do…
|
Use the command…
|
Remarks
|
|
Configure the app file with the main
attribute for the next startup
|
boot boot-loader
file-url
|
Optional
|
|
Set the app file with the backup
attribute for the next startup
|
boot boot-loader
backup-attribute file-url
|
Optional
|
|
Configure the Web file and its attribute
|
boot web-package
webfile { backup | main }
|
Optional
|
|
Switch the file attributes between main
and backup
|
boot attribute-switch
{ all | app | configuration | web }
|
Optional
|
|
Specify to enable user to use the
customized password to enter the BOOT menu
|
startup bootrom-access enable
|
Optional
By default, the user is enabled to use
the customized password to enter the BOOT menu.
|
|
Display the information about the app
file used as the startup file
|
display boot-loader [ unit unit-id ]
|
Optional
This command can be executed in any view.
|
Caution:
l
The configuration of the main or backup attribute
of a Web file takes effect immediately without restarting the switch.
l
After upgrading a Web file, you need to specify the
new Web file in the Boot menu after restarting the switch. Otherwise, the Web
server cannot function normally.
l
Currently, a configuration file has the
extension of cfg and resides in the root directory of the Flash memory.
To facilitate management on the Flash memory,
Ethernet switches provide the file system module. The file system allows users
to create/delete a directory, display the current work directory, display the
contents of a directory, and access files.
By default, a switch prompts for
confirmation before executing the commands which have potential risks (for
example, deleting and overwriting files).
Table 1-3
Configuration tasks on the file system
1.2.3 Directory Operations
The file system provides directory-related functions,
such as:
l
Creating/deleting a directory
l
Displaying the current work directory, or contents
in a specified directory
Table 1-4 describes the directory-related operations.
Perform the following configuration in user
view.
Table 1-4 Directory
operations
|
To do…
|
Use the command…
|
Remarks
|
|
Create a directory
|
mkdir directory
|
Optional
|
|
Delete a directory
|
rmdir directory
|
Optional
Only empty directories can be deleted.
|
|
Display the current work directory
|
pwd
|
Optional
|
|
Display the information about specific directories
and files
|
dir [ /all
] [ file-url ]
|
Optional
|
|
Enter a specified directory
|
cd directory
|
Optional
|
In the output information of the dir /all command,
deleted files (that is, those in the recycle bin) are embraced in brackets.
The file system also provides file-related functions,
such as:
l
Deleting a file
l
Restoring a deleted file
l
Deleting a file permanently
l
Managing a configuration file
l
Renaming a file
l
Copying a file
l
Moving a file
l
Displaying the content of a file
l
Displaying the information about a file
l
Checking file system
Perform the following configuration in user
view. Note that the execute command should be executed in system view,
and the display command can be executed in any view.
Table 1-5 File operations
|
To do…
|
Use the command…
|
Remarks
|
|
Delete a file
|
delete [ /unreserved
] file-url
delete { running-files
| standby-files } [ /unreserved ]
|
Optional
A deleted file can be restored if you
delete it by executing the delete command without specifying the /unreserved
keyword. You can use the undelete command to restore a deleted file of
this kind.
|
|
Delete a file from the recycle bin
|
reset recycle-bin [ file-url ] [ /force ]
reset recycle-bin
|
Optional
|
|
Rename a file
|
rename
fileurl-source fileurl-dest
|
Optional
|
|
Copy a file
|
copy
fileurl-source fileurl-dest
|
Optional
|
|
Move a file
|
move fileurl-source
fileurl-dest
|
Optional
|
|
Display the content of a file
|
more file-url
|
Optional
Currently, the file system only supports
displaying the contents of a file in texts.
|
|
Display the information about a directory
or a file
|
dir [ /all
] [ file-url ]
|
Optional
|
|
Execute the specified batch file
|
execute filename
|
Optional
This command should be executed in system
view.
|
Caution:
l
For deleted files whose names are the same, only
the latest deleted file is kept in the recycle bin and can be restored.
l
The files which are deleted by the delete
command without the /unreserved keyword are actually moved to the
recycle bin and thus still take storage space. You can clear the recycle bin by
using the reset recycle-bin command.
l
Use the update fabric command after all traffic
flows are stopped.
l
The dir /all command displays the files in
the recycle bin in square brackets.
l
If the configuration files are deleted, the
switch adopts the default configuration parameters when it starts up next time.
Perform the following Flash memory operations.
Table 1-6 Operations
on the Flash memory
|
To do…
|
Use the command…
|
Remarks
|
|
Format the Flash memory
|
format device
|
Required
|
|
Restore space on the Flash memory
|
fixdisk device
|
Required
|
Caution:
The format
operation leads to the loss of all files, including the configuration files, on
the Flash memory and is irretrievable.
You can set the prompt mode of the current
file system to alert or quiet. In alert mode, the file system
will give a prompt for confirmation if you execute a command which may cause
data loss, for example, deleting or overwriting a file. In quiet mode, such
prompt will not be displayed.
Table 1-7 Configuration
on prompt mode of file system
|
To do…
|
Use the command…
|
Remarks
|
|
Enter
system view
|
system-view
|
—
|
|
Configure
the prompt mode of the file system
|
file
prompt { alert | quiet }
|
Required
By default,
the prompt mode of the file system is alert.
|
# Display all the files in the root
directory of the file system.
<H3C> dir /all
Directory of unit1>flash:/
1 (*) -rw- 5822215 Jan 01
1970 00:07:03 s3100-52p.bin
2 -rwh 4 Apr 01
2000 23:55:49 snmpboots
3 -rwh 428 Apr 02
2000 00:47:30 hostkey
4 -rwh 572 Apr 02
2000 00:47:38 serverkey
5 -rw- 1220 Apr 02
2000 00:06:57 song.cfg
6 -rw- 5026103 Jan 01
1970 00:04:34 s3100-52pv1r1.bin
7 -rwh 88 Apr 01
2000 23:55:53 private-data.txt
8 (*) -rw- 1376 Apr 02
2000 01:56:28 config.cfg
15367 KB total (4634 KB free)
(*) -with main attribute (b) -with
backup attribute
(*b) -with both main and backup
attribute
# Copy the file flash:/config.cfg to flash:/test/,
with 1.cfg as the name of the new file.
<H3C> copy flash:/config.cfg
flash:/test/1.cfg
Copy unit1>flash:/config.cfg to
unit1>flash:/test/1.cfg?[Y/N]:y
..
%Copy file unit1>flash:/config.cfg
to unit1>flash:/test/1.cfg...Done.
# Display the file information after the
copy operation.
<H3C> dir
/all
Directory of unit1>flash:/
1 (*) -rw- 5822215 Jan 01
1970 00:07:03 s3100-52p.bin
2 -rwh 4 Apr 01
2000 23:55:49 snmpboots
3 -rwh 428 Apr 02
2000 00:47:30 hostkey
4 -rwh 572 Apr 02
2000 00:47:38 serverkey
5 -rw- 1220 Apr 02
2000 00:06:57 song.cfg
6 -rw- 5026103 Jan 01 1970
00:04:34 s3100-52pv1r1.bin
7 -rwh 88 Apr 01
2000 23:55:53 private-data.txt
8 (*) -rw- 1376 Apr 02
2000 01:56:28 config.cfg
9 drw- - Apr 04
2000 04:50:07 test
15367 KB total (4631 KB free)
(*) -with main attribute (b) -with
backup attribute
(*b) -with both main and backup
attribute
<H3C> dir unit1>flash:/test/
Directory of unit1>flash:/test/
1 -rw- 1376 Apr 04
2000 04:50:30 1.cfg
15367 KB total (2025 KB free)
(*) -with main attribute (b) -with
backup attribute
(*b) -with both main and backup
attribute
File transfer protocol (FTP) is a commonly
used protocol to transfer files over the Internet and IP networks. Before the
emergence of World Wide Web (WWW), users transfer files with command lines
mostly using the FTP.
FTP is an application-layer protocol in the
TCP/IP protocol suite. It is used for file transfer between remote server and
local host.
The Ethernet switch provides the following
FTP services:
l
FTP server: A user runs FTP client on a PC and
logs into an FTP server (the network administrator should configure the IP
address of the FTP server before the user log in). Then the user can access the
files on the FTP server.
l
FTP client: A user runs a terminal emulation
program or Telnet program on a PC and connects to the Ethernet switch which
acts as an FTP client. After that, the user enter the ftp X.X.X.X
command (where, X.X.X.X represents the IP address of an FTP server) to
establish a connection between the Ethernet switch and a remote FTP server.
Then, the user can access the files on the remote FTP server.
2.1.2 FTP Lighting Procedure
Caution:
The FTP server and
the FTP client must be reachable to each other.
I. Enabling FTP server on the switch
After FTP server is enabled on an S3100-52P
switch, the seven-segment digital LED on the front panel of the switch will
rotate clockwise when an FTP client is uploading file to the FTP server (the S3100-52P
switch), and will stop rotating when the file uploading is finished, as show in
Figure 2-1.

Figure 2-1 Clockwise rotating of the seven-segment digital LED
Table 2-1 Configuration
for file upload from an FTP client to the switch acting as FTP server
|
Device
|
To do…
|
Use the command…
|
Remarks
|
|
FTP server
|
Enable FTP
server
|
ftp
sever enable
|
Required
By
default, FTP server is disabled.
|
|
Add a
local user and enter local user view
|
local-user
user-name
|
Required
|
|
Set a
password for the local user
|
password { simple | cipher } password
|
Required
|
|
Set the
password display mode for local users
|
local-user password-display-mode { auto | cipher-force
}
|
Optional
By
default, the mode is auto (that is, the switch displays user passwords
in the modes configured when the passwords are set).
|
|
FTP client
|
Log into the remote FTP server
|
—
|
Required
For detailed configuration, refer to the
configuration instruction relevant to FTP client.
|
|
Upload file from the FTP client to the
FTP server
|
—
|
Required
For detailed configuration, refer to the
configuration instruction relevant to FTP client.
|
II. Enabling FTP client on the switch
After FTP client is enabled on an S3100-52P
switch, the seven-segment digital LED on the front panel of the switch will
rotate clockwise when the FTP client (the S3100-52P switch) is downloading file
from an FTP server, and will stop rotating when the file downloading is
finished, as show in Figure 2-1.
Table 2-2 Configuration
for file download from an FTP server to the switch acting as an FTP client
|
Device
|
To do…
|
Use the command…
|
Remarks
|
|
FTP server
|
Enable FTP server
|
—
|
Required
For detailed configuration, refer to the
configuration instruction relevant to FTP server.
|
|
Configure authentication/authorization of
the FTP server
|
—
|
Required
For detailed configuration, refer to the
configuration instruction relevant to FTP server.
|
|
FTP client
|
Log into the remote FTP server
|
ftp [ ipaddress
[ port ] ]
|
Required
l
The switch acts as an FTP client by default.
l
The user should first obtain an FTP user name
and password, then log into the remote FTP server. Only after that, can the
user obtain the access rights of corresponding directory and file.
l
When the user logs into the FTP server, the
switch enters FTP client command view.
|
|
Download files from the remote FTP server
and save the files to the local device
|
get remotefile
[ localfile ]
|
Required
If no local file name is specified, the
system will save the file from the remote FTP server to the local device
using the original file name.
|
|
|
|
|
|
Compared with FTP, trivial file transfer
protocol (TFTP) does not provide complex interactive access interface and
authentication control, and is suitable for the environments that do not need complex
interaction. TFTP is implemented based on user datagram protocol (UDP).
The TFTP file transfer is initiated by a
client in the following scenarios:
l
When a file needs to be downloaded, the client
sends a read request to the TFTP server. It then receives data from the server
and sends acknowledgement to the server.
l
When a file needs to be uploaded, the client
sends a write request to the TFTP server. It then sends data to the server and
receives acknowledgement from the server.
TFTP can transfer files in two formats:
l
Binary: used to transfer programs.
l
ASCII code: used to transfer text files.
Before configuring TFTP, the network
administrator should first configure the IP addresses of the TFTP client and
server and ensure that the client and the server are reachable to each other.
The switch can only act as a TFTP client.

Figure 2-2 Network diagram for TFTP configuration
Caution:
The TFTP server and
the TFTP client must be reachable to each other.
After TFTP client is enabled on an S3100-52P
switch, the seven-segment digital LED on the front panel of the switch will
rotate clockwise when the TFTP client (the S3100-52P switch) is downloading
file from a TFTP server, and will stop rotating when the file downloading is
finished, as show in Figure 2-1.
Table 2-3 Download
file from an TFTP server to the switch acting as an TFTP client
|
Device
|
To do…
|
Use the command…
|
Remarks
|
|
TFTP server
|
Enable TFTP server
|
—
|
Required
For detailed configuration, refer to the
configuration instruction relevant to TFTP server.
|
|
TFTP client
|
Log into a remote TFTP server, download
and save a remote file to the local device
|
tftp tftp-server get source-file [ dest-file ]
|
Required
This command should be executed in user
view.
|