簡介
本文說明如何更新配置暫存器(config-register
)以更改路由器行為。
必要條件
需求
本文件沒有特定需求。
採用元件
本文件所述內容不限於特定軟體和硬體版本。
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路運作中,請確保您瞭解任何指令可能造成的影響。
配置暫存器的用途
配置暫存器可用於以多種方式更改路由器行為,例如:
附註:如果波特率設定為不同於預設速率,則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工具。
附註:只有註冊思科使用者才能存取內部工具與錯誤資訊。
此表包含一些在大多數平台上有效的常用引數。
附註:在將路由器上的配置暫存器更改為下表中的值之一之前,請檢查相應的硬體安裝指南以驗證配置暫存器是否可用。
平台通用引數
配置暫存器集
|
路由器行為
|
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控制檯波特率
|
0 x 3922
|
- 忽略分隔符
- 如果初始引導失敗,則引導至ROM
- 115200控制檯波特率
|
附註:此外,請記住,配置暫存器0x2142用於密碼恢復過程,因為它可以忽略NVRAM的內容。
如果表中沒有配置暫存器的值,則確定設定哪些位以計算值:
位順序值
位數
|
十六進位
|
意義
|
00-03
|
0x0000-0x000F
|
啟動欄位引數:
|
06
|
0040
|
|
07
|
0x0080
|
|
08
|
0x0100
|
|
09
|
0x0200
|
|
10
|
0x0400
|
|
5,11,12
|
0x0020、0x0800、0x1000
|
|
13
|
0x2000
|
|
14
|
0x4000
|
|
15
|
0x8000
|
|
啟動欄位
暫存器的最低4位描述啟動欄位;引導欄位設定確定路由器是否載入作業系統以及路由器獲取系統映像的位置:
啟動欄位(位3、2、1和0)
|
說明
|
0000
(0x0)
|
下次重新啟動或重新載入時,路由器將引導至ROMmon(載入程式)。 要使用ROMmon,必須使用連線到路由器控制檯埠的終端或PC。有關將路由器連線到PC或終端的資訊,請參閱路由器的硬體安裝指南。
在ROMmon模式下,必須使用bootROMmon命令手動引導系統映像或任何其它映像。
|
0001 - 111
(0x01 - 0xF)
|
下次重新啟動或重新載入時,路由器會在全域性配置模式下按順序處理boot system命令,該命令儲存在配置檔案中,直到系統成功引導。如果配置檔案中未儲存boot system命令,或者這些命令的執行不成功,則路由器會嘗試引導快閃記憶體中的第一個映像檔案。
|
控制檯線路速度
第5、11和12位定義主控台線路速度(波特率),並使用以下組合:
第5位元
|
第11位元
|
第12位元
|
控制檯線路速度(鮑率)
|
1
|
1
|
1
|
115200
|
1
|
0
|
1
|
57600
|
1
|
1
|
0
|
38400
|
1
|
0
|
0
|
19200
|
0
|
0
|
0
|
9600
|
0
|
1
|
0
|
4800
|
0
|
1
|
1
|
2400
|
0
|
0
|
1
|
1200
|
配置控制檯波特率設定的正確方法是進入線路控制檯配置模式並修改速度,如下例所示:
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工具。
附註:只有註冊思科使用者才能存取內部工具與錯誤資訊。
排除已知配置暫存器值的故障
如果您知道配置暫存器的值,請檢視「配置暫存器」表來確定行為。如果您可以通過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
您必須重置或重新通電才能使新配置暫存器生效。
相關資訊