三、管理配置寄存器
默认情况,配置寄存器被设置为从闪存加载思科IOS,并在NVRAM中查找并加载启动配置文件。 3.1 配置寄存器默认为 0x2102
---- 2100 启动ROM监控模式
---- 2101 从ROM中加载微型IOS引导路由器
---- 2002-210F 都是要求路由器使用在NVRAM中指定的启动命令 3.2
Router>show version //此命令用于显示路由器系统的硬件配置、软件版本以及启动映像文件名
...
Configuration register is 0x2102
Router(boot)#show flash //此命令 你将看到闪存中保存的可用于允许的IOS
。。。
。。。 3.3 修改配置寄存器
Router(config)#config-register 0x2101
Router(config)#^Z
Router#show version
Configuration register is 0x2102(will be 0x2101 at next reload) 3.4 密码恢复 (在ROM监控模式下操作)
已知:配置寄存器的默认为 0x2102, 且第6位是关闭的,开启第6位,明确告诉路由器不加载NVRAM中的配置内容 即:0x2142
1、终端路由器启动序列 (ctrl+break)
2、修改配置寄存器 (0x2142)
Router(config)#config-register 0x2142
Router(config)#reset
特殊的2500系列路由器
发送ctrl+break
按o
o/r 0x2142
3、重启路由器
4、查看并修改配置内容
copy startup-config running-config (copy start run
config t
enable secret todd
5、恢复配置寄存器的值并重新启动路由器
config t
config-register 0x2102
copy run start
最后 reload
3.5 boot system 命令
已知:可以修改配置寄存器让路由器加载其他IOS (而不是默认的闪存IOS)
也许你希望让使用路由器都通过某个TFTP主机完成启动
下面介绍一些boot命令,管理路由器启动时加载IOS的方式。
Router>en
Router#config t
Router(config)#boot system [System image file]
3.5.1 指定flash中的某个文件为启动IOS
Router(config)#boot system flash c2800nm-advsecurityk9-mz.124-12.bin
3.5.2指定从TFTP主机上引导
Router(config)#boot system tftp c2800nm-advsecurityk9-mz.124-12.bin 1.1.1.2
3.5.3指定从ROM中加载微型IOS
Router(config)#boot system rom
4.1验证闪存(查看闪存空间)
Router#show flash
Router#show version //此命令能更方便的获知闪存的容量; 4.2备份思科IOS
Router#ping 1.1.1.2
//是否ping通TFTP主机?
Router#copy flash tftp
Source filename [ ]? c2800nm-advsecurityk9-mz.124-12.bin
Address or name of remote host [ ]? 1.1.1.2
Destination filename[ c2800nm-advsecurityk9-mz.124-12.bin ] ? [ enter]
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
....
4.3恢复或升级思科路由器的IOS
注意:确认复制到闪存的IOS文件已经存放在TFTP服务器的默认目录下。
Router#copy tftp flash
Address or name of remote host [ ]? 1.1.1.2
Source filname [ ]?c2800nm-advsecurityk9-mz.124-12.bin
...
.... !!!!
... 4.4 使用思科IOS 文件系统 (Cisco IFS)
五、备份和恢复思科配置 5.1备份思科路由器配置文件 1.验证当前配置
Router#show running-config
Building configuration ...
Current configuration:776 bytes
!
version 12.4 2.验证已存储的配置
Router#show startup-config
Using 776 out of 245752 bytes
!
version 12.4
//如果上述两个配置文件的内容并不一样,也许你可以考虑使用copy run start 命令 3.复制当前配置到NVRAM
Router#copy running-config startup-config
Destination filename [ startup-config ]? [ enter ]
Building configuration...
[ OK ] 4.复制配置到TFTP 服务器
Router#copy running-config tftp
Address or name of remote host [ ] ? 1.1.1.2
Destination filename [router-config]?todd-confg
!!
....
5.2 恢复思科路由器的配置
Router#copy tftp running-config
Address or name of remote host [ ]? 1.1.1.2
Source filname [ ]? todd-confg
....
.....
//配置文件时一个ASCII的文本文件
六、使用思科发现协议
CDP(Cisco Discovery Protocol,思科发现协议)时由思科设计的专用协议,可以收集关于本地附近和远程连接设备的相关信息 6.1获取 CDP 定时器和保持时间的相关信息
Corp#show cdp
Global CDP information:
Sending CDP packets every 60 seconds //CDP定时器,描述由所有活动接口将CDP 分组发送出去的时间间隔
Sending a holdtime value of 180 seconds //CDP保持时间,描述接收自相邻设备的CDP分组应被当前设备保持的时间长度。
Sending CDPv2 advertisements is enabled