• 产品与解决方案
  • 行业解决方案
  • 服务
  • 支持
  • 合作伙伴
  • 新华三人才研学中心
  • 关于我们

H3C S3600系列以太网交换机 命令手册-RELEASE 1510(V1.04)

36-文件系统管理命令

本章节下载  (270.72 KB)

docurl=/cn/Service/Document_Software/Document_Center/Switches/Catalog/S3600/S3600-SI/Command/Command_Manual/S3600-SI_CM(V1.04)/200711/317231_30005_0.htm

36-文件系统管理命令

  录

第1章 文件系统管理配置命令... 1-1

1.1 文件属性配置命令.. 1-1

1.1.1 boot attribute-switch. 1-1

1.1.2 boot boot-loader 1-2

1.1.3 boot boot-loader backup-attribute. 1-3

1.1.4 boot web-package. 1-3

1.1.5 display boot-loader 1-4

1.1.6 startup bootrom-access enable. 1-5

1.2 文件系统配置命令.. 1-5

1.2.1 cd. 1-5

1.2.2 copy. 1-6

1.2.3 delete. 1-7

1.2.4 dir 1-8

1.2.5 execute. 1-10

1.2.6 file prompt 1-11

1.2.7 fixdisk. 1-12

1.2.8 format 1-12

1.2.9 mkdir 1-13

1.2.10 more. 1-13

1.2.11 move. 1-14

1.2.12 pwd. 1-15

1.2.13 rename. 1-15

1.2.14 reset recycle-bin. 1-16

1.2.15 rmdir 1-16

1.2.16 undelete. 1-17

1.2.17 update fabric. 1-17

1.3 配置文件备份与恢复命令.. 1-19

1.3.1 backup current-configuration. 1-19

1.3.2 restore startup-configuration. 1-20

第2章 FTP/TFTP点灯相关配置命令... 2-1

2.1 FTP配置命令.. 2-1

2.1.1 ftp server enable. 2-1

2.1.2 local-user 2-1

2.1.3 local-user password-display-mode. 2-2

2.1.4 password. 2-3

2.1.5 ftp. 2-4

2.1.6 get 2-4

2.2 TFTP配置命令.. 2-5

2.2.1 tftp get 2-5

 


第1章  文件系统管理配置命令

&  说明:

支持IRF(Intelligent Resilient Framework,智能弹性架构)的以太网交换机中,输入文件有下面三种形式:

l      如果输入文件的URL形式以“unit [No.]>flash:/”开头([No.]是交换机的Unit ID),则表示指定Unit上的文件。例如,如果交换机的Unit ID为1,交换机上根路径下的text.txt文件的URL必须是“unit1>flash:/text.txt”。

l      如果输入文件的URL形式以“flash:/”开头,则表示当前本地Unit的Flash上的文件。

l      如果用户直接输入路径名或者文件名,则表示当前工作路径下的路径或者文件。

 

1.1  文件属性配置命令

1.1.1  boot attribute-switch

【命令】

boot attribute-switch { all | app | configuration | web } fabric

【视图】

用户视图

【参数】

all:所有文件,包括App文件、配置文件和Web文件。

app:App文件。

configuration:配置文件。

web:Web文件。

fabric:在整个Fabric上进行设置。

【描述】

boot attribute-switch命令用来切换文件的主备属性,即把原来的主属性文件变为备属性文件,或者把原来的备属性文件变为主属性文件。

【举例】

# 切换Fabric中所有文件的主备属性。

<H3C> boot attribute-switch all fabric

 The boot, web and configuration file's backup-attribute and main-attribute will exchange.                                                                 

 Are you sure? [Y/N] y                                                          

 The boot, web and configuration file's backup-attribute and main-attribute successfully exchanged on unit 1!                                             

 The boot, web and configuration file's backup-attribute and main-attribute successfully exchanged on unit 2!    

1.1.2  boot boot-loader

【命令】

boot boot-loader file-url [ fabric ]

【视图】

用户视图

【参数】

file-url:Flash中App文件的路径名或文件名,1~64位字符串。

fabric:在整个Fabric上进行设置。

【描述】

boot boot-loader命令用来设置Fabric或者Fabric中某个设备的App文件主属性,该App文件将作为交换机下次启动时的首选启动文件。

boot boot-loader命令不使用fabric关键字时表示只在本地Unit进行设置。

  注意:

在Fabric中设置文件主备属性的前提要求Fabric中所有设备都存在该文件。以太网交换机不支持指定其他Unit的Flash中的App文件作为本地Unit的App启动文件。

 

【举例】

# 设置Fabric的主启动文件为boot.bin。

<H3C> boot boot-loader boot.bin fabric

 The specified file will be booted next time on unit 1!

 The specified file will be booted next time on unit 2!

1.1.3  boot boot-loader backup-attribute

【命令】

boot boot-loader backup-attribute file-url [ fabric ]

【视图】

用户视图

【参数】

file-url:Flash中App文件的路径名或文件名,1~64位字符串。

fabric:在整个Fabric上进行设置。

【描述】

boot boot-loader backup-attribute命令用来设置Fabric或者Fabric中某个设备的App启动文件的备属性,该App文件将作为下次启动时的备选启动文件。当主属性文件不存在或无法使用时,交换机就使用备属性文件启动。

boot boot-loader backup-attribute命令不使用fabric关键字时表示只在本地Unit进行设置。

  注意:

在Fabric中设置文件主备属性的前提要求Fabric中所有设备都存在该文件。以太网交换机不支持指定其他Unit的Flash中的App文件作为本地Unit的App启动文件。

 

【举例】

# 设置Fabric中备启动文件为backup.bin。

<H3C> boot boot-loader backup-attribute backup.bin fabric

 Set boot file backup-attribute successfully on unit 1!

 Set boot file backup-attribute successfully on unit 2!

1.1.4  boot web-package

【命令】

boot web-package webfile { backup | main }

【视图】

用户视图

【参数】

webfile:Web文件名称,5~127位字符串(包括扩展名.web)。

main:文件主属性。

backup:文件备属性。

【描述】

boot web-package命令用来设置Fabric中Web文件的主属性和备属性。

  注意:

l      设置Web文件主备属性的前提要求Fabric中所有设备都存在该Web文件。

l      Web文件的主备属性设置完成后立即生效,不用重启设备。

l      升级Web文件后,用户需要重启后在Boot菜单里指定新Web文件,否则用户不能正常使用Web Server功能。

 

【举例】

# 设置boot.web文件的属性为main。

<H3C> boot web-package boot.web main

1.1.5  display boot-loader

【命令】

display boot-loader [ unit unit-id ]

【视图】

任意视图

【参数】

unit unit-id:交换机的Unit ID。

【描述】

display boot-loader命令用来显示Fabric或者Fabric中某一设备的App启动文件信息,包括当前启动的App文件名、主属性和备属性的App文件名。

display boot-loader命令不使用unit unit-id时显示整个Fabric中的设置。

【举例】

# 显示Unit 1的App启动文件信息。

<H3C> display boot-loader unit 1

 Unit 1

   The current boot app is: s3600.bin              

   The main boot app is:     s3600.bin              

   The backup boot app is:   s3600bak.bin           

1.1.6  startup bootrom-access enable

【命令】

startup bootrom-access enable

undo startup bootrom-access enable

【视图】

用户视图

【参数】

【描述】

startup bootrom-access enable命令用来使能系统启动过程中用户使用自定义密码进入BOOT主菜单的功能。undo startup bootrom-access enable命令用来关闭用户使用自定义密码进入BOOT主菜单的功能。

缺省情况下,用户使用自定义密码进入BOOT主菜单的功能处于开启状态。

用户可以通过display startup命令查看以上命令的执行结果。

【举例】

# 使能用户使用自定义密码进入BOOT主菜单的功能。

<H3C> startup bootrom-access enable

1.2  文件系统配置命令

&  说明:

交换机上的设备名,目录名,路径名及文件名的长度有如下限制:每一级目录名均不能超过91个字符,路径名和文件名总长度不能超过127个字符,设备名不能超过14个字符,总长度不能超过142个字符。

 

1.2.1  cd

【命令】

cd directory

【视图】

用户视图

【参数】

directory:目标目录名。

【描述】

cd命令用来进入以太网交换机的指定工作路径。

缺省目录为Flash的根目录。

【举例】

# 进入以太网交换机的目录test。

<H3C> cd test

<H3C> pwd

unit1>flash:/test

1.2.2  copy

【命令】

copy fileurl-source fileurl-dest

【视图】

用户视图

【参数】

fileurl-source:Flash中源文件的路径名或文件名。

fileurl-dest:Flash中目标文件的路径名或文件名。

【描述】

copy命令用来复制文件。

若目标文件名与已经存在的文件名重名,系统将提示是否覆盖。

【举例】

# 拷贝文件从flash:/config.cfg到flash:/test/1.cfg。

<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.

1.2.3  delete

【命令】

delete [ /unreserved ] file-url

delete { running-files | standby-files } [ /fabric ] [ /unreserved ]

【视图】

用户视图

【参数】

/unreserved:彻底删除该文件。

file-url:Flash中的路径名或文件名。支持使用通配符“*”,比如delete *.txt可以删除当前目录下所有以txt为扩展名的文件。

running-files:所有具有main属性的文件。

standby-files:所有具有backup属性的文件。

/fabric:在整个Fabric上进行操作。

【描述】

delete命令用来删除以太网交换机的Flash中的文件。

该命令支持“*”通配符。

delete命令使用/unreserved关键字时,文件即被永久删除,不可恢复。

delete命令还可以根据文件属性进行删除。delete running-files命令将把所有具有main属性的文件删除,delete standby-files命令将把所有具有backup属性的文件删除。

当一个文件同时具有主备属性时,delete running-files命令并不删除文件,只是删除文件的主属性;delete standby-files命令并不删除文件,只是删除文件的备属性。

被删除的文件存放在回收站目录中。

使用dir命令显示文件目录信息时,不显示已经删除的文件信息,使用dir /all命令显示所有文件目录信息时,显示内容包括已经被删除的文件信息。

使用delete命令删除的文件,可以使用undelete命令恢复,若要从回收站中彻底删除该文件,请使用reset recycle-bin命令。

在使用delete running-filedelete standby-file命令时,系统会请用户确认是否删除所有主/备属性的文件。如果选择是,则系统删除所有主/备属性的文件;如果用户选择否,则系统依次请用户确认是否:1) 删除主/备属性的 Image 文件? 2) 删除主/备属性的配置文件? 3) 删除主/备属性的 Web 文件? 如下所示:

Delete the running image file? [Y/N]:n

Delete the running config file? [Y/N]:n

Delete the running web file? [Y/N]:n

 

Delete the backup image file? [Y/N]:n

Delete the backup config file? [Y/N]:n

Delete the backup web file? [Y/N]:n

在用户确定了要删除的文件后,系统开始进行删除动作。

  注意:

如果删除了两个名称相同的文件,回收站中只保留最后一次删除的文件。

 

【举例】

# 删除本Unit的文件test/test.txt。

<H3C> delete test/test.txt

Delete unit1>flash:/test/test.txt?[Y/N]:y

.

%Delete file unit1>flash:/test/test.txt...Done.

# 删除Fabric中具有main属性的文件。

<H3C> delete running-files /fabric

Delete the running files ? [Y/N]:y

Start deleting ..........

 Unit1 delete success!

 Unit2 delete success!

%Apr  4 11:25:40:973 2000 H3C VFS/6/OPLOG:- 1 - Unit1 delete success!

%Apr  4 11:25:41:56 2000 H3C VFS/6/OPLOG:- 1 – Unit2 delete success!

Deleting ... done

1.2.4  dir

【命令】

dir [ /all ] [ /fabric | file-url ]

【视图】

用户视图

【参数】

/all:所有的文件(包括删除到回收站中的文件)信息。

/fabric:在整个Fabric上进行操作。

file-url:Flash中的路径名或文件名。支持使用通配符“*”,比如dir *.txt可以显示当前目录下所有以txt为扩展名的文件。

【描述】

dir命令用来显示以太网交换机的Flash中的指定文件或目录信息。

该命令支持“*”通配符。

如果文件具有main,backup或main/backup属性,该文件将被标识出来。

&  说明:

在dir /all命令的显示信息中,已经删除到回收站中的文件会加上方括号作为提示。

 

【举例】

# 显示本地Unit文件系统根目录下的普通文件。

<H3C> dir

Directory of unit1>flash:/

   1 (*)   -rw-   5792495  Apr 02 2000 00:06:50   s3600.bin

   2 (*)   -rw-      1965  Apr 01 2000 23:59:13   3comoscfg.cfg

   3       -rw-   5841301  Apr 02 2000 21:42:13   s3600d8.bin

   4       -rw-       224  Apr 02 2000 01:36:30   s3800.bin

   5       -rw-    279296  Apr 02 2000 00:22:01   test.abc

15367 KB total (3720 KB free)

(*) -with main attribute   (b) -with backup attribute

(*b) -with both main and backup attribute  

# 显示Fabric中文件系统根目录下的所有文件(包括删除到回收站中的文件)。

<H3C> dir /all /fabric

Directory of unit1>flash:/

   1 (*)   -rw-   5792495  Apr 02 2000 00:06:50   s3600.bin

   2       -rwh         4  Apr 01 2000 23:55:26   snmpboots

   3       -rwh       151  Apr 02 2000 00:05:53   private-data.txt

   4 (*)   -rw-      1965  Apr 01 2000 23:59:13   3comoscfg.cfg

   5       -rw-   5841301  Apr 02 2000 21:42:13   s3600d8.bin

   6       -rw-       224  Apr 02 2000 01:36:30   s3800.bin

   7       -rw-    279296  Apr 02 2000 00:22:01   test.abc

   8       -rw-      2370  Apr 02 2000 02:49:12   [1.cfg]

15367 KB total (3720 KB free)

Directory of unit2>flash:/

   0       -rwh         4  Apr 01 2000 23:55:24   snmpboots

   1 (*)   -rw-   4724347  Apr 01 2000 23:59:45   s3600.bin

   2 (*)   -rw-      1475  Apr 01 2000 23:59:53   3comoscfg.cfg

   3       -rw-      1737  Apr 02 2000 00:46:21   cfg.cfg

   4       -rw-    279296  Apr 02 2000 00:21:55   love.rar

   5       -rw-       428  Apr 02 2000 13:07:11   hostkey

   6       -rwh       151  Apr 01 2000 23:58:39   private-data.txt

   7       -rw-       572  Apr 02 2000 13:07:20   serverkey

   8       -rw-      1589  Apr 02 2000 00:58:20   1.cfg

15367 KB total (10475 KB free)

(*) -with main attribute   (b) -with backup attribute

(*b) -with both main and backup attribute

# 显示本地Unit目录flash:/test/下的所有文件(包括删除到回收站中的文件)中文件名以t打头的文件信息。

<H3C> dir /all test/t*

Directory of unit1>flash:/test/

   0       -rw-    279296  Apr 04 2000 14:45:19   test.txt

15367 KB total (3720 KB free)

(*) -with main attribute   (b) -with backup attribute

(*b) -with both main and backup attribute

1.2.5  execute

【命令】

execute filename

【视图】

系统视图

【参数】

filename:批处理文件名,以“.bat”为后缀。

【描述】

execute命令用来执行指定的批处理文件。

批处理命令逐条执行批处理文件中的命令行;批处理文件中不能包含不可见字符。如果发现有不可见字符,批处理命令则退出当前执行过程,并且不进行回退操作;

批处理命令的执行过程相当于手工逐条执行的自动化过程。批处理命令不保证每一条命令的执行,批处理命令本身不进行热备份处理;批处理文件中不限制命令的形式和内容。

【举例】

# 执行flash:/目录下的test.bat批处理文件。

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] execute test.bat

<H3C>

....

%Created dir unit1>flash:/test3.

1.2.6  file prompt

【命令】

file prompt { alert | quiet }

【视图】

系统视图

【参数】

alert:对文件有危险性的操作进行交互确认。

quiet:对文件操作不提示。

【描述】

file prompt命令用来设置系统对文件操作的提醒方式。

缺省情况下,文件操作的提醒方式为alert,对文件有危险性的操作进行交互确认。

如果将文件操作的提醒方式设置为quiet,则系统对文件操作不作提示,可能会导致一些不可恢复的操作,对系统造成破环。例如,当文件操作的提醒方式为alert时,删除文件的界面显示为

<H3C> delete unit1>flash:/te.txt

Delete unit1>flash:/te.txt?[Y/N]:y

......

%Delete file unit1>flash:/te.txt...Done.

当文件操作的提醒方式为quiet时,删除文件的界面显示为

<H3C> delete unit1>flash:/te.txt

....

%Delete file unit1>flash:/te.txt...Done.    

【举例】

# 设置系统对文件操作的提醒方式为quiet。

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] file prompt quiet

1.2.7  fixdisk

【命令】

fixdisk device

【视图】

用户视图

【参数】

device:设备名称。

【描述】

fixdisk命令用来恢复Flash的空间。

由于异常操作等原因,Flash的某些空间可能不可用。用户可以通过fixdisk命令来恢复Flash的空间。

【举例】

# 恢复Flash的空间。

<H3C> fixdisk flash:

Fixdisk flash: may take some time to complete.

%Fixdisk unit1>flash: completed.

1.2.8  format

【命令】

format device

【视图】

用户视图

【参数】

device:设备名称。

【描述】

format命令用来格式化Flash。

  注意:

格式化操作将导致Flash上的所有文件丢失(包括配置文件),并且不可恢复。

 

【举例】

# 格式化Flash。

<H3C>format unit1>flash:

All data on unit1>flash: will be lost , proceed with format ? [Y/N]:y

..............................

%Format unit1>flash: completed.

1.2.9  mkdir

【命令】

mkdir directory

【视图】

用户视图

【参数】

directory:目录名。

【描述】

mkdir命令用来在指定Flash的指定目录下创建目录。

创建的目录名不能与指定目录下的其它目录或文件名重名。

【举例】

# 创建目录dd。

<H3C> mkdir dd

....

%Created dir unit1>flash:/dd.

1.2.10  more

【命令】

more file-url

【视图】

用户视图

【参数】

file-url:Flash中的文件的路径名或文件名。

【描述】

more命令用来显示指定文件的内容。

目前文件系统只支持以文本形式显示文件。

【举例】

# 显示文件test.txt的内容。

<H3C> more test.txt

AppWizard has created this test application for you.

This file contains a summary of what you will find in each of the files that make up your test application.

Test.dsp

This file (the project file) contains information at the project level and is used to build a single project or subproject. Other users can share the project (.dsp) file, but they should export the makefiles locally.

1.2.11  move

【命令】

move fileurl-source fileurl-dest

【视图】

用户视图

【参数】

fileurl-source:Flash中源文件的路径名或文件名。

fileurl-dest:Flash中目标文件的路径名或文件名。

【描述】

move命令用来移动文件。

若目标文件名与已经存在的文件名重名,系统将提示操作者是否覆盖原有文件。

【举例】

# 将文件flash:/1.txt移动到unit1>flash:/a/。

<H3C>move unit1>flash:/1.txt unit1>flash:/a/

Move unit1>flash:/1.txt to unit1>flash:/a/1.txt?[Y/N]:y

.

%Moved file unit1>flash:/1.txt to unit1>flash:/a/1.txt.

1.2.12  pwd

【命令】

pwd

【视图】

用户视图

【参数】

【描述】

pwd命令用来显示当前路径。

【举例】

# 显示当前路径。

<H3C> pwd

unit1>flash:

1.2.13  rename

【命令】

rename fileurl-source fileurl-dest

【视图】

用户视图

【参数】

fileurl-source:Flash中的源路径名或文件名。

fileurl-dest:Flash中的目标路径名或文件名。

【描述】

rename命令用来重命名文件或目录。

若目标文件名或目录名与已经存在的文件名或目录名重名,则重命名操作执行失败。

【举例】

# 将文件vrpcfg.txt重命名为vrpcfg.bak。

<H3C>rename vrpcfg.txt vrpcfg.bak

Rename unit1>flash:/vrpcfg.txt to unit1>flash:/vrpcfg.bak?[Y/N]:y

.

%Renamed file unit1>flash:/vrpcfg.txt to unit1>flash:/vrpcfg.bak.

1.2.14  reset recycle-bin

【命令】

reset recycle-bin [ file-url ] [ /force ]

reset recycle-bin [ /fabric ]

【视图】

用户视图

【参数】

file-url:Flash中的文件的路径名或文件名。支持使用通配符“*”。

/force:删除时没有任何提示。

/fabric:在整个Fabric上进行操作。

【描述】

reset recycle-bin命令用来彻底删除回收站中的文件。

delete命令删除文件只是将文件放在回收站中,而reset recycle-bin命令则彻底删除回收站中的文件。

&  说明:

对Fabric进行清空操作时,系统不会向用户逐一确认每个要删除的文件。

 

【举例】

# 清空fabric中unit 1的回收站中的文件。

<H3C>reset recycle-bin unit1>flash:/

Clear unit1>flash:/te.txt ?[Y/N]:y

Clearing files from flash may take a long time. Please wait...

.....

%Cleared file unit1>flash:/~/te.txt.

1.2.15  rmdir

【命令】

rmdir directory

【视图】

用户视图

【参数】

directory:目录名。

【描述】

rmdir命令用来删除目录。

被删除的目录必须为空目录(即删除目录前,必须先删除该目录下的所有文件和子目录)。

【举例】

# 删除目录dd。

<H3C> rmdir dd

Rmdir unit1>flash:/dd?[Y/N]:y

....

%Removed directory unit1>flash:/dd.

1.2.16  undelete

【命令】

undelete file-url

【视图】

用户视图

【参数】

file-urlFlash中的文件的路径名或文件名。

【描述】

undelete命令用来恢复回收站中未被彻底删除的文件。

如果恢复的文件名与当前存在的文件名重名,系统将提示操作者是否覆盖原有文件。

【举例】

# 恢复删除的文件sample.bak。

<H3C> undelete sample.bak

Undelete unit1>flash:/sample.bak ?[Y/N]:y

% Undeleted file unit1>flash:/sample.bak.

1.2.17  update fabric

【命令】

update fabric file-name

【视图】

用户视图

【参数】

file-name:要升级的文件名,1~64位字符串。

【描述】

update fabric命令用来以Fabric中某一台设备上的App(或Boot ROM、Web)文件,对整个Fabric内各Unit进行升级。

  注意:

update fabric命令必须在断开业务流量的情况下使用。

 

当前支持对App、Web、Boot ROM的全局升级,通过升级文件名的后缀来区分升级文件的类型。如S3600.bin,S3600.btm,S3600.web分别表示升级主机软件、Boot ROM文件、Web文件。

&  说明:

l      用户可以升级扩展名为web、bin或btm的文件。

l      用来升级的文件必须已经存在于Fabric内的某一台unit上的根目录下。

l      升级完成以后用来升级的文件会被copy到fabric内其他unit的根目录下。

l      执行update fabric命令时,先获取每台unit的free space信息,并给出每台unit的剩余flash空间是否足够的信息。若某一台unit的flash剩余空间不足(剩余空间比用来升级的文件大至少1k才能保证升级进行),系统会提示用户清理这台unit的Flash,否则不能完成Fabric升级操作。

l      在正式传送文件之前系统获取每台unit上的相应类型文件的版本信息,并进行兼容性比较,输出比较结果给用户,若用来升级的文件不能替代某个unit上的bin、web、btm文件时,命令执行失败,提示失败原因。

 

【举例】

# 用本Unit的APP文件(s3600.bin) 升级整个Fabric中所有设备。

<H3C>display irf-fabric

Fabric name is 3600-EI, system mode is L3.

Fabric authentication : no authentication, number of units in stack: 1.

Unit Name                                 Unit ID

First                                     1(*)

First                                     2

First                                     8

<H3C>update fabric s3600.bin

 This will update the Fabric. Continue? [Y/N] y

 The software is verifying ...

 The result of verification is :

 Unit ID   Free space(bytes)       Enough       Version comparison

    1          2126848               Y              Y

    2          2125824               Y              Y

    8          1439744               Y              Y

 warning: the verification is completed, start the file transmission [Y/N] y

 The fabric is being updated, 100%

 The s3600.bin is stored on unit 1 successfully

 The s3600.bin is stored on unit 2 successfully

 The s3600.bin is stored on unit 8 successfully

 Do you want to set s3600.bin to be running agent next time to boot[Y/N] y

The s3600.bin is configured successfully

1.3  配置文件备份与恢复命令

1.3.1  backup current-configuration

【命令】

backup { unit unit-id | fabric } current-configuration to { dest-addr | dest-hostname } filename.cfg

【视图】

用户视图

【参数】

unit-id:指定unit的ID号。

fabric:整个Fabric系统。

dest-addr:TFTP服务器的IP地址。

dest-hostname:TFTP服务器的主机名

filename.cfg:指定的配置文件名,长度为5~56个字符(包括扩展名.cfg)。

【描述】

backup unit current-configuration to命令用于备份指定unit的当前配置。backup fabric current-configuration to命令用于备份整个fabric的当前配置。

【举例】

# 备份unit 8的当前配置。

<H3C> backup unit 8 current-configuration to 1.1.1.253 aaa.cfg

  Backup current configuration to 1.1.1.253. Please wait...

  File will be transferred in binary mode. 

  Copying file to remote tftp server. Please wait...

  TFTP:     1958 bytes sent in 2 second(s).

 

  File uploaded successfully.

 

  Unit 8: Backup current configuration finished!

# 备份整个fabric的当前配置。

<H3C> backup fabric current-configuration to 1.1.1.253 aaa.cfg

  Backup current configuration to 1.1.1.253. Please wait...

  File will be transferred in binary mode. 

  Copying file to remote tftp server. Please wait...

  TFTP:     2029 bytes sent in 2 second(s).

 

  File uploaded successfully.

 

  Unit 7: Backup current configuration finished!

  Unit 8: Backup current configuration finished!

1.3.2  restore startup-configuration

【命令】

restore { unit unit-id | fabric } startup-configuration from { source-addr | source-hostname } filename.cfg

【视图】

用户视图

【参数】

unit-id:指定unit的ID号。

fabric:整个Fabric系统。

source-addr:TFTP服务器的IP地址。

source-hostname:TFTP服务器的主机名

filename.cfg:指定的配置文件名,长度为5~56个字符(包括扩展名.cfg)。

【描述】

restore unit startup-configuration from命令用于恢复指定unit的startup配置。restore fabric startup-configuration from命令用于恢复整个fabric的startup配置。

【举例】

# 恢复unit 7的startup配置。

<H3C> restore unit 7 startup-configuration from 1.1.1.253 aaa.cfg

Restore startup configuration from 1.1.1.253. Please wait...

  File will be transferred in binary mode. 

  Downloading file from remote tftp server, please wait...

  TFTP:     1958 bytes sent in 0 second(s).

 

  File downloaded successfully.

 

  Unit 7: Restore startup current configuration finished!

# 恢复整个fabric的startup配置。

<H3C> restore fabric startup-configuration from 1.1.1.253 bbb.cfg

Restore startup configuration from 1.1.1.253. Please wait...

  File will be transferred in binary mode. 

  Downloading file from remote tftp server, please wait...

  TFTP:     2029 bytes sent in 0 second(s).

 

  File downloaded successfully.

 

  Unit 7: Restore startup current configuration finished!

  Unit 8: Restore startup current configuration finished!    

 


第2章  FTP/TFTP点灯相关配置命令

2.1  FTP配置命令

2.1.1  ftp server enable

【命令】

ftp server enable

undo ftp server

【视图】

系统视图

【参数】

【描述】

ftp server enable命令用来启动FTP服务器,允许FTP用户登录。undo ftp server命令用来关闭FTP服务器,禁止FTP用户登录。

缺省情况下,系统关闭FTP服务器。

使用本命令可方便的启动或关闭FTP服务器,以确保设备的安全运行。

【举例】

# 关闭FTP服务器。

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] undo ftp server

% Close FTP server

2.1.2  local-user

【命令】

local-user user-name

undo local-user { user-name | all [ service-type { telnet | ftp | lan-access | ssh | terminal } ] }

【视图】

系统视图

【参数】

user-name:本地用户名。为不超过80个字符的字符串,字符串中不能包括“/”、“:”、“*”、“?”、“<”以及“>”等字符,并且“@”出现的次数不能多于1次,纯用户名(“@”以前部分,即用户标识)不能超过55个字符。用户名不区分大小写,输入UserA和usera,系统视为同一用户。

service-type:指定用户的类型。其中,telent指定用户为telnet类型;ftp指定用户为ftp类型;lan-access指定用户为lan-access类型(主要指以太网接入用户,比如802.1x用户);ssh指定用户为SSH类型;terminal指定用户可以使用terminal服务(即从Console口、AUX口、Asyn口登录)。

all:所有的用户。

【描述】

local-user命令用来添加本地用户并进入本地用户视图。undo local-user命令用来删除指定的本地用户。

【举例】

# 添加名称为hello1的本地用户

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] local-user hello1

New local user added.

[H3C-luser-hello1]

2.1.3  local-user password-display-mode

【命令】

local-user password-display-mode { auto | cipher-force }

undo local-user password-display-mode

【视图】

系统视图

【参数】

auto:按照配置密码时采用的模式进行显示,如果配置密码时是加密的,则加密显示;如果不是,则按不加密显示。

cipher-force:将用户密码强制采用加密的模式进行显示。

【描述】

local-user password-display-mode命令用来设置交换机在显示本地用户时对用户密码的显示模式。undo local-user password-display-mode命令用来恢复交换机显示本地用户密码的显示模式为缺省模式。

当采用cipher-force方式后,即使用户通过password命令指定密码显示方式为明文显示(即simple方式)后,密码仍然会显示为密文。

缺省情况下,交换机显示本地用户密码的显示模式为auto

【举例】

# 设置交换机在显示本地用户时对用户密码的显示模式为强制加密模式。

<H3C>system-view

System View: return to User View with Ctrl+Z.

[H3C] local-user password-display-mode cipher-force

2.1.4  password

【命令】

password { simple | cipher } password

undo password

【视图】

本地用户视图

【参数】

simple:表示密码显示为明文。

cipher:表示密码显示为密文。

password:表示设置的密码,明文方式时为1~63个字符的字符串;密文方式时为1~63个字符或固定的88个字符的字符串。

【描述】

password命令用来设置本地用户的密码。undo password命令用来取消指定的密码。

需要注意的是,当采用local-user password-display-mode cipher-force命令后,即使用户通过password命令指定密码显示方式为明文显示(即simple方式),密码仍然会显示为密文。

【举例】

# 设置名称为hello1的用户采用明文加密方式,密码为20030422。

<H3C> system-view

System View: return to User View with Ctrl+Z.

[H3C] local-user hello1

[H3C-luser-hello1] password simple 20030422

2.1.5  ftp

【命令】

ftp [ ipaddress [ port ] ]

【视图】

用户视图

【参数】

ipaddress:远程FTP Server的IP地址。

port:远程FTP Server的端口号。如果不输入port则系统采用缺省端口号。

【描述】

ftp命令用来与远程FTP服务器建立控制连接,并进入FTP Client视图。

【举例】

# 连接到地址为1.1.1.1的远程FTP服务器。

<H3C> ftp 1.1.1.1

Trying ...

Press CTRL+K to abort

Connected.

220 FTP service ready.

User(none):hello

331 Password required for hello.

Password:

230 User logged in.

2.1.6  get

【命令】

get remotefile [ localfile ]

【视图】

FTP Client命令视图

【参数】

localfile:本地文件名。

remotefile:远程FTP Server上文件名。

【描述】

get命令用来下载远程文件,并将下载的文件存储在本地。

如果没有指定本地文件名,则交换机将采用与远程FTP Server上相同的文件名将文件保存到本地。

【举例】

# 下载temp1.c文件,并以temp.c文件名保存。

<H3C> ftp 1.1.1.1

Trying ...

Press CTRL+K to abort

Connected.

220 FTP service ready.

User(none):hello

331 Password required for hello.

Password:

230 User logged in.

[ftp] get temp1.c temp.c

200 Port command okay.

150 Opening ASCII mode data connection for temp1.c.

..226 Transfer complete.

FTP: 1709 byte(s) received in 2.176 second(s) 0.00 byte(s)/sec.

[ftp]

2.2  TFTP配置命令

2.2.1  tftp get

【命令】

tftp tftp-server get source-file [ dest-file ]

【视图】

用户视图

【参数】

tftp-server:TFTP服务器的IP地址或者主机名。

source-file要下载的TFTP服务器上的文件信息。

dest-file:下载后存储在交换机上的文件名。

【描述】

tftp get命令用来将文件从TFTP服务器的指定目录下载到交换机上。

【举例】

# 从TFTP服务器(1.1.3.214),将文件LANSwitch.bin下载到本机并保存为vs.bin。

<H3C> tftp 1.1.3.214 get LANSwitch.bin vs.bin

 

 

不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!

新华三官网
联系我们