当前位置: 首页 > 系统教程 > 电脑教程 > 详细页面

使用命令恢复思科路由器设置

发布时间:2018-10-04 08:18:27 文章来源:windows7 ghost 作者: 强子电报

  speed auto
  Current configuration : 71 bytes

  duplex auto
    *Aug 10 13:06:43.269: %LINK-5-CHANGED: Interface FastEthernet4,changed state
  assumed to be a complete configuration, not a partial configuration. Enter Y if you are
R1-871W#

  End with CNTL/Z.
  This will apply all necessary additions and deletions to replace the current

! notice the "rollback done" message and how the interface immediately started coming up (below)
  R1-871W#conf t
  Building configuration...
  speed auto
  Total number of passes: 1

! verifying that the Fa4 interface is shutdown
  duplex auto
  Current configuration : 81 bytes

  no ip address
  R1-871W#sh run int fa4
  R1-871W(config-if)# shutdown
    to administratively down

怎样尽快消除恢复startup-config造成的问题?configure replace命令是最佳的选择,可以完美地解决这个两难局面。此命令会将running-config和要替换的配置进行比较。并可以更换配置。它可以发现两种配置之间的不同,然后仅仅运行这些不同的部分。这个命令不会影响到没有改变过的配置,并且不会引起任何死机。

configure replace tftp://192.168.1.107/config-bu

你曾经是否遇到过这样一种情况,对思科路由器或交换机进行调整,接着却需要调整删除?实际上有几种方法可以作到这一点,但哪种方法是最安全和最简单的呢?重新启动路由器或交换机不是问题的正确答案。事实上,一个简单的命令是一个最佳的选择。

    *Aug 10 13:06:55.189: Rollback:Acquired Configuration lock.

! showing the current configuration for the Fa4 interface
  R1-871W#

  sure you want to proceed. ? [no]: y
  Enter configuration commands, one per line.

! interface FastEthernet4
  R1-871W#
  R1-871W#sh run int fa4
  running configuration with the contents of the specified configuration file, which is
    *Aug 10 13:06:44.269: %LINEPROTO-5-UPDOWN: Line protocol on Interface

如果有冲突的话,它会将命令留在running-config之中。最后你得到的就是一个混合的配置。此外,它也有可能带来一些由于配置混合导致无法预测的结果,最终导致路由器出现一些死机瘫痪的状态。

    *Aug 10 13:07:00.245: %LINEPROTO-5-UPDOWN: Line protocol on
  R1-871W#

通常情况下,你将利用路由器的非易失性存储器(NVRAM)中的起始配置(startup-config),来替换当前配置(running-config) 。这样的话,你需要下面的命令:

  no ip address
  no ip address
end
  R1-871W# sh run int fa4
end

我们假设你在一个路由器上已经实施了某些修改,生成了一个巨大的配置文件。这样的话,可能在进行修改的同时,windows7 专业版 密钥,你已经发现了有些地方不对劲,而等到进行测试时,期望的新功能的确也没发挥作用。

Configure replace命令是非常有用的。它可以将浪费时间缩到最短,又能让你恢复到变化之前的起点。如果需要更详细的资料,可以访问思科的官方网站。

end

! replacing the current config with the saved config

! shutting down the Fa4 interface
  R1-871W#

! interface FastEthernet4
    Interface FastEthernet4,changed state to up

如果你没有保存原始配置的话,可以重新载入路由器。这个方法有效,但你将不得不重新载入所有的数据。此外,为什么需要重新载入呢,实际上没有必要这么麻烦?

configure replace nvram:startup-config

Rollback Done

实际上,最后一个参数可以选择任何有效的config文件,只要是思科网际操作系统支持的URL格式。举例来说,你可以使用支持简单文件传输协议(TFTP)、 文件传输协议(FTP)、超文本传输协议(HTTP)、RCP或者SCP等各种协议的服务器上的config文件。在这种情况下,命令看起来就会像下面的情况:

    *Aug 10 13:06:43.273: %SYS-5-CONFIG_I: Configured from console by console
  R1-871W(config)# int fa4
  R1-871W# configure replace nvram:startup-config

你也可以使用copy startup-config running-config的命令。不过,这个命令的工作方法可能和你想的不一样。它只是将startup-config命令和running-config命令简单的合并起来。

  Building configuration...

这时,你所需要的是返回原始状态,windows7锁屏密码设置,重新开始。具体该怎么做呢?这里有几个选择。

  Current configuration : 71 bytes

! interface FastEthernet4
  shutdown
  Building configuration...
  speed auto
  duplex auto
  R1-871W(config-if)#^Z

! verifying that the interface is now set to up
    FastEthernet4,changed state to down
    *Aug 10 13:06:59.245: %LINK-3-UPDOWN: Interface FastEthernet4, changed state to up

附件A就是一个使用配置取代命令的基本例子。首先,我关闭了FastEthernet4接口,然后我使用了configure replace nvram:startup-config命令,来用我的起始设置(startup-configuration)替换掉当前设置(running-configuration)。 虽然这是一个明显简化的示例,但是还是体现了命令的实际工作方式。

综上所述,这就是windows7 ghost的本文作者:强子电报给你们提供的使用命令恢复思科路由器设置了,所写的原创文章仅此参考,觉得这篇文章不错就可以分享给身边的朋友,欢迎点评,版权声明:如若转载,请注明:windows7 ghost,谢谢!

返回windows7系统下载首页
60