H3C配置管理实验

H3C配置管理实验

实验拓扑

 

注:如无特别说明,描述中的R1或SW1对应的中设备名称数字为1的设备,R2或SW2对应的中设备名称为数字数字为2的设备,以等推


 

实验需求

  1. 按照图示连接到真机,并IP地址(真机IP地址配置到VirtualBox Host-Only Ethernet Adapter网卡)
  2. R1保存当前配置
  3. 在R1上开启FTP服务
  4. 使用真机访问FTP服务,将R1的配置文件拷贝到本地
  5. 在R1上清空配置,重启R1,确认已配置为空配状态
  6. 再次在R1开启FTP服务,并把真机拷贝的配置文件还原到路由器
  7. 更改 R1 的启动配置文件名
  8. 还原重启R1,确认配置已

 


实验解法

  1. 配置IP地址部分略
  2. R1保存当前配置,并确认,命令如下

    [R1]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...
    Configuration is saved to device successfully.

     

  3. R1上开启FTP服务,创建用户wangdaye,密码123

    步骤1:开启FTP服务

    [R1]ftp server enable

     

    步骤2:创建用于FTP身份验证的用户,配置密码,并设置用户权限级别和服务类型

    [R1]local-user wangdaye class manage 
    New local user added.
    [R1-luser-manage-wangdaye]password simple 123456
    [R1-luser-manage-wangdaye]authorization-attribute user-role level-15
    [R1-luser-manage-wangdaye]service-type ftp
  4. 使用真机访问FTP服务,备份R1的配置文件

  • 步骤1:使用资源管理器访问FTP服务,如图1-2所示
  • 步骤2:输入用户名和密码,如图1-3所示
  • 步骤3:复制R1的配置文件,如图1-4所示
  1. 在R1上清空配置,命令如下

      分析:此时将R1的配置备份到PC上,现在将R1的配置清空,再测试还原备份的配置是否有效

    <R1>reset saved-configuration 
    The saved configuration file will be erased. Are you sure? [Y/N]:y
    Configuration file in flash: is being cleared.  
    Please wait ...
    Configuration file is cleared.
  2. 重启R1,命令如下

      注意:重启设备时,第一次确认提示是设备检测到被配置清空,查询是否要保存当前配置。n第二次需要输入来否定;第二次确认提示是否确认是否要重启,应该输入y

    <R1>reboot
    Start to check configuration with next startup configuration file, please wait.........DONE!
    Current configuration may 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...
  3. 查看R1配置,发现R1的配置已经变成空配状态

    <H3C>display current-configuration 
    #
     version 7.1.075, Alpha 7571
    #
     sysname H3C
    #
    system-working-mode standard
    xbar load-single
    password-recovery enable
    lpu-type f-series
    #
    vlan 1
  4. 再次把R1的g0/0口配置IP地址,并开启FTP,命令略

  5. 还原把真上的配置文件还原到主机,过程略

  6. 更改 R1 的启动配置文件名,命令如下

    <H3C>startup saved-configuration startup.cfg 
    Please wait...... Done.
  7. 还原重启R1,确认配置已经到清空前的状态

    <R1>display cu
    <R1>display current-configuration 
    #
     version 7.1.075, Alpha 7571
    #
     sysname R1
    #
     system-working-mode standard
     xbar load-single
     password-recovery enable
     lpu-type f-series
    #
    vlan 1
posted @ 2021-06-14 11:54  isicman  阅读(473)  评论(0编辑  收藏  举报