简介
本文档介绍如何更新配置寄存器(config-register)以更改路由器行为。
先决条件
要求
本文档没有任何特定的要求。
使用的组件
本文档不限于特定的软件和硬件版本。
本文档中的信息都是基于特定实验室环境中的设备编写的。本文档中使用的所有设备最初均采用原始(默认)配置。如果您的网络处于活动状态,请确保您了解所有命令的潜在影响。
规则
有关文档规则的详细信息,请参阅 Cisco 技术提示规则。
配置寄存器的用途
配置寄存器可用于以多种方式更改路由器行为,例如:
-
路由器如何引导(进入 ROMmon、NetBoot)
-
启动选项(忽略配置,禁用启动消息)
注意:如果波特率设置为与默认速率不同,CLI上将显示奇数字符。检查通用平台参数表,为不同 confreg 值设置波特率。
配置寄存器可从配置模式使用config-register 命令设置。从ROMmon,执行confreg命令。发出show version命令,查看配置寄存器的当前设置:
Router#show version
Cisco IOS XE Software, Version 16.10.01a
Cisco IOS Software [Gibraltar], ASR1000 Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 16.10.1a, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2018 by Cisco Systems, Inc.
Compiled Thu 29-Nov-18 03:47 by mcpre
Cisco IOS-XE software, Copyright (c) 2005-2018 by cisco Systems, Inc.
All rights reserved. Certain components of Cisco IOS-XE software are
licensed under the GNU General Public License ("GPL") Version 2.0. The
software code licensed under GPL Version 2.0 is free software that comes
with ABSOLUTELY NO WARRANTY. You can redistribute and/or modify such
GPL code under the terms of GPL Version 2.0. For more details, see the
documentation or "License Notice" file accompanying the Cisco IOS-XE software,
or the applicable URL provided on the flyer accompanying the Cisco IOS-XE
software.
ROM: IOS-XE ROMMON
Router uptime is 2 minutes
Uptime for this control processor is 5 minutes
System returned to ROM by Reload Command
System image file is "bootflash:asr1002x-universalk9.16.10.01a.SPA.bin"
Last reload reason: Reload Command
This product contains cryptographic features and is subject to United
States and local country laws governing import, export, transfer and
use. Delivery of Cisco cryptographic products does not imply
third-party authority to import, export, distribute or use encryption.
Importers, exporters, distributors and users are responsible for
compliance with U.S. and local country laws. By using this product you
agree to comply with applicable laws and regulations. If you are unable
to comply with U.S. and local laws, return this product immediately.
A summary of U.S. laws governing Cisco cryptographic products may be found at:
http://www.cisco.com/wwl/export/crypto/tool/stqrg.html
If you require further assistance please contact us by sending email to
export@cisco.com.
License Type: Smart License is permanent
License Suite: AdvUCSuiteK9
Next reload License Suite: AdvUCSuiteK9
The current throughput level is 10000000 kbps
Smart Licensing Status: UNREGISTERED/EVAL MODE
cisco ASR1002-X (2RU-X) processor (revision 2KP) with 1189381K/6147K bytes of memory.
Processor board ID FOX1719GE28
14 Gigabit Ethernet interfaces
1 Ten Gigabit Ethernet interface
32768K bytes of non-volatile configuration memory.
4194304K bytes of physical memory.
6684671K bytes of eUSB flash at bootflash:.
0K bytes of WebUI ODM Files at webui:.
Configuration register is 0x2102
配置寄存器的出厂默认设置是0x2102。这表明路由器必须尝试从闪存加载Cisco IOS®软件映像,并加载启动配置。
注意:命令config-register无法更改控制台波特率。在旧版Cisco IOS中,config-register命令确实可用于更改控制台波特率,但是,对于Cisco IOS XE,您需要配置线路控制台速度以更改波特率。
配置寄存器值及其意义
configreg
如果知道配置寄存器的值,则可以确定其意义。有关配置寄存器、潜在问题和修复的信息,请收集show version命令或show tech-support命令的输出,并输入到思科CLI分析器工具中。
注意:只有思科注册用户才能访问内部工具和漏洞信息。
此表包含了在大多数平台上有效的一些常用参数。
注意:在将路由器上的配置寄存器更改为下表中的值之一之前,请查阅相应的硬件安装指南以验证可以使用配置寄存器。
平台通用参数
配置寄存器设置 |
路由器工作情况 |
0x102 |
|
0x1202 |
|
0x2101 |
- 引导进入引导程序
- 忽略中断
- 如果初始引导失败,则引导进入 ROM
- 9600控制台波特率
|
0x2102 |
- 忽略中断
- 如果初始引导失败,则引导进入 ROM
- 9600 控制台波特率默认值(对于大多数平台)
|
0x2120 |
|
0x2122 |
- 忽略中断
- 如果初始引导失败,则引导进入 ROM
- 19200控制台波特率
|
0x2124 |
- NetBoot
- 忽略中断
- 如果初始引导失败,则引导进入 ROM
- 19200 控制台速率
|
0x2142 |
- 忽略中断
- 如果初始引导失败,则引导进入 ROM
- 9600控制台波特率
- 忽略非易失性 RAM (NVRAM) 的内容(忽略配置)
|
0x2902 |
- 忽略中断
- 如果初始引导失败,则引导进入 ROM
- 4800控制台波特率
|
0x2922 |
- 忽略中断
- 如果初始引导失败,则引导进入 ROM
- 38400控制台波特率
|
0x3122 |
- 忽略中断
- 如果初始引导失败,则引导进入 ROM
- 57600控制台波特率
|
0x3902 |
- 忽略中断
- 如果初始引导失败,则引导进入 ROM
- 2400控制台波特率
|
0x3922 |
- 忽略中断
- 如果初始引导失败,则引导进入 ROM
- 115200控制台波特率
|
注意:此外,请记住,配置寄存器0x2142用于口令恢复过程,因为它可以忽略NVRAM的内容。
如果已有的配置寄存器值不在表里,则确定为计算该值设置了哪些位:
位顺序值
位编号 |
十六进制 |
意义 |
00-03 |
0x0000-0x000F |
引导字段参数:
|
06 |
0x0040 |
|
07 |
0x0080 |
|
08 |
0x0100 |
|
09 |
0x0200 |
|
10 |
0x0400 |
|
5,11,12 |
0x0020、0x0800、0x1000 |
|
13 |
0x2000 |
|
14 |
0x4000 |
|
15 |
0x8000 |
|
配置控制台波特率设置的正确方法是进入线路控制台配置模式并修改速度,如下例所示:
In non-Controller mode Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#line console 0 Router(config-line)#speed 19200 Router(config-line)#end In Controller (SDWAN) mode Router#config-transaction Router(config)#line con 0 Router(config-line)#speed 19200
重新加载路由器后,在前面的两种场景中,配置寄存器都更改为0x2122。
配置寄存器问题故障排除
未正确设置配置寄存器可能导致许多问题,如:
-
配置文件被忽略。
-
控制台无输出或垃圾输出。
-
引导至ROMmon。
将配置寄存器更改为适当的参数(例如出厂默认设置0x2102),以便解决这些问题。
未知配置寄存器值故障排除
如果配置寄存器值未知,则尝试与路由器建立 Telnet 或控制台会话。然后检查 show version 的输出,确定配置寄存器的值:
Router#show version
Cisco IOS XE Software, Version 16.10.01a
Cisco IOS Software [Gibraltar], ASR1000 Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 16.10.1a, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2018 by Cisco Systems, Inc.
Compiled Thu 29-Nov-18 03:47 by mcpre
Cisco IOS-XE software, Copyright (c) 2005-2018 by cisco Systems, Inc.
All rights reserved. Certain components of Cisco IOS-XE software are
licensed under the GNU General Public License ("GPL") Version 2.0. The
software code licensed under GPL Version 2.0 is free software that comes
with ABSOLUTELY NO WARRANTY. You can redistribute and/or modify such
GPL code under the terms of GPL Version 2.0. For more details, see the
documentation or "License Notice" file accompanying the Cisco IOS-XE software,
or the applicable URL provided on the flyer accompanying the Cisco IOS-XE
software.
ROM: IOS-XE ROMMON
Router uptime is 1 minute
Uptime for this control processor is 4 minutes
System returned to ROM by Reload Command
System image file is "bootflash:asr1002x-universalk9.16.10.01a.SPA.bin"
Last reload reason: Reload Command
This product contains cryptographic features and is subject to United
States and local country laws governing import, export, transfer and
use. Delivery of Cisco cryptographic products does not imply
third-party authority to import, export, distribute or use encryption.
Importers, exporters, distributors and users are responsible for
compliance with U.S. and local country laws. By using this product you
agree to comply with applicable laws and regulations. If you are unable
to comply with U.S. and local laws, return this product immediately.
A summary of U.S. laws governing Cisco cryptographic products may be found at:
http://www.cisco.com/wwl/export/crypto/tool/stqrg.html
If you require further assistance please contact us by sending email to
export@cisco.com.
License Type: Smart License is permanent
License Level: adventerprise
Next reload license Level: adventerprise
The current throughput level is 10000000 kbps
Smart Licensing Status: UNREGISTERED/EVAL MODE
cisco ASR1002-X (2RU-X) processor (revision 2KP) with 1189381K/6147K bytes of memory.
Processor board ID FOX1719GE28
14 Gigabit Ethernet interfaces
1 Ten Gigabit Ethernet interface
32768K bytes of non-volatile configuration memory.
4194304K bytes of physical memory.
6684671K bytes of eUSB flash at bootflash:.
0K bytes of WebUI ODM Files at webui:.
Configuration register is 0x2142
如果不能建立控制台会话,或者只能看到垃圾字符,则可能是由路由器与终端仿真软件的速率不匹配引起的。尝试更改终端仿真软件的波特率。可能的速率包括1200、2400、4800、9600、19200、38400、57600和115200。一旦建立会话,即可发出show version命令确定设置。如果路由器处于 ROMmon 模式,则可尝试发出 boot 命令,手动引导操作系统。
rommon 4 > boot bootflash:asr1002x-universalk9.16.10.01a.SPA.bin
有关配置寄存器集的重要意义以及潜在问题和修复的信息,请收集show version命令或show tech-support命令的输出,并将其输入到思科CLI分析器工具中。
注意:只有思科注册用户才能访问内部工具和漏洞信息。
对已知配置寄存器值进行故障排除
如果您知道配置寄存器的值,请查看“配置寄存器”表以确定行为。 如果能通过 Telnet 访问路由器,则与路由器建立会话。如果没有,请将终端仿真程序设置为配置寄存器集指示的波特率,以建立控制台会话,其中9600波特率为默认值。
设置配置寄存器
查看配置寄存器表以确定所需的配置寄存器集(通常为0x2102)。
从配置模式设置配置寄存器
发出 config-register 命令设置配置寄存器:
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#config-register 0x2102
Router(config)#end
Router#show version
Cisco IOS XE Software, Version 16.10.01a
Cisco IOS Software [Gibraltar], ASR1000 Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 16.10.1a, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2018 by Cisco Systems, Inc.
Compiled Thu 29-Nov-18 03:47 by mcpre
Cisco IOS-XE software, Copyright (c) 2005-2018 by cisco Systems, Inc.
All rights reserved. Certain components of Cisco IOS-XE software are
licensed under the GNU General Public License ("GPL") Version 2.0. The
software code licensed under GPL Version 2.0 is free software that comes
with ABSOLUTELY NO WARRANTY. You can redistribute and/or modify such
GPL code under the terms of GPL Version 2.0. For more details, see the
documentation or "License Notice" file accompanying the Cisco IOS-XE software,
or the applicable URL provided on the flyer accompanying the Cisco IOS-XE
software.
ROM: IOS-XE ROMMON
Router uptime is 6 minutes
Uptime for this control processor is 9 minutes
System returned to ROM by Reload Command
System image file is "bootflash:asr1002x-universalk9.16.10.01a.SPA.bin"
Last reload reason: Reload Command
This product contains cryptographic features and is subject to United
States and local country laws governing import, export, transfer and
use. Delivery of Cisco cryptographic products does not imply
third-party authority to import, export, distribute or use encryption.
Importers, exporters, distributors and users are responsible for
compliance with U.S. and local country laws. By using this product you
agree to comply with applicable laws and regulations. If you are unable
to comply with U.S. and local laws, return this product immediately.
A summary of U.S. laws governing Cisco cryptographic products may be found at:
http://www.cisco.com/wwl/export/crypto/tool/stqrg.html
If you require further assistance please contact us by sending email to
export@cisco.com.
License Type: Smart License is permanent
License Level: adventerprise
Next reload license Level: adventerprise
The current throughput level is 10000000 kbps
Smart Licensing Status: UNREGISTERED/EVAL MODE
cisco ASR1002-X (2RU-X) processor (revision 2KP) with 1189381K/6147K bytes of memory.
Processor board ID FOX1719GE28
14 Gigabit Ethernet interfaces
1 Ten Gigabit Ethernet interface
32768K bytes of non-volatile configuration memory.
4194304K bytes of physical memory.
6684671K bytes of eUSB flash at bootflash:.
0K bytes of WebUI ODM Files at webui:.
Configuration register is 0x2142 (will be 0x2102 at next reload)
路由器重新加载后,新的配置寄存器集将变为活动状态。
Router#reload System configuration has been modified. Save? [yes/no]: n Proceed with reload? [confirm]
从 ROMmon 设置配置寄存器
如果路由器处于 ROMmon 模式,则使用 confreg 命令设置配置寄存器:
rommon 1 > confreg 0x2102
要让新的配置寄存器生效,必须进行重置或为其重新通电。
相关信息