View RSS Feed

صادق نجاتی زاده

حل مشکل Cookie Information corrupt در روتر های سیسکو

Rating: 2 votes, 4.00 average.
توسط - 2011-02-21 - 05:33 PM (بازدید: 4456)
  
­حل مشکل Cookie Information corrupt در روتر های سیسکو
چند وقت پیش محل کار روتری به دستم رسید که مورد عجیبی و تجربه ای برای من به همراه داشت که در جریان گزاشتم دوستان را خالی از لطف نمیدانم.
روتر 828 سیسکو بود که بوت نمیشد IOS آن و پیغامی به صورت زیر را در خروجی کنسول مشاهده میشد.
loadprog: error - Invalid image for platform
e_machine = 62, cpu_type = 0
در ابتدا این نظر به دهنم رسید که شاید IOS اشتباه و یا خراب بر روی آن لود شده است بعد از انتقال دو نمونه IOS متفاوت بر روی آن هنز هم مشکل پابرجا بود ولی در این بین در هنگام انتقال IOS پیغامی میداد که هم برایم جدید بود و هم میتوانست مورد بررسی قرار بگیرد و آن .
Cookie information is corrupt
بعد از جستجو و بررسی هایی که داشتم به مسیر لینک زیر رسیدم که این مورد را به خوبی با دلیل و موارد دیگر شرح داده بود .
BSKB-000001: How to resolve the "Warning: Cookie information is corrupt" error on cisco routers - Bitshift Knowledge Base
مشکل از این قرار بود که یک حافظه از نمونه EEProm در روتر های سیسکو موجود است که اطلاعاتی را در خود ذخیره میکند اطلاعاتی از جمله
نوع و سرعت پردازنده
حجم Nvram
Mac address دستگاه
و ....
که در بعضی اوقات این اطلاعات در این سری و یکی دو سری دیگر از روتر ها از بین میرود و کلیه اطلاعات موجود در این حافظه صفر میشود.
برای دیدن اطلاعات درون این حافظه میتوانید در محیط rommon از دستور cookie استفاده کنید .
در صورت سالم بودن به شکل زیر خواهد بود :
rommon 1 > cookie

cookie:
01 01 00 04 27 fe 00 ea 3e 00 01 ff 01 ff 00 00
00 00 00 00 00 00 00 00 4a 41 42 01 02 41 42 43
44 04 01 00 00 00 00 00 00 ff ff ff 50 04 49 11
ec 03 ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
و در صور خراب بودن اطلاعات تمامی کارکتر های بالا 0 خواهد بود .
برای تغییر این اطلاعات باید به محیط دیگری در rommon بروید که با زدن دستور Priv را بزنید این مورد محیط دستوری را دچار تغییراتی خواهد کرد در صورت عادی و نرمال دستورات موجود در rommon به 25 عدد محدود است به شکل زیر .
rommon 1 > ?
alias set and display aliases command
boot boot up an external process
break set/show/clear the breakpoint
confreg configuration register utility
cont continue executing a downloaded image
context display the context of a loaded image
cookie display contents of cookie PROM in hex
dev list the device table
dir list files in file system
dis display instruction stream
dnld serial download a program module
frame print out a selected stack frame
help monitor builtin command help
history monitor command history
meminfo main memory information
repeat repeat a monitor command
reset system reset
set display the monitor variables
stack produce a stack trace
sync write monitor environment to NVRAM
sysret print out info from last system return
tftpdnld tftp image download
unalias unset an alias
unset unset a monitor variable
xmodem x/ymodem image download
ولی با زدن این دستور که بعد از آن از شما پسوردی پرسیده میشود که به صورت پیش فرض 0000 است تعداد دستورات بیشتر میشود و به بیش از 50 دستور خواهد رسید
rommon 2 > priv
Password:
You now have access to the full set of monitor commands.
Warning: some commands will allow you to destroy your
configuration and/or system images and could render
the machine unbootable.


rommon 3 > ?
addrloop walk 1 thru range of addresses
alias set and display aliases command
alter alter locations in memory
berrscan scan range of addresses for bus errors
boot boot up an external process
break set/show/clear the breakpoint
call call a subroutine at address with converted hex args
cat concatenate files
checksum checksum a block of memory
clrerr clear the error log
compare compare two blocks of memory
confreg configuration register utility
cont continue executing a downloaded image
context display the context of a loaded image
cookie display contents of cookie PROM in hex
cpu cpu / system information and control
dev list the device table
dir list files in file system
dis display instruction stream
dnld serial download a program module
dump display a block of memory
echo monitor echo command
errlog display the error log
fdump file dump utility
fill fill a block of memory
flash flash services command
frame print out a selected stack frame
help monitor builtin command help
history monitor command history
ifill fill a block of memory w/incrementing pattern
initfs re-initialize the file system access structures
jump call a subroutine at address with argc/argv
launch launch a downloaded image
memdebug write/read/verify scope loop
meminfo main memory information
memloop write or read scope loop
memtest simple memory test
menu main diagnostic menu
move move a block of memory
repeat repeat a monitor command
reset system reset
set display the monitor variables
sleep millisecond sleep command
speed timed performance loop
stack produce a stack trace
sync write monitor environment to NVRAM
sysret print out info from last system return
tcal timer calibration test
tftpdnld tftp image download
tscope timer scope loop
unalias unset an alias
unset unset a monitor variable
watchdog test watchdog rebooting of the box
xmodem x/ymodem image download
rommon 4 >


تذکر : در این محیط ماملا با احتیاط از دستورها استفاده نمایید چون ممکن است مانع لود روتر شما بشود .
مقادیری که در cookie قرار دارد 128 بایت اطلاعات به صورت hexadecimal است که در 8 ردیف 16 بایتی قرار دارد که هر ردیف معرف یک خصوصیت است که باید قبل از وارد نمودن آنها را بدانیم و به شکل زیر هستند.

Byte index
Size in bytes
Name
Description
0x00
1
Version
Not 100% clear. Maybe this is the version of the cookie format.
0x01
1
Vendor
The vendor of the device. It is assumed that this value is always 0x01, as the vendor is always Cisco.
0x02
6
Ethernet HW Address
The MAC address (bia) of the first integrated Ethernet interface.
0x08
1
Processor
This is the processor type.
This value is sometimes referred to as "e_machine".
Some routers also display a "Board ID" (such as "Board ID: 13-62") during boot, where the second of the two numbers is identical to "CPU Type", but is notated in decimal instead of hex.
0x09
1
NVRAM Size
Size index of the NVRAM.
This value is NOT the size in KBytes or similar.
0x0a
1
CPU Speed
The speed index of the CPU.
This value is NOT the speed in MHz or similar.
0x0b
1
Unused
-
0x0c
2
On-board PM ID
It is not currently known what this is exactly.
0x0e
2
MAC Address Allocated
It is not currently known what this is exactly.
0x10
8
Unknown
-
0x18
9
Processor board ID
This is the encoded processor board ID, which is printed on a label on the mainboard of the router.
The processor board ID is NOT identical with the serial number of the device.
0x21
2
CPU Revision
This value is sometimes referred to as the "Processor Revision".
0x23
2
Deviation
This value is sometimes referred to as the "Hardware Revision" or just "HW Revision".
0x25
7
Unknown
-
0x2c
1
CPU Type
This is the type of CPU.
This value is sometimes referred to as "cpu_type".
0x2d
1
Board Config
It is not currently known what this is exactly.
0x2e
4
Unknown
-
0x32
6
WAN MAC Address
Not 100% clear. Maybe this is the MAC bia address of the second (WAN-side) Ethernet interface on some models (e.g. 1710 router).
0x38
72
Unused
-





حال با توجه به موارد بالا در صورتی که دستور cookie را بزنید سیستم شروع به دریافت این موارد از شما خواهد کرد که به عنوان نمونه میتوانید به صورت زیر وارد نمایید .
rommon 2 > cookie

View/alter bytes of serial cookie by field --
Input hex byte(s) or: CR -> skip field; ? -> list values
byte 0x00 - Version: 00
> 01

byte 0x01 - Vendor (Recommended Value: 0x01): 00
> 01

bytes 0x02-0x07 - Ethernet HW Address: 00 00 00 00 00 00
> 00 b0 c2 8d c9 6f

byte 0x08-0x08 - Processor (Recommended Value: 0x3e): 00
> 3e

byte 0x09-0x09 - NVRAM Size (Recommended Values: 256K - 0x00): 00
> 00

byte 0x0a-0x0a - CPU Speed (Recommended Value: 50Mhz - 0x01): 00
> 01

byte 0x0b-0x0b - Unused: 00
> ff

bytes 0x0c-0x0d - On-board PM ID: 00 00
> 01 ff

bytes 0x0e-0x0f - MAC Address Allocated: 00 00
> 00 00

bytes 0x10-0x17: 00 00 00 00 00 00 00 00
> 00 00 00 00 00 00 00 00

bytes 0x18-0x22: 00 00 00 00 00 00 00 00 00 00 00
> 4a 41 44 06 15 30 34 48 48 04 01

bytes 0x23-0x24 - Deviation: 00 00
> 00 00

bytes 0x25-0x2c: 00 00 00 00 00 00 00 00
> 00 00 00 00 ff ff ff 50

bytes 0x2d-0x2d - Board Config: 00
> 04

bytes 0x2e-0x31: 00 00 00 00
> 49 11 ec 03

bytes 0x32-0x37 - WAN MAC Address: 00 00 00 00 00 00
> ff ff ff ff ff ff

bytes 0x38-0x3f: 00 00 00 00 00 00 00 00
> ff ff ff ff ff ff ff ff

bytes 0x40-0x47: 00 00 00 00 00 00 00 00
> ff ff ff ff ff ff ff ff

bytes 0x48-0x4f: 00 00 00 00 00 00 00 00
> ff ff ff ff ff ff ff ff

bytes 0x50-0x57: 00 00 00 00 00 00 00 00
> ff ff ff ff ff ff ff ff

bytes 0x58-0x5f: 00 00 00 00 00 00 00 00
> ff ff ff ff ff ff ff ff

bytes 0x60-0x67: 00 00 00 00 00 00 00 00
> ff ff ff ff ff ff ff ff

bytes 0x68-0x6f: 00 00 00 00 00 00 00 00
> ff ff ff ff ff ff ff ff

bytes 0x70-0x77: 00 00 00 00 00 00 00 00
> ff ff ff ff ff ff ff ff

bytes 0x78-0x7f: 00 00 00 00 00 00 00 00
> ff ff ff ff ff ff ff ff
rommon 3 >
حال میتوانید با زدن دستور boot روتر را راه اندازی و یا با دستور reset آن را ریست نمایید .
برای اطلاعات بیشتر در این مورد میتوانید لینکهای زیر را ببینید :
BSKB-000001: How to resolve the "Warning: Cookie information is corrupt" error on cisco routers - Bitshift Knowledge Base
BSKB-000002: How to enter the password protected "priv" rommon mode on cisco routers - Bitshift Knowledge Base
Reza.D، th95، sasani و 3 نفر دیگر سپاسگزاری کرده‌اند.
دسته ها
Cisco

نظر