华为vr settings是什么(华为vrsettings是什么软件)

华为交换机启动配置命令详解大全

1、自动保存配置

[Huawei]set save-configuration ?

backup-to-server Back up the configuration to the server on the network # 保存配置文件到服务器

cpu-limit Specify the upper limit of CPU usage when the system automatically backup the current configuration # 备份配置时CPU使用上限

delay Specify the delay time of the automatical backup after the current configuration change #配置变更发生后自动备份配置的延时时间

interval Specify the interval for backuping the current configuration automatically #自动备份当前配置的时间间隔

<cr>

[Huawei]set save-configuration backup-to-server ?

server Server on the network

[Huawei]set save-configuration backup-to-server server ?

X.X.X.X Specify the IP address of the server

[Huawei]set save-configuration backup-to-server server 10.1.1.1 ?

transport-type Specify the type of the transmission

user Specify the user accessing the server

[Huawei]set save-configuration backup-to-server server 10.1.1.1 user ?

STRING<1-64> Name of the user

[Huawei]set save-configuration backup-to-server server 10.1.1.1 user ftp ?

password Specify the password used to access the server

[Huawei]set save-configuration backup-to-server server 10.1.1.1 user ftp password 023wg.com ?

path Specify the path on the server

<cr>

[Huawei]set save-configuration backup-to-server server 10.1.1.1 user ftp password 023wg.com path ?

STRING<1-64> Name of the path

[Huawei]set save-configuration backup-to-server server 10.1.1.1 user ftp password 023wg.com path back ?

<cr>

2、手动保存配置

<Huawei>save ?

STRING<5-64> The name of specific file ( *.cfg , *.zip)

all All configuration including those of unavailable cards or slots

<cr>

<Huawei>save all

在第一次保存配置文件时,如果不指定可选参数configuration-file,则设备将提示是否将文件名保存为“vrpcfg.zip”。“vrpcfg.zip”是系统缺省的配置文件,初始状态是空配置。

3、查看系统当前启动配置文件名

<Huawei>display startup

MainBoard:

Configured startup system software: NULL

Startup system software: NULL

Next startup system software: NULL

Startup saved-configuration file: NULL

Next startup saved-configuration file: flash:/vrpcfg.zip

Startup paf file: NULL

Next startup paf file: NULL

Startup license file: NULL

Next startup license file: NULL

Startup patch package: NULL

Next startup patch package: NULL

<Huawei>

4、比较配置文件

用户可以通过比较当前配置和下次启动的配置文件,查看哪些配置项是不一致的,决定是否需要将当前配置设置为下次启动时加载的配置文件。

系统在比较出不同之处时,将从两者有差异的地方开始显示字符(默认显示150个字符),如果该不同之处到文件末尾不足150个字符,将显示到文件尾为止。

比较当前配置和下次启动的配置文件时,如果下次启动的配置文件为空,或者下次启动的配置文件存在,但是内容为空,系统将提示读文件失败。

所比较的配置文件必须以“.cfg”或“.zip”作为扩展名。

<Huawei>compare configuration ?

INTEGER<0-65535> The line of current-configuration to begin comparing

STRING<5-48> Specify configuration file to be compared

<cr>

<Huawei>compare configuration

Warning: The current configuration is not the same as the next startup configura

tion file. There may be several differences, and the following are some configur

ations beginning from the first:

====== Current configuration line 40 ======

ip address 10.1.1.10 255.255.255.0

#

interface GigabitEthernet0/0/3

#

wlan

#

interface NULL0

#

user-interface con 0

====== Configuration file line 41 ======

interface GigabitEthernet0/0/3

#

wlan

#

interface NULL0

#

user-interface con 0

user-interface vty 0 4

user-interface vty 16 20

<Huawei>

如果不输入参数,表示从配置文件的首行开始进行比较。current-line-number和save-line-number这两个参数用来在发现配置文件不同之处后,跳过该不同处继续进行比较。

为什么compare configuration会失败

V100R003之前版本执行compare configuration命令是用来比较当前的配置文件与存储设备中保存的配置文件内容是否一致,通过display startup命令查询,当上一次启动时使用的配置文件为NULL时,会导致compare configuration失败。因此设备初次上电,配置好并save之后,建议整机复位一下设备。

V100R003及以后的版本执行compare configuration命令是用来比较当前的配置与下次启动的配置文件内容是否一致,所以没有这样的问题。

5、备份配置

为防止设备意外损坏,导致配置文件无法恢复,可以通过以下三种方法进行备份配置文件:

1、直接屏幕拷贝。

2、备份配置文件到存储器中。

3、通过FTP、TFTP、FTPS、SFTP和SCP备份配置文件。

5.1、直接拷贝配置文件

在命令行界面上,执行display current-configuration命令,并拷贝所有显示信息到TXT文本文件中,从而将配置文件备份到维护终端的硬盘中。

屏幕上显示的配置信息受终端软件的影响,可能会出现某配置过长而换行的情况。对于换行的配置,拷贝至TXT文本中时,需要删除换行,保证一条配置信息在只处在一行中。否则当使用制作的TXT文本恢复配置时,换行的配置可能无法恢复。

5.2、备份配置文件到cfcard中

该步骤主要便于用户在设备的cfcard中及时备份当前配置文件。在设备启动之后,使用如下命令在设备的cfcard中备份配置文件。

如果不是保存在设备的默认存储器中,需要指定绝对路径。

<HUAWEI> save config.cfg

<HUAWEI> copy config.cfg backup.cfg

5.3、通过FTP、TFTP、FTPS、SFTP和SCP备份配置文件

设备支持通过FTP、TFTP、FTPS、SFTP和SCP备份配置文件。其中使用FTP和TFTP备份配置文件比较简单,但是存在安全风险。在安全要求比较高的场景中,建议使用FTPS、SFTP和SCP备份配置文件。以下仅以FTP作为示例介绍备份配置文件。

5.3.1、设备作为FTP服务器,启动FTP服务。

在设备上启动FTP服务器功能,并创建用户名为huawei,密码为023wg.com的FTP用户,授权此用户可访问的目录是“cfcard:”。

<HUAWEI> system-view

[HUAWEI] ftp server enable

Warning: FTP is not a secure protocol, and it is recommended to use SFTP.

Info: Succeeded in starting the FTP server.

[HUAWEI] aaa

[HUAWEI-aaa] local-user huawei password irreversible-cipher 023wg.com

[HUAWEI-aaa] local-user huawei ftp-directory cfcard:

[HUAWEI-aaa] local-user huawei service-type ftp

[HUAWEI-aaa] local-user huawei privilege level 15

5.3.2、从维护终端向设备发起FTP连接。

在PC上,通过FTP客户端与设备建立FTP连接(例如设备的IP地址是10.110.24.254)。

C:\Documents and Setting\Administrator> ftp 10.110.24.254

Connected to 10.110.24.254.

220 FTP service ready.

User (10.110.24.254:(none)): huawei

331 Password required for huawei.

Password:

230 User logged in.

5.3.3、设置传输参数。

FTP用户验证通过后,FTP客户端显示提示符“ftp>”,在“ftp>”提示下键入binary(二进制传输模式),并设置FTP客户端存放上载文件的目录路径。

ftp> binary

200 Type set to I.

ftp> lcd c:\temp

Local directory now C:\temp.

5.3.4、传输配置文件。

在PC上,使用get命令将配置文件下载至本地指定目录中,并保存为backup.cfg。

ftp> get cfcard:/config.cfg backup.cfg

5.3.5、确认config.cfg和backup.cfg的文件大小是否一致。如果文件大小一致则认为备份成功。

6、恢复配置

用户进行了错误的配置,导致功能异常,可以通过以下三种方法进行配置恢复:

根据操作记录重新配置或根据保存的配置文件重新配置

从存储器恢复配置文件。

通过FTP、TFTP、FTPS、SFTP和SCP恢复配置文件。

在恢复配置文件后,为了让配置文件生效,需要重新启动设备。先使用startup saved-configuration命令指定重新启动使用的配置文件(如果配置文件命名没有变,则该步骤省略),然后使用reboot命令重新启动设备。

1、从存储器恢复配置文件

该步骤主要便于用户将存储在设备cfcard中的备份配置文件恢复成当前系统运行的配置文件。在设备正常工作时,使用如下命令。

<HUAWEI> copy cfcard:/backup.cfg cfcard:/config.cfg

2、通过FTP、TFTP、FTPS、SFTP和SCP恢复配置文件

设备支持通过FTP、TFTP、FTPS、SFTP和SCP恢复配置文件。其中使用FTP和TFTP恢复配置文件比较简单,但是存在安全风险。在安全要求比较高的场景中,建议使用FTPS、SFTP和SCP恢复配置文件。以下仅以FTP作为示例介绍恢复备份在PC上的配置文件。

6.2.1、设备作为FTP服务器,启动FTP服务。

在设备上启动FTP服务器功能,并创建用户名为huawei,密码为023wg.com的FTP用户,授权此用户可访问的目录是“cfcard:”。

<HUAWEI> system-view

[HUAWEI] ftp server enable

Warning: FTP is not a secure protocol, and it is recommended to use SFTP.

Info: Succeeded in starting the FTP server.

[HUAWEI] aaa

[HUAWEI-aaa] local-user huawei password irreversible-cipher Helloworld@6789

[HUAWEI-aaa] local-user huawei ftp-directory cfcard:

[HUAWEI-aaa] local-user huawei service-type ftp

[HUAWEI-aaa] local-user huawei privilege level 15

6.2.2、从维护终端向设备发起FTP连接。

在PC上,通过FTP客户端与设备建立FTP连接(例如设备的IP地址是10.110.24.254)。

C:\Documents and Setting\Administrator> ftp 10.110.24.254

Connected to 10.110.24.254.

220 FTP service ready.

User (10.110.24.254:(none)): huawei

331 Password required for huawei.

Password:

230 User logged in.

6.2.3、设置传输参数。

FTP用户验证通过后,FTP客户端显示提示符“ftp>”,在“ftp>”提示下键入binary(二进制传输模式),并设置FTP客户端存放上载文件的目录路径。

ftp> binary

200 Type set to I.

ftp> lcd c:\temp

Local directory now C:\temp.

6.2.4、传输配置文件。

在PC上,使用put命令将配置文件上传至本地指定目录中,并保存为backup.cfg。

ftp> put cfcard:/config.cfg backup.cfg

6.2.5、在设备上确认上传的backup.cfg文件是否成功。如果设备上存在backup.cfg文件,且文件大小正确则认为恢复配置文件成功。

7、清除配置

7.1、空设备下次启动使用的配置文件的内容,并取消指定系统下次启动时使用的配置文件,从而使设备配置恢复到缺省值

<Huawei>reset saved-configuration

Warning: The action will delete the saved configuration in the device.

The configuration will be erased to reconfigure. Continue? [Y/N]:y

Warning: Now clearing the configuration in the device.

Info: Succeeded in clearing the configuration in the device.

<Huawei>reboot

Info: The system is now comparing the configuration, please wait.

Warning: All the configuration will be saved to the configuration file for the n

ext startup:, Continue?[Y/N]:n

System will reboot! Continue?[Y/N]:y

reset saved-configuration命令会清空设备下次启动使用的配置文件信息,请慎重执行该命令。

执行该命令后,如果当前启动配置文件与下次启动配置文件相同,当前启动的配置文件也会被清空。

执行该命令后,用户手动重启设备时,系统会提示用户是否保存配置,这时候选择不保存才能清空配置。

取消指定系统下次启动时使用的配置文件后,如果不使用startup saved-configuration命令重新指定新的配置文件,或者不保存配置文件,设备重启后,将会以缺省配置启动。

如果设备下次启动的配置文件为空,设备会提示配置文件不存在。

7.2、一键式清除指定接口下配置信息或将配置恢复到缺省值。

当用户需要将设备上的某个接口用作其他用途时,原始的配置需要逐条删除。如果该接口下存在大量的配置,那么用户将耗费大量的时间进行删除动作,增大了用户的维护量。为了减少用户的维护量和降低操作的复杂度,可以一键式清除接口下的配置。

[Huawei]clear configuration ?

interface Specify the interface

[Huawei]clear configuration interface g

[Huawei]clear configuration interface GigabitEthernet ?

<0-0> Slot number

[Huawei]clear configuration interface GigabitEthernet 0/0/2

Warning: All configurations of the interface will be cleared, and its state will be shutdown. Continue? [Y/N] :y

Info: Total execute 0 command(s), 0 successful, 0 failed.

[Huawei]

[Huawei-GigabitEthernet0/0/2]clear configuration this

无论是在系统视图下还是在接口视图下执行命令清除指定接口下配置信息或将配置恢复到缺省值,使用时请慎重。被清除配置文件的接口将被置为shutdown状态。

8、配置系统启动文件

配置系统启动文件包括指定系统启动用的系统软件和配置文件,这样可以保证设备在下一次启动时以指定的系统软件启动以及以指定的配置文件初始化配置。如果系统启动时还需要加载新的补丁,则还需指定补丁文件。

在进行配置前,用户可以使用display startup命令查看当前设备指定的下次启动时加载的文件。

如果没有配置设备下次启动时加载的系统软件,则下次启动时将默认启动此次加载的系统软件。当需要更改下次启动的系统文件(如设备升级)时,则需要指定下次启动时加载的系统软件,此时还需要提前将系统软件通过文件传输方式保存至设备,系统软件必须存放在存储器的根目录下,文件名必须以“.cc”作为扩展名。

如果设备是双主控环境,只需确保系统软件保存在主用主控板,当指定备用主控板的系统软件时,设备会自动拷贝至备用主控板。

如果没有配置下次启动时加载的配置文件,则下次启动采用缺省配置文件(如vrpcfg.zip)。如果默认存储器中没有配置文件,则设备启动时将使用缺省参数初始化。

配置文件的文件名必须以“.cfg”或“.zip”作为扩展名,而且必须存放在存储器的根目录下。

补丁文件的扩展名为“.pat”,在指定下次启动时加载的补丁文件前也需要提前将补丁文件保存至设备存储器的根目录下。

如果设备是双主控环境,用户将补丁文件上传至主用主控板,需要执行copy source-filename destination-filename命令手动拷贝至备用主控板,从而确保补丁文件分别保存至主用主控板和备用主控板。

8.1、设备下次启动时加载的系统软件

<Huawei>startup system-software ?

STRING<4-64> Specify the system-software name,in the format of [drive][file-name](Default drive is flash:/)

8.2、如果设备是双主控环境设置备用主控板下次启动时加载的系统软件

<Huawei>startup system-software ?

STRING<4-64> Specify the system-software name,in the format of

[drive][file-name](Default drive is flash:/)

<Huawei>startup system-software software.cfg ?

slave-board For the slave board

<cr>

<Huawei>startup system-software software.cfg slave-board ?

<cr>

8.3、系统下次启动时使用的配置文件

<Huawei>startup saved-configuration ?

STRING<5-64> Specify the saved-configuration name,in the format of [drive][file-name](Default drive is flash:/)

8.4、设备下次启动时加载的补丁文件

<Huawei>startup patch ?

STRING<5-64> Specify the patch name,in the format of

[drive][file-name](Default drive is flash:/)

<Huawei>startup patch patch.pat ?

slave-board For the slave board

<cr>

9、重新启动设备

为了使指定的系统软件及相关文件生效,需要在配置完系统启动文件后,对设备进行重新启动。

重新启动设备有以下两种方式:

立即重新启动设备:

执行命令行后立即重新启动,也可通过在本地按动设备上的“RST”重启按钮,重新启动设备。

定时重新启动设备:

可以设置在未来的某一时刻重新启动设备。配置完下次系统启动文件后,为了不影响当前设备的运行,可以将设备设置在业务量少的时间点进行定时重新启动。

设备每一次重新启动或某一单板复位的相关信息都会被详细记录下来,包括重新启动的次数、详细信息以及原因等,可以通过display reset-reason命令进行查看。

一般情况下,不要轻易重新启动设备,因为这将导致在短时间内服务中断。

在重新启动设备之前,如果需要将当前配置在重新启动设备后仍生效,请先确保当前配置已保存。

9.1、立即重新启动设备

<Huawei>reboot ?

fast Reboot system fast # 表示快速重启设备,不会提示是否保存配置文件

save Save system information # 表示快速重启设备,不会提示是否保存配置文件

<cr>

9.2、定时重启设备

<Huawei>schedule reboot ?

at Specify the exact time # 设备定时重新启动的具体时间

delay Specify the time interval # 设备在定时重新启动前等待的时间

<Huawei>schedule reboot at ?

STRING Exact time(hh:mm)

<Huawei>schedule reboot at 11:22 ?

YYYY/MM/DD Date to reboot (YYYY/MM/DD)

<cr>

<Huawei>schedule reboot at 11:22 2016/4/4 ?

<cr>

<Huawei>schedule reboot delay ?

STRING Delay time, total minutes or hours:minutes(mm or hh:mm), the max

value is 720 hours.

<Huawei>schedule reboot delay 1:00 ?

force Force the schedule reboot. # 强制按照计划重启

<cr>

如果不指定force参数,系统首先会将当前配置与配置文件进行比较,如果不一致,则会提示是否保存当前配置,用户进行选择后系统又将提示用户确认设置的定时重启时间,键入“Y”或者“y”后,设置生效。

如果指定force参数,则系统不会出现任何提示,设置生效,当前配置不会被比较及保存。