簡介
本文描述如何更新配置暫存器(config-register)以改變路由器行為。
必要條件
需求
本文件沒有特定需求。
採用元件
本文件所述內容不限於特定軟體和硬體版本。
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路運作中,請確保您瞭解任何指令可能造成的影響。
慣例
如需文件慣例的詳細資訊,請參閱思科技術提示慣例。
配置暫存器的用途
配置暫存器可以透過多種方式改變路由器的行為,例如:
-
路由器啟動方式(進入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命令的輸出,並輸入到Cisco CLI Analyzer工具中。
附註:只有已註冊的Cisco使用者才能存取內部工具和Bug資訊。
此表包含一些在大多數平台上有效的通用引數。
注意:在將路由器上的配置暫存器更改為下表中的值之一之前,請檢視相應的硬體安裝指南以驗證配置暫存器是否可用。
平台通用引數
配置暫存器集位於 |
路由器行為 |
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 |
啟動欄位引數:
-
0x0000 -保留在系統bootstrap提示符下。
-
0x0001 -啟動板載快閃記憶體(EPROM)中的第一個系統映像。
-
0x0002-0x000F -指定預設netboot檔名。啟用可覆寫預設netboot檔案名稱的啟動系統命令。
|
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命令的輸出,並輸入到Cisco CLI Analyzer工具中。
附註:只有已註冊的Cisco使用者才能存取內部工具和Bug資訊。
對已知配置暫存器值進行故障排除
如果您知道配置暫存器值,請檢視「配置暫存器」表以確定行為。 如果可以透過Telnet訪問路由器,請與該路由器建立會話。否則,將終端模擬程式設定為配置暫存器集所指示的波特率,以建立控制檯會話,其中9600波特率是預設值。
設定配置暫存器
檢視「配置暫存器」(Configuration Register)表以確定所需的配置暫存器集(通常為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
您必須重置或重新啟動電源,新配置暫存器才能生效。
相關資訊