配置文件管理快速配置指南

Copyright © 2024 新华三技术有限公司 版权所有,保留一切权利。

非经本公司书面许可,任何单位和个人不得擅自摘抄、复制本文档内容的部分或全部,并不得以任何形式传播。

除新华三技术有限公司的商标外,本手册中出现的其它公司的商标、产品标识及商品名称,由各自权利人拥有。

本文档中的信息可能变动,恕不另行通知。

目  录

1 恢复出厂配置

1.1 简介

1.2 配置注意事项

1.3 配置步骤

1.4 相关资料

2 备份配置文件

2.1 简介

2.2 组网需求

2.3 配置准备

2.4 配置步骤

2.5 验证配置

2.6 相关资料

3 跳过自动配置

3.1 简介

3.2 组网需求

3.3 配置准备

3.4 配置步骤

3.5 相关资料

1  恢复出厂配置

1.1  简介

本案例介绍使设备恢复到出厂状态的常用方法。

1.2  配置注意事项

不同设备支持恢复到出厂状态方法可能不同,具体以设备的实际情况为准。

恢复出厂配置后,设备会清除所有用户的配置信息。因此,用户需要登录设备的Console口进行操作,不能通过SSH或Telnet方式远程登录设备。关于Console登录设备的方法,请参见“通过Console登录设备快速配置指南”。

1.3  配置步骤

  • 执行restore factory-default命令行并重启设备

# 将设备恢复到出厂状态。

<Sysname> restore factory-default

This command will restore the system to the factory default configuration and clear the operation data. Continue [Y/N]:y

Restoring the factory default configuration. This process might take a few minutes. Please wait..........................................................................................................Done.

Please reboot the system to place the factory default configuration into effect.

# 重启设备,请不要选择保存当前配置。重启完成之后,设备将恢复到出厂状态。

<Sysname> reboot
Start to check configuration with next startup configuration file, please wait.........DONE!
Current configuration will be lost after the reboot, save current configuration? [Y/N]:n

This command will reboot the device. Continue? [Y/N]:y

Now rebooting, please wait...

  • 删除配置文件并重启设备

# 显示用于本次及下次启动的配置文件的名称。

<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

# 查看设备当前已存在的配置文件。

<Sysname> dir

Directory of flash:

   0 -rw-        6244 Jan 08 2013 07:26:03   startup.cfg

   1 -rw-      136628 Jan 08 2013 07:26:03   startup.mdb

   2 -rw-       58704 Jan 03 2013 07:56:22   diag_H3C_20130103-005605.tar.gz

...

# 删除下次启动的配置文件。

<Sysname> delete /unreserved startup.cfg

The file cannot be restored. Delete flash:/startup.cfg?[Y/N]:y

Deleting a file permanently will take a long time. Please wait...

%Delete file flash:/startup.cfg...Done.

# 重启设备。重启完成之后,设备将恢复到出厂状态。

<Sysname> reboot

Start to check configuration with next startup configuration file, please wait.........DONE!

Current configuration will be lost after the reboot, save current configuration? [Y/N]:n

This command will reboot the device. Continue? [Y/N]:y

Now rebooting, please wait...

  • 清除保存的配置并重启设备

  • 缺省情况下,本特性会将下次启动配置文件从所有的成员设备上彻底删除,请谨慎使用。如果只需从主设备上删除下次启动配置文件,请关闭配置文件同步功能。
  • 重启设备时,请勿保存当前配置文件。

# 显示用于本次及下次启动的配置文件的名称。

<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

# 删除下次启动的主用配置文件。

<Sysname> reset saved-configuration

The saved configuration file will be erased. Are you sure? [Y/N]:Y

如果设备上存在备用配置文件,则需再执行reset saved-configuration backup命令,本例中不需要执行此命令。

# 重启设备。重启完成之后,设备将恢复到出厂状态。

<Sysname> reboot
Start to check configuration with next startup configuration file, please wait.........DONE!

Current configuration will be lost after the reboot, save current configuration? [Y/N]:n

This command will reboot the device. Continue? [Y/N]:y

Now rebooting, please wait...

1.4  相关资料

  • 产品配套“基础配置指导”中的“配置文件管理”。
  • 产品配套“基础配置命令参考”中的“配置文件管理”。
  • 产品配套“基础配置指导”中的“设备管理”。
  • 产品配套“基础配置命令参考”中的“设备管理”。
  • 产品配套“基础配置指导”中的“文件系统管理”。
  • 产品配套“基础配置命令参考”中的“文件系统管理”。

2  备份配置文件

2.1  简介

本案例介绍备份配置文件方法。

2.2  组网需求

图1示,备份Device的当前配置文件,并保存到FTP Server上。

图1 备份配置文件组网图

2.3  配置准备

请确保Device设备与FTP Server间路由可达。

2.4  配置步骤

# 保存设备配置,配置文件名采用缺省名字startup.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:/startup.cfg]

(To leave the existing filename unchanged, press the enter key):

Validating file. Please wait...

Saved the current configuration to mainboard device successfully.

以上表明设备默认保存了一个名为starup.cfg的配置文件。

# 将startup.cfg文件上传到FTP服务器上。

<Sysname> ftp 192.168.10.1

Press CTRL+C to abort.

Connected to 192.168.10.1 (192.168.10.1).

220 WFTPD 2.0 service (by Texas Imperial Software) ready for new user

User (192.168.10.1:(none)): root

331 Give me your password, please

Password:

230 Logged in successfully

Remote system type is MSDOS.

ftp> binary

200 Type is Image (Binary)

ftp> put start.cfg

ftp: No such file or directory

ftp> put startup.cfg

227 Entering Passive Mode (192,168,10,1,235,54)

150 "D:\temp\startup.cfg" file ready to receive in IMAGE / Binary mode

.

226 Transfer finished successfully.

4326 bytes sent in 0.003 seconds (1.49 Mbytes/s)

2.5  验证配置

# 查看上传的配置文件。

ftp> dir

227 Entering Passive Mode (192,168,10,1,252,152)

1 File Listing Follows in ASCII mode

-rwxrwxrwx   1 noone    nogroup     4326 Sep  2 14:00 startup.cfg

以上表明startup.cfg文件已上传到FTP服务器上。

2.6  相关资料

  • 产品配套“基础配置指导”中的“配置文件管理”。
  • 产品配套“基础配置命令参考”中的“配置文件管理”。
  • 产品配套“基础配置指导”中的“FTP和TFTP”。
  • 产品配套“基础配置命令参考”中的“FTP和TFTP”。

3  跳过自动配置

3.1  简介

自动配置功能是指设备在启动时自动获取并执行配置文件。网络管理员只需将配置文件保存在指定的存储介质上,启动设备,即可实现自动配置,从而简化了网络配置,大大降低了网络管理员的工作量,便于实现对设备的集中管理。应用场景是网络规模较大,设备位置较分散。

设备空配置启动时,首先自动检查存储介质的根目录下是否存在autocfg.pyautocfg.tcl autocfg.cfg配置文件。如果存在,则直接执行此文件;如果不存在,则通过自动从文件服务器上获取并执行配置脚本文件或配置文件,实现自动配置功能。autocfg.pyautocfg.tclautocfg.cfg配置文件同时只能在设备上存在一个。

但是有的时候设备并不会应用在网络规模较大的场景中,所以就需要跳过自动配置

本案例介绍跳过自动配置方法。

3.2  组网需求

图2所示,设备空配置启动,跳过自动配置。

图2 跳过自动配置组网图

3.3  配置准备

设备空配置启动,需使用Console口登录设备。关于Console登录设备的方法,请参见“通过Console登录设备快速配置指南”。

3.4  配置步骤

# 设备开机启动。

Starting......

Press Ctrl+D to access BASIC BOOT MENU

Press Ctrl+T to start heavy memory test

********************************************************************************

*                                                                              *

*                 H3C S5570S-28S-HPWR-EI  BOOTROM, Version 105                 *

*                                                                              *

********************************************************************************

Copyright (c) 2004-2021 New H3C Technologies Co., Ltd.

Creation Date         : Jul  6 2021

CPU Clock Speed       : 1000MHz

Memory Type           : DDR4 SDRAM

Memory Size           : 1024MB

Memory Speed          : 800MHz

CPLD Version          : 001

PCB Version           : Ver.A

Mac Address           : b04414cd47a4

BootRom Validating...

Press Ctrl+B to access EXTENDED BOOT MENU...0

Loading the main image files...

Loading file flash:/s5570s_ei-cmw710-system-e1105p09.bin........................

.......................................................Done.

Loading file flash:/s5570s_ei-cmw710-devkit-e1105p09.bin.....Done.

Loading file flash:/s5570s_ei-cmw710-boot-e1105p09.bin.........Done.

Image file flash:/s5570s_ei-cmw710-boot-e1105p09.bin is self-decompressing......

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

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

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

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

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

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

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

................Done.

System is starting...

Cryptographic algorithms tests passed.

Startup configuration file doesn't exist or is invalid.

Performing automatic configuration... Press CTRL_C or CTRL_D to break.

Automatic configuration attempt: 1.

Not ready for automatic configuration: no interface available.

Waiting for the next...

Automatic configuration attempt: 2.

Not ready for automatic configuration: no interface available.

Waiting for the next...

可以通过按“CTRL+D”或者“Ctrl+C”中断自动配置,进入Comware系统。

3.5  相关资料

  • 产品配套“基础配置指导”中的“自动配置”。
  • 产品配套“基础配置命令参考”中的“自动配置”。
阅读剩余
THE END