2020-10-31

如何在不清空原有配置的情况下恢复路由器密码

第一步建立拓扑在这里插入图片描述

第二步重置密码 保存配置
Router>enable(进入用户特权模式)
Router#configure terminal(进入全局配置模式)
Router(config)#
Router(config)#hostname R1
R1(config)# (配置路由器的名字为R1)
R1(config)# no ip domain–lookup
R1(config)#banner motd # Authorized User Only !#
R1(config)#line console 0 (配置控制台密码)
R1(config-line)#password cisco(密码)
R1(config-line)#logging synchronous
R1(config-line)#exec–timeout 0 0
R1(config-line)#login
R1(config-line)#exit (退回到上一层)
R1(config)#line vty 0 4
R1(config-line)#password cisco
R1(config-line)#login
R1(config-line)#exit
R1(config)#enable password cisco123(配置特权模式密码,不加密)
R1(config)#enable secret cisco (此密码加密,enable secret 的密码生效
R1(config)#service pasword-encryption
R1(config)#interface fastEthernet 0/0 (进入接口,配置IP地址和子网密码
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#description Link to LAN
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface loopback 0
R1(config-if)#ip address 10.10.10.10 255.255.255.255
R1(config-if)#end (无论当前属于何种模式,使用end命令可以退到特权模式
R1#copy running-config startup-config
R1#show version
R1#show running-config
R1#show startup-config
R1#show interfaces fastEthernet 0/0
R1#show ip interface brief
在pc与路由器之间连接交叉线缆
R1#show ip interface brief
第三步 关闭路由器 重启路由器
在这里插入图片描述
在这里插入图片描述

第四步 重新登录
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值