05-配置文件管理命令
本章节下载: 05-配置文件管理命令 (183.76 KB)
目 录
1.1.1 backup startup-configuration
1.1.2 display current-configuration
1.1.3 display saved-configuration
1.1.6 reset saved-configuration
1.1.7 restore startup-configuration
1.1.9 slave auto-update config
1.1.10 startup saved-configuration
本文举例中的主用主控板所在槽位和备用主控板所在槽位请以设备实际情况为准。
【命令】
backup startup-configuration to dest-addr [ dest-filename ]
【视图】
用户视图
【缺省级别】
2:系统级
【参数】
dest-addr:TFTP服务器的IPv4地址或主机名,为1~20个字符的字符串。
dest-filename:目的文件名,后缀必须为“.cfg”。在服务器上将以该文件名保存设备的启动配置文件。
【描述】
backup startup-configuration命令用于将设备的下次启动配置文件备份到指定的TFTP服务器。
如果不指定目的文件名,则使用原文件名备份。
对于支持主备用下次启动配置文件的设备,执行该命令仅对主用下次启动配置文件进行备份。
目前设备通过TFTP传输协议来实现备份操作。
在FIPS模式下设备不支持TFTP,所以不支持配置backup startup-configuration命令。
【举例】
# 将设备的下次启动配置文件备份到IP地址为2.2.2.2的TFTP服务器上,文件名为192-168-1-26.cfg。
<Sysname> backup startup-configuration to 2.2.2.2 192-168-1-26.cfg
Backup next startup-configuration file to 2.2.2.2, please wait…finished!
【命令】
display current-configuration [ [ configuration [ configuration ] | controller | interface [ interface-type ] [ interface-number ] | exclude modules ] [ by-linenum ] [ | { begin | exclude | include } regular-expression ] ]
【视图】
任意视图
【缺省级别】
2:系统级
【参数】
configuration [ configuration ]:显示非Console接口配置。如果不带参数,则显示所有的非接口配置;如果带参数,具体参数与设备型号和用户当前的配置有关,例如:
· isis:显示isis的配置。
· isp:显示网络服务提供商的配置。
· post-system:显示后置配置。
· radius-template:显示RADIUS方案的配置。
· system:显示前置配置。
· user-interface:显示用户接口的配置。
controller:显示控制器(比如CE1/PRI接口,相关内容请参见“接口管理配置指导”中的“WAN接口”)的配置。
interface [ interface-type ] [ interface-number ]:显示接口的配置。interface-type表示接口类型,interface-number表示接口编号。
exclude modules:不显示指定模块的配置。modules表示模块名,可以一次输入多个模块名,模块名之间用空格隔开,形如display current-configuration exclude a b,表示除了a和b模块的内容,其它生效的配置均显示。目前modules支持如下两个取值:
· acl:表示不显示ACL模块的配置。
· acl6:表示不显示IPv6 ACL模块的配置。
by-linenum:显示每一行信息的行号。
|:使用正则表达式对显示信息进行过滤。有关正则表达式的详细介绍,请参见“基础配置指导”中的“CLI”。
begin:从包含指定正则表达式的行开始显示。
exclude:只显示不包含指定正则表达式的行。
include:只显示包含指定正则表达式的行。
regular-expression:表示正则表达式,为1~256个字符的字符串,区分大小写。
【描述】
display current-configuration命令用来显示设备当前生效的配置。
当用户完成一组配置之后,需要验证是否配置正确,则可以执行display current-configuration命令来查看当前生效的参数。对于某些当前配置的参数,如果与缺省参数相同,则不显示。对于某些参数,虽然用户已经配置,但如果实际生效的参数发生了改变,则显示实际生效的参数,如:在某Loopback接口下配置的“ip address 11.11.11.11 24”,这时,执行display current-configuration后看到的配置为“ip address 11.11.11.11 255.255.255.255”,实际生效的掩码为32位。
相关配置可参考命令save、reset saved-configuration和display saved-configuration。
【举例】
# 查看当前设备所有控制器的配置信息。
<Sysname> display current-configuration controller
#
controller E1 6/0
#
controller E1 6/1
pri-set
#
controller E1 6/2
pri-set
#
controller E1 6/3
using e1
#
return
# 查看当前生效的配置中,从包含“user-interface”字符串的行开始到最后一行的配置信息。
<Sysname> display current-configuration | begin user-interface
user-interface con 0
user-interface aux 0
user-interface vty 0 4
authentication-mode none
user privilege level 3
#
return
# 查看当前设备上生效的SNMP配置。
<Sysname> display current-configuration | include snmp
snmp-agent
snmp-agent local-engineid 800063A203000FE240A1A6
snmp-agent community read public
snmp-agent community write private
snmp-agent sys-info version all
【命令】
display saved-configuration [ by-linenum ] [ | { begin | exclude | include } regular-expression ]
【视图】
任意视图
【缺省级别】
2:系统级
【参数】
by-linenum:显示每一行信息的行号。
|:使用正则表达式对显示信息进行过滤。有关正则表达式的详细介绍,请参见“基础配置指导”中的“CLI”。
begin:从包含指定正则表达式的行开始显示。
exclude:只显示不包含指定正则表达式的行。
include:只显示包含指定正则表达式的行。
regular-expression:表示正则表达式,为1~256个字符的字符串,区分大小写。
【描述】
display saved-configuration命令用来查看设备存储介质中保存的下次启动配置文件的内容。
可以在管理/维护设备时使用该命令确认重要的配置是否已经保存到下次启动配置文件。
对于支持主备用下次启动配置文件的设备,执行该命令将显示下次主用启动配置文件的内容。
如果设备未设置下次启动配置文件,或下次启动配置文件不存在,执行display saved-configuration命令会显示设备的缺省配置文件。如果缺省配置文件也不存在,系统会提示指定的配置文件不存在。
相关配置可参考命令save、reset saved-configuration和display current-configuration。
【举例】
# 显示设备存储介质中保存的下次启动配置文件的内容。
<Sysname> display saved-configuration
#
version 5.20, Test 5310
#
sysname Sysname
#
domain default enable system
#
telnet server enable
#
multicast routing-enable
#
vlan 1
#
vlan 999
#
domain system
access-limit disable
state active
idle-cut disable
self-service-url disable
#
interface NULL0
#
---- More ----
以上显示的配置依次是全局配置、端口配置、用户接口配置。“---- More ----”表示这一屏信息已经显示完毕,会暂停显示。按<Enter>键将接着显示下一行信息;按<Space>键将接着显示下一屏信息;按<Ctrl+C>或其它任意键将退出显示。
# 使用行号显示设备存储介质中保存的下次启动配置文件的内容。
<Sysname> display saved-configuration by-linenum
1: #
2: version 5.20, Test 5310
3: #
4: sysname Sysname
5: #
6: domain default enable system
7: #
8: telnet server enable
9: #
10: multicast routing-enable
11: #
12: vlan 1
13: #
14: vlan 999
15: #
16: domain system
17: access-limit disable
18: state active
19: idle-cut disable
20: self-service-url disable
21: #
22: interface NULL0
23: #
---- More ----
“---- More ----”表示这一屏信息已经显示完毕,会暂停显示。按<Enter>键将接着显示下一行信息;按<Space>键将接着显示下一屏信息;按<Ctrl+C>或其它任意键将退出显示。
【命令】
display startup [ | { begin | exclude | include } regular-expression ]
【视图】
任意视图
【缺省级别】
1:监控级
【参数】
|:使用正则表达式对显示信息进行过滤。有关正则表达式的详细介绍,请参见“基础配置指导”中的“CLI”。
begin:从包含指定正则表达式的行开始显示。
exclude:只显示不包含指定正则表达式的行。
include:只显示包含指定正则表达式的行。
regular-expression:表示正则表达式,为1~256个字符的字符串,区分大小写。
【描述】
display startup命令用来显示用于本次及下次启动的配置文件名。
需要注意的是:(非IRF模式,SR6604/SR6608/SR6616/SR6604-X/SR6608-X/SR6616-X)
· 因为备用主控板是根据主用主控板的当前配置启动和运行的,所以主用主控板和备用主控板显示的当前启动配置文件始终是相同的。
· 当主备倒换后,主用主控板和备用主控板的角色交换,新的主用主控板没有从配置文件重启而是沿用当前的配置继续运行,所以使用display startup查看时,新主用主控板的当前启动配置文件为NULL,新备用主控板的当前启动配置文件和新主用主控板保持一致,也为NULL。
需要注意的是:(IRF模式)
· 因为Slave是根据Master的当前配置启动和运行的,所以IRF中所有成员设备显示的当前启动配置文件始终是相同的。
· 当Master角色变更后,新的Master没有从配置文件重启而是沿用当前的配置继续运行,所以使用display startup查看时,新Master的当前启动配置文件为NULL,其它Slave的当前启动配置文件和新Master保持一致,也为NULL。
相关配置可参考命令startup saved-configuration。
【举例】
(1) 非IRF模式应用
· SR6602
# 显示本次及下次启动的配置文件名。
<Sysname> display startup
Current startup saved-configuration file: cfa0:/startup.cfg
Next main startup saved-configuration file: cfa0:/startup.cfg
Next backup startup saved-configuration file: NULL
表1-1 display startup命令显示信息描述表
字段 |
描述 |
Current Startup saved-configuration file |
当前启动使用的配置文件 |
Next main startup saved-configuration file |
下一次启动时使用的主用配置文件 |
Next backup startup saved-configuration file |
下一次启动时使用的备用配置文件 |
(This file does not exist.) |
表示配置文件不存在 如果用户在配置完下次启动配置文件后又将该文件删除了,这种情况下会在文件名后显示该信息 |
· SR6602-X
# 显示本次及下次启动的配置文件名。
<Sysname> display startup
MainBoard:
Current startup saved-configuration file: flash:/startup.cfg
Next main startup saved-configuration file: flash:/startup.cfg
Next backup startup saved-configuration file: NULL
表1-2 display startup命令显示信息描述表
字段 |
描述 |
MainBoard |
/ |
Current Startup saved-configuration file |
当前启动使用的配置文件 |
Next main startup saved-configuration file |
下一次启动时使用的主用配置文件 |
Next backup startup saved-configuration file |
下一次启动时使用的备用配置文件 |
(This file does not exist.) |
表示配置文件不存在 如果用户在配置完下次启动配置文件后又将该文件删除了,这种情况下会在文件名后显示该信息 |
· SR6604/SR6608/SR6616/SR6604-X/SR6608-X/SR6616-X
# 显示本次及下次启动的配置文件名。
<Sysname> display startup
MainBoard:
Current startup saved-configuration file: cfa0:/startup.cfg
Next main startup saved-configuration file: cfa0:/startup.cfg
Next backup startup saved-configuration file: NULL
Slot 1:
Current startup saved-configuration file: cfa0:/startup.cfg
Next main startup saved-configuration file: cfa0:/startup.cfg
Next backup startup saved-configuration file: NULL
(2) IRF模式应用
# 显示本次及下次启动的配置文件名。
<Sysname> display startup
MainBoard:
Current startup saved-configuration file: NULL
Next main startup saved-configuration file: cfa0:/startup.cfg
Next backup startup saved-configuration file: cfa0:/startup2.cfg
Chassis 2 Slot 2:
Current startup saved-configuration file: NULL
Next main startup saved-configuration file: cfa0:/startup.cfg
Next backup startup saved-configuration file: cfa0:/startup2.cfg
表1-3 display startup命令显示信息描述表
字段 |
描述 |
MainBoard |
主用主控板使用的本次及下次启动的配置文件名 |
Current startup saved-configuration file |
当前启动使用的配置文件 |
Next main startup saved-configuration file |
下一次启动时使用的配置文件 |
Next backup startup saved-configuration file |
下一次启动时使用的备用配置文件 |
(This file does not exist.) |
表示配置文件不存在 如果用户在配置完下次启动配置文件后又将该文件删除了,这种情况下会在文件名后显示该信息 |
Slot 1 |
备用主控板(所在槽位号为1)使用的本次及下次启动的配置文件名 |
【命令】
display this [ by-linenum ] [ | { begin | exclude | include } regular-expression ]
【视图】
任意视图
【缺省级别】
1:监控级
【参数】
by-linenum:显示每一行信息的行编号。
|:使用正则表达式对显示信息进行过滤。有关正则表达式的详细介绍,请参见“基础配置指导”中的“CLI”。
begin:从包含指定正则表达式的行开始显示。
exclude:只显示不包含指定正则表达式的行。
include:只显示包含指定正则表达式的行。
regular-expression:表示正则表达式,为1~256个字符的字符串,区分大小写。
【描述】
display this命令用来显示当前视图下生效的配置。
当用户在某一视图下完成一组配置之后,需要验证是否配置成功,则可以执行display this命令来查看当前生效的配置。
需要注意以下几点:
· 对于已经生效的配置如果与缺省情况相同,则不显示;
· 对于某些参数,虽然用户已经配置,但如果这些参数所在的功能没有生效,则不显示;
· 在任意一个用户界面视图下执行此命令,将会显示所有用户界面下生效的配置;
· 在任意一个VLAN视图下执行此命令,将会显示所有已创建的VLAN下的配置。
【举例】
# 显示接口GigabitEthernet 4/0/1下生效的配置。
<Sysname> system-view
[Sysname] interface gigabitethernet 4/0/1
[Sysname-GigabitEthernet4/0/1] display this
#
interface GigabitEthernet4/0/1
port link-mode route
#
Return
# 显示所有用户界面下生效的配置。
<Sysname> system-view
[Sysname] user-interface vty 0
[Sysname-ui-vty0] display this
#
user-interface con 0
user-interface vty 0
history-command max-size 256
user-interface vty 1 4
#
return
【命令】
reset saved-configuration [ backup | main ]
【视图】
用户视图
【缺省级别】
3:管理级
【参数】
backup:删除备用下次启动配置文件。
main:删除主用下次启动配置文件。
【描述】
reset saved-configuration命令用来删除设备存储介质中保存的下次启动配置文件。
需要注意的是:
· 非IRF模式下:
¡ 删除操作会将下次启动配置文件从设备上彻底删除,所以请慎用该命令。(SR6602/SR6602-X)
¡ 删除操作会将下次启动配置文件从主用主控板和备用主控板上彻底删除,所以请慎用该命令。(SR6604/SR6608/SR6616/SR6604-X/SR6608-X/SR6616-X)
· IRF模式下,删除操作会将下次启动配置文件从所有主控板上彻底删除,所以请慎用该命令。
· 如果当前设备的主备用下次启动配置文件相同,仅执行一次删除操作,系统只会将相应的下次启动配置文件设置为NULL,但不会删除该文件。
· reset saved-configuration和reset saved-configuration main命令执行效果相同:都会删除主用下次启动配置文件。
相关配置可参考命令save和display saved-configuration。
【举例】
(1) 非IRF模式应用
· SR6602/SR6602-X
# 删除设备存储介质中保存的下次启动配置文件。
<Sysname> reset saved-configuration
The saved configuration file will be erased. Are you sure? [Y/N]:y
Configuration file in cfa0 is being cleared.
Please wait ...........
Configuration file is cleared.
· SR6604/SR6608/SR6616/SR6604-X/SR6608-X/SR6616-X
# 删除设备存储介质中保存的下次启动配置文件。
<Sysname> reset saved-configuration
The saved configuration file will be erased. Are you sure? [Y/N]:y
Configuration file in cfa0 is being cleared.
Please wait ...
..
MainBoard:
Configuration file is cleared.
Slot 1:
Erase next configuration file successfully
(2) IRF模式应用
# 删除设备存储介质中保存的下次备用启动配置文件。
<Sysname> reset saved-configuration backup
The saved configuration file will be erased. Are you sure? [Y/N]:y
Configuration file in cfa0 is being cleared.
Please wait ...
..
MainBoard:
Configuration file is cleared.
Chassis 2 Slot 2:
Erase next configuration file successfully
【命令】
restore startup-configuration from src-addr src-filename
【视图】
用户视图
【缺省级别】
3:管理级
【参数】
src-addr:TFTP服务器的IP地址或名称,不支持IPv6。
src-filename:源文件名,指定服务器上将下载的文件的文件名。
【描述】
restore startup-configuration命令用于从指定TFTP服务器上下载配置文件并设置为设备的下次启动配置文件。
· 执行该命令设置的是主用下次启动配置文件。
· 执行该命令会将指定配置文件下载到主用主控板和备用主控板存储介质的根目录下,并设置为主用主控板和备用主控板的下次启动配置文件。(非IRF模式,SR6604/SR6608/SR6616/SR6604-X/SR6608-X/SR6616-X)
· 执行该命令会将指定配置文件下载到所有成员所有主控板的设备存储介质的根目录下,并设置为所有主控板的下次启动配置文件。(IRF模式)
如果主用主控板或备用主控板上已经存在与源文件同名的文件,则提示用户,由用户选择是否覆盖。另外,检查重名文件或向备用主控板备份时,均默认主用主控板和备用主控板使用相同类型的存储设备。向备用主控板备份时将文件拷贝到备用主控板上与主用主控板相同的目录下,即根目录下。(非IRF模式,SR6604/SR6608/SR6616/SR6604-X/SR6608-X/SR6616-X)
如果成员设备上已经存在与源文件同名的文件,则提示用户,由用户选择是否覆盖。另外,检查重名文件或向全局备用主控板备份时,均默认全局主用主控板和全局备用主控板使用相同类型的存储介质。向全局备用主控板备份时将文件拷贝到全局备用主控板上与全局主用主控板相同的目录下,即根目录下。(IRF模式)
在FIPS模式下设备不支持TFTP,所以不支持配置restore startup-configuration命令。
【举例】
(1) 非IRF模式应用
· SR6602/SR6602-X
# 从IP地址为2.2.2.2的TFTP服务器上下载test.cfg文件作为设备的下次启动配置文件。
<Sysname> restore startup-configuration from 2.2.2.2 test.cfg
Restore next startup-configuration file from 2.2.2.2. Please wait..............
finished!
· SR6604/SR6608/SR6616/SR6604-X/SR6608-X/SR6616-X
# 从IP地址为2.2.2.2的TFTP服务器上下载config.cfg文件作为设备的主用下次启动配置文件。
<Sysname> restore startup-configuration from 2.2.2.2 config.cfg
Restore next startup-configuration file from 2.2.2.2. Please wait...finished!
Now restore next startup-configuration file from main to slave board. Please wait...finished!
(2) IRF模式应用
# 从IP地址为2.2.2.2的TFTP服务器上下载config.cfg文件作为设备的主用下次启动配置文件。
<Sysname> restore startup-configuration from 2.2.2.2 config.cfg
Restore next startup-configuration file from 2.2.2.2. Please wait...finished!
Now restore next startup-configuration file from main to slave board. Please wait...finished!
【命令】
非IRF模式:
save file-url [ all | slot slot-number ]
save [ safely ] [ backup | main ] [ force ]
IRF模式:
save file-url [ all | chassis chassis-number slot slot-number ]
save [ safely ] [ backup | main ] [ force ]
【视图】
任意视图
【缺省级别】
2:系统级
【参数】
file-url:文件路径,文件名部分必须以“.cfg”为后缀。(非IRF模式,SR6602/SR6602-X)
file-url:文件路径,文件名部分必须以“.cfg”为后缀。当本参数和关键字all或者slot一起使用时,本参数不能包含槽位号,如果路径中包含了文件夹,则必须先在相应的主控板上创建该文件夹,否则本板上的保存操作将失败。(非IRF模式,SR6604/SR6608/SR6616/SR6604-X/SR6608-X/SR6616-X)
file-url:文件路径,必须以“.cfg”为后缀。当本参数和关键字all或者slot一起使用时,本参数不能包含成员编号,如果路径中包含了文件夹,则必须先在相应的成员设备上创建该文件夹,否则本成员设备上的保存操作将失败。(IRF模式)
all:将当前配置以指定的名称保存到所有主控板。(非IRF模式)
all:将当前配置以指定的名称保存到所有成员设备。(IRF模式)
不同型号的设备支持的情况如下表所示:
型号 |
参数 |
描述 |
SR6602 |
all |
不支持 |
SR6602-X |
不支持 |
|
SR6604/SR6608/SR6616 |
支持 |
|
SR6604-X/SR6608-X/SR6616-X |
支持 |
slot slot-number:将当前配置以指定的名称保存到备用主控板。slot-number表示单板所在的槽位号。(非IRF模式)不同型号的设备支持的情况如下表所示:
型号 |
参数 |
描述 |
SR6602 |
all |
不支持 |
SR6602-X |
不支持 |
|
SR6604/SR6608/SR6616 |
支持 |
|
SR6604-X/SR6608-X/SR6616-X |
支持 |
chassis chassis-number slot slot-number:将当前配置以指定的名称保存到指定主控板。chassis-number表示设备在IRF中的成员编号,slot-number表示单板所在的槽位号。(IRF模式)
safely:以安全模式保存配置文件。如果不指定该参数,表示以快速保存方式保存配置文件。
backup:将当前配置保存到交互方式下指定的文件中,并将该文件设置为备用下次启动配置文件。
main:将当前配置保存到交互方式下指定的文件中,并将该文件设置为主用下次启动配置文件。
force:表示直接将当前配置保存到下次启动配置文件,系统不再输出交互信息。缺省情况下,用户执行save命令,系统要求用户输入<Y>或<N>等参数来确认本次操作,如果在30秒内没有确认,系统会自动退出本次操作。如果在执行save操作时使用了force参数,则系统会直接保存当前配置,不再需要用户输入任何信息。
【描述】
(1) 非IRF模式应用
· SR6602/SR6602-X
save file-url命令用来将当前配置保存到指定文件,但不会将该文件设置为下次启动配置文件。如果file-url不存在,则系统会先创建该文件,再执行保存操作。
save [ safely ] [ backup | main ] [ force ]命令用来将当前配置保存到存储介质的根目录,并将该文件设置为下次启动配置文件。
相关配置可参考命令reset saved-configuration、display current-configuration和display saved-configuration。
· SR6604/SR6608/SR6616/SR6604-X/SR6608-X/SR6616-X
save file-url [ all | slot slot-number ]命令用来将当前配置保存到指定文件,但不会将该文件设置为下次启动配置文件。如果file-url不存在,则系统会先创建该文件,再执行保存操作;不指定all或slot参数,则保存到主用主控板上。
save [ safely ] [ backup | main ] [ force ]命令用来将当前配置保存到主用主控板和备用主控板存储介质的根目录,并将该文件设置为下次启动配置文件。不指定backup或main参数时,则缺省使用main。
执行“save [ safely ] [ backup | main ] [ force ]”或者“save file-url all+回车”操作,是对主用主控板和备用主控板同时生效还是只对主用主控板生效,与配置文件的同步保存功能是否使能有关。
相关配置可参考命令slave auto-update config、reset saved-configuration、display current-configuration和display saved-configuration。
(2) IRF模式应用
save file-url [ all | chassis chassis-number slot slot-number ]命令用来将当前配置保存到指定文件,但不会将该文件设置为下次启动配置文件。如果file-url不存在,则系统会先创建该文件,再执行保存操作;不指定all和chassis chassis-number slot slot-number参数,则保存到全局主用主控板上。
save [ safely ] [ backup | main ] [ force ]命令用来将当前配置保存到成员设备存储介质的根目录,并将该文件设置为下次启动配置文件。不指定backup或main参数时,则缺省使用main。
执行“save [ safely ] [ backup | main ] [ force ]”或者“save file-url all+回车”操作,是对所有主控板同时生效还是只对全局主用主控板生效,与配置文件的同步保存功能是否使能有关。
相关配置可参考命令slave auto-update config、reset saved-configuration、display current-configuration和display saved-configuration。
【举例】
(1) 非IRF模式应用
· SR6602
# 将当前配置文件保存到指定配置文件,但不将该文件设置为下次启动配置文件。
<Sysname> save test.cfg
The current configuration will be saved to cfa0:/test.cfg. Continue? [Y/N]:y
Now saving current configuration to the device.
Saving configuration cfa0:/test.cfg. Please wait...
............
Configuration is saved to cfa0 successfully.
# 将当前配置保存到存储介质的根目录,并将该文件设置为下次启动配置文件。(SR6602)
<Sysname> display startup
Current startup saved-configuration file: cfa0:/hmr.cfg
Next main startup saved-configuration file: cfa0:/aa.cfg
Next backup startup saved-configuration file: NULL
// 以上显示信息表明设备的主用下次启动文件为aa.cfg。
<Sysname> save
The current configuration will be written to the device. Are you sure? [Y/N]:y
Please input the file name(*.cfg)[cfa0:/aa.cfg]
(To leave the existing filename unchanged, press the enter key):startup.cfg
Validating file. Please wait............
Configuration is saved to device successfully.
<Sysname> display startup
Current startup saved-configuration file: cfa0:/hmr.cfg
Next main startup saved-configuration file: cfa0:/startup.cfg
Next backup startup saved-configuration file: NULL
// 以上显示信息表明设备的主用下次启动文件已经变为startup.cfg。
# 直接将当前配置保存到主用下次启动配置文件,不再进行信息确认。
<Sysname> save force
Validating file. Please wait....
Configuration is saved to device successfully.
· SR6602-X
# 将当前配置文件保存到指定配置文件,但不将该文件设置为下次启动配置文件。
<Sysname> save test.cfg
The current configuration will be saved to flash:/test.cfg. Continue? [Y/N]:y
Now saving current configuration to the device.
Saving configuration flash:/test.cfg. Please wait...
............
Configuration is saved to flash successfully.
# 将当前配置保存到存储介质的根目录,并将该文件设置为下次启动配置文件。(SR6602-X)
<Sysname> display startup
Current startup saved-configuration file: flash:/hmr.cfg
Next main startup saved-configuration file: flash:/aa.cfg
Next backup startup saved-configuration file: NULL
// 以上显示信息表明设备的主用下次启动文件为aa.cfg。
<Sysname> save
The current configuration will be written to the device. Are you sure? [Y/N]:y
Please input the file name(*.cfg)[flash:/aa.cfg]
(To leave the existing filename unchanged, press the enter key):startup.cfg
Validating file. Please wait............
Configuration is saved to device successfully.
<Sysname> display startup
Current startup saved-configuration file: flash:/hmr.cfg
Next main startup saved-configuration file: flash:/startup.cfg
Next backup startup saved-configuration file: NULL
// 以上显示信息表明设备的主用下次启动文件已经变为startup.cfg。
# 直接将当前配置保存到主用下次启动配置文件,不再进行信息确认。
<Sysname> save force
Validating file. Please wait....
Configuration is saved to device successfully.
· SR6604/SR6608/SR6616/SR6604-X/SR6608-X/SR6616-X
# 将当前配置保存到主用主控板和备用主控板存储介质的根目录,并将该文件设置为下次启动配置文件。
<Sysname> display startup
MainBoard:
Current startup saved-configuration file: cfa0:/startup.cfg
Next startup saved-configuration file: cfa0:/bb.cfg
Next backup startup saved-configuration file: NULL
Slot 1:
Current startup saved-configuration file: cfa0:/startup.cfg
Next startup saved-configuration file: cfa0:/bb.cfg
Next backup startup saved-configuration file: NULL
// 以上显示信息表明设备的主、备用主控板的下次启动文件均为bb.cfg。
<Sysname> save
The current configuration will be written to the device. Are you sure? [Y/N]:y
Please input the file name(*.cfg)[cfa0:/bb.cfg]
(To leave the existing filename unchanged, press the enter key):vrpcfg.cfg
Validating file. Please wait.....................
The current configuration is saved to the active main board successfully.
Slot 1:
The current configuration file is saved successfully.
Configuration is saved to device successfully.
<Sysname> display startup
MainBoard:
Current startup saved-configuration file: cfa0:/startup.cfg
Next startup saved-configuration file: cfa0:/vrpcfg.cfg
Next backup startup saved-configuration file: NULL
Slot 1:
Current startup saved-configuration file: cfa0:/startup.cfg
Next startup saved-configuration file: cfa0:/vrpcfg.cfg
Next backup startup saved-configuration file: NULL
// 以上显示信息表明设备的主、备用主控板的下次启动文件均已经变为vrpcfg.cfg。
# 将当前配置保存到主、备用主控板存储介质的根目录,并将该文件设置为下次启动配置文件(当前配置与软件版本不兼容)。
<Sysname> display startup
MainBoard:
Current startup saved-configuration file: cfa0:/startup.cfg
Next startup saved-configuration file: cfa0:/config.cfg
Next backup startup saved-configuration file: NULL
Slot 1:
Current startup saved-configuration file: cfa0:/startup.cfg
Next startup saved-configuration file: cfa0:/config.cfg
Next backup startup saved-configuration file: NULL
// 以上显示信息表明设备的主、备用主控板的下次启动文件均为config.cfg。
· 把当前设备运行的配置保存到主用下次启动配置文件。
<Sysname> save
The current configuration will be written to the device. Are you sure? [Y/N]:y
Please input the file name(*.cfg)[cfa0:/config.cfg]
(To leave the existing filename unchanged, press the enter key):
Cfa0:/config.cfg exists, overwrite? [Y/N]:y
The configuration file cfa0:/config.cfg will be automatically backed up as cfa0:/_config_bak.cfg for a future version downgrading.
Validating file. Please wait.....................
The current configuration is saved to the active main board successfully.
Slot 1:
Backup done.
Configuration is saved to device successfully.
// 以上显示信息表明设备的主、备用主控板的下次启动文件备份为_config_bak.cfg,新软件版本配置文件直接覆盖当前正在使用的配置文件并保存为设备的主用下次启动配置文件。
· 把当前设备运行的配置保存到主用下次启动配置文件(备用主控板老软件版本的配置文件备份失败)。
<Sysname> save
The current configuration will be written to the device. Are you sure? [Y/N]:y
Please input the file name(*.cfg)[cfa0:/config.cfg]
(To leave the existing filename unchanged, press the enter key):
Cfa0:/config.cfg exists, overwrite? [Y/N]:y
The configuration file cfa0:/config.cfg will be automatically backed up as cfa0:/_config_bak.cfg for a future version downgrading.
Validating file. Please wait.....................
The current configuration is saved to the active main board successfully.
Slot 1:
Backup failed.
Failed to back up configuration file.
The system will overwrite the configuration file. Continue?[Y/N]:n
Failed to save the current configuration.
// 以上显示信息表明:主用主控板老软件版本的配置文件备份为_config_bak.cfg,备用主控板备份失败。设备提示用户选择后续操作,如果选择“N”则设备不再保存当前配置(下次启动时由老软件版本升级到新软件版本所做的配置将丢失);如果用户选择“Y”则由主用主控板运行的配置生成新的配置文件,并用新配置文件直接覆盖当前正在使用的配置文件。建议用户选择“Y”然后手工将主用主控板上备份的老配置文件_XXX_bak.cfg拷贝到备用主控板的存储介质中,以确保后续该主控板也能够顺利的降级回老版本。
# 将当前配置保存到1号备用主控板,文件名为test.cfg(方法一)。
<Sysname> save test.cfg slot 1
The current configuration will be saved to slot1#cfa0:/test.cfg. Continue? [Y/N]:y
Now saving current configuration to the device.
Saving configuration slot1#cfa0:/test.cfg. Please wait...
........
Configuration is saved to slot1#cfa0 successfully.
或者可以使用以下命令(方法二):
<Sysname> save slot1#cfa0:/test.cfg
# 直接将当前配置保存到主用下次启动配置文件,不再进行信息确认。
<Sysname> save force
Validating file. Please wait.....................
The current configuration is saved to the active main board successfully.
Slot 1:
The current configuration file is saved successfully.
Configuration is saved to device successfully.
(2) IRF模式应用
# 将当前配置保存到全局备用主控板(该单板所在成员设备的编号为2,槽位号为1),文件名为test.cfg(方法一)。
<Sysname> save test.cfg chassis 2 slot 1
The current configuration will be saved to chassis2#slot1#cfa0:/test.cfg. Continue? [Y/N]:y
Now saving current configuration to the device.
Saving configuration chassis2#slot1#cfa0:/test.cfg. Please wait...
.........
Configuration is saved to chassis2#slot1#cfa0 successfully.
或者可以使用以下命令(方法二):
<Sysname> save chassis2#slot1#cfa0:/test.cfg
# 直接将当前配置保存到主用下次启动配置文件,不再进行信息确认。
<Sysname> save force
Validating file. Please wait.......................
The current configuration is saved to the active main board successfully.
Chassis 1 Slot 1:
The current configuration file is saved successfully.
Configuration is saved to device successfully.
【命令】
slave auto-update config
undo slave auto-update config
【视图】
系统视图
【缺省级别】
2:系统级
【参数】
无
【描述】
slave auto-update config命令用来使能配置文件同步保存功能。undo slave auto-update config命令用来关闭配置文件同步保存功能。
缺省情况下,配置文件同步保存功能处于使能状态。
SR6600/SR6600-X路由器各款型对于本节所描述的命令的支持情况有所不同,详细差异信息如下:
型号 |
命令 |
描述 |
SR6602 |
slave auto-update config |
不支持 |
SR6602-X |
不支持 |
|
SR6604/SR6608/SR6616 |
支持 |
|
SR6604-X/SR6608-X/SR6616-X |
支持 |
【举例】
# 使能配置文件同步保存功能。
<Sysname> system-view
[Sysname] slave auto-update config
startup saved-configuration cfgfile [ backup | main ]
undo startup saved-configuration
【缺省级别】
3:管理级
【参数】
cfgfile:配置文件的名称,该文件必须是存储介质根目录下、后缀为.cfg的文件。
backup:将配置文件设置为备用下次启动配置文件。
main:将配置文件设置为主用下次启动配置文件。
startup saved-configuration命令用来配置下次启动配置文件(系统下次启动时使用的配置文件)。undo startup saved-configuration命令用来设置设备以空配置启动(空配置启动指使用设备的出厂配置启动)。(非IRF模式,SR6602/SR6602-X)
startup saved-configuration命令用来配置主用主控板和备用主控板的下次启动配置文件(系统下次启动时使用的配置文件)。undo startup saved-configuration命令用来设置主用主控板和备用主控板以空配置启动(空配置启动指使用设备的出厂配置启动)。(非IRF模式,SR6604/SR6608/SR6616/SR6604-X/SR6608-X/SR6616-X)
startup saved-configuration命令用来配置IRF中所有主控板下次启动配置文件(系统下次启动时使用的配置文件)。undo startup saved-configuration命令用来设置所有主控板以空配置启动(空配置启动指使用设备的出厂配置启动)。(IRF模式)
主用主控板和备用主控板的下次启动配置文件必须是相同的文件,因此,使用本命令前,请确保指定的配置文件已经保存在主用主控板和备用主控板存储介质的根目录下,否则,操作失败。(非IRF模式,SR6604/SR6608/SR6616/SR6604-X/SR6608-X/SR6616-X)
需要注意的是,执行undo startup saved-configuration命令并重启IRF或IRF中的成员设备时,会导致IRF分裂,请谨慎使用。(IRF模式)
需要注意,使用该命令设置配置文件时:
· startup saved-configuration和startup saved-configuration main命令执行效果相同:都是用来配置主用下次启动配置文件。
· 主用下次启动配置文件和备用下次启动配置文件可以设置为同一文件,但为了更可靠,建议设置为不同的文件,或者将一份配置保存在两个不同名的文件中,一个设置为主用,一个设置为备用。
· 在执行undo startup saved-configuration命令之后,系统会将主用/备用下次启动配置文件均设置为NULL,但不会删除该文件。
相关配置可参考命令display startup。
(1) 非IRF模式应用
· SR6602/SR6602-X
# 配置下次启动使用的配置文件。
<Sysname> startup saved-configuration testcfg.cfg
Please wait ....
... Done!
· SR6604/SR6608/SR6616/SR6604-X/SR6608-X/SR6616-X
# 配置下次启动使用的配置文件。
<Sysname> startup saved-configuration testcfg.cfg
Please wait ...
Setting the master board ..........
... Done!
Setting the slave board ...
Slot 1:
Set next configuration file successfully
(2) IRF模式应用
# 配置下次启动使用的配置文件。
<Sysname> startup saved-configuration testcfg.cfg
Please wait ...
Setting the master board ..........
... Done!
Setting the slave board ...
Chassis 2 Slot 1:
Set next configuration file successfully
不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!