By Sheldon L | Published at 2020-05-13 | Updated at 2020-05-13 |
All Cisco routers have a 16-bit (2 bytes) software register that’s written into NVRAM. By default, the configuration register is set to load the Cisco IOS from flash memory and to look for and load the startup-config file from NVRAM.
The default configuration setting on Cisco routers is 0x2102
: 0010 0001 0000 0010
Console line speed (0x0600–0x1000)
| | |
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0
| | | | | | | | |
| | | | | | | Boot field (0x0000 - 0x000F)
| | | | | | Ignore NVRAM contents (0x0040)
| | | | | OEM bit enabled (0x0060)
| | | | Break disabled (0x0101)
| | | IP broadcast with all zeros (0x0400)
| | Boot default ROM software if network boot fails (0x2000)
| IP broadcasts do not have net numbers (0x4000)
Enable diagnostic messages and ignore NVRAM contents (0x6000)
00
: ROM monitor mode. Set the configuration register to 2100
. You must manually boot the router with the b
command.01
: Boot image from ROM. To boot the mini-IOS image stored in ROM, set the configuration register to 2101
.02-F
: Specifies a default boot filename. Any value from 2102
through 210F
tells the router to use the boot commands specified in NVRAM.! Checking the Current Configuration Register Value
Router> sh version
! To change the confi guration register
Router(config)# config-register 0x2142
Router(config)# do sh ver
! Boot System
Router(config)# boot ?
bootstrap Bootstrap image file
config Configuration file
host Router-specific config file
network Network-wide config file
system System image file
! All boot options
Router(config)# boot system ?
WORD TFTP filename or URL
flash Boot from flash memory
ftp Boot from a server via ftp
mop Boot from a Decnet MOP server
rcp Boot from a server via rcp
rom Boot from rom
tftp Boot from a tftp server
! Boot from flash
Router(config)# boot system flash c2600nm-advsecurityk9-mz.151-4.M6.bin
! Boot from tftp
Router(config)# boot system tftp ?
WORD System image filename
Router(config)# boot system tftp c2600nm-advsecurityk9-mz.151-4.M6.bin ?
Hostname or A.B.C.D Address from which to download the file
Router(config)# boot system tftp c2600nm-advsecurityk9-mz.151-4.M6.bin 1.1.1.2
! As your last recommended fallback option, boot from rom
Router(config)# boot system rom
! Try to boot from the TFTP server if flash fails.
! The mini-IOS will load after six attempts of trying to locate the TFTP server.
Router(config)# do show run | include boot system
boot system flash c2600nm-advsecurityk9-mz.151-4.M6.bin
boot system tftp c2600nm-advsecurityk9-mz.151-4.M6.bin 1.1.1.2
boot system rom
Ctrl + B
), which will take the router into ROM monitor mode. This can only be done locally from the serial port.bit 6
(confreg 0x2142
).enable
.
I
(for initialize) or reset
.I
.no
for not entering setup mode, then enable
privileged mode.copy startup-config running-config
enable secret [secret]
config-register 0x2102
.copy running-config startup-config
.copy flash tftp
command must be supplied the IP address of the workstation.show flash
and show version
). If there’s not enough room for both the old and new images you want to load, the old image will be erased!Router# ping 1.1.1.2
Router# copy flash tftp
Source filename []?c2600nm-advsecurityk9-mz.151-4.M6.bin
Address or name of remote host []?1.1.1.2
Destination filename [c2600nm-advsecurityk9-mz.151-4.M6.bin]?[enter]
! It’s a good idea to use something other than TFTP
! because it’s unreliable and can only transfer smaller files
Corp#copy ?
/erase Erase destination file system.
/error Allow to copy error file.
/noverify Don't verify image signature before reload.
/verify Verify image signature before reload.
archive: Copy from archive: file system
cns: Copy from cns: file system
flash: Copy from flash: file system
ftp: Copy from ftp: file system
http: Copy from http: file system
https: Copy from https: file system
null: Copy from null: file system
nvram: Copy from nvram: file system
rcp: Copy from rcp: file system
running-config Copy from current system configuration
scp: Copy from scp: file system
startup-config Copy from startup configuration
system: Copy from system: file system
tar: Copy from tar: file system
tftp: Copy from tftp: file system
tmpsys: Copy from tmpsys: file system
xmodem: Copy from xmodem: file system
ymodem: Copy from ymodem: file system
Router#copy tftp flash
Address or name of remote host []?1.1.1.2
Source filename []?c2600nm-advsecurityk9-mz.151-4.M6.bin
Destination filename [c2600nm-advsecurityk9-mz.151-4.M6.bin]?[enter]
A Cisco router can become a TFTP server host for a router system image that’s run in flash memory. The global configuration command is tftp-server flash:ios-file
.
WARN: If have just corrupted file by overwriting it, it won’t know for sure until reboot. Definitely be careful with this command! If the file is corrupted, you’ll need to do an IOS-restore from ROM monitor mode
.
rommon 1 > tftpdnld
Missing or illegal ip address for variable IP_ADDRESS
Illegal IP address.
usage: tftpdnld [-hr]
Use this command for disaster recovery only to recover an image via TFTP.
Monitor variables are used to set up parameters for the transfer.
(Syntax: "VARIABLE_NAME=value" and use "set" to show current variables.)
"ctrl-c" or "break" stops the transfer before flash erase begins.
The following variables are REQUIRED to be set for tftpdnld:
IP_ADDRESS: The IP address for this unit
IP_SUBNET_MASK: The subnet mask for this unit
DEFAULT_GATEWAY: The default gateway for this unit
TFTP_SERVER: The IP address of the server to fetch from
TFTP_FILE: The filename to fetch
The following variables are OPTIONAL:
[unneeded output cut]
rommon 2 >set IP_Address:1.1.1.1
rommon 3 >set IP_SUBNET_MASK:255.0.0.0
rommon 4 >set DEFAULT_GATEWAY:1.1.1.2
rommon 5 >set TFTP_SERVER:1.1.1.2
rommon 6 >set TFTP_FILE: flash:c2600nm-advipservicesk9-mz.124-12.bin
rommon 7 >tftpdnld
Xmodem protocol
to actually upload an IOS file into flash memory through the console port. You’d use the Xmodem through the console port procedure if you had no network connectivity to the router or switch.copy source-url destination-url
command.dir
dir usbflash0:
copy [sorce] [dest]
more [file]
show [file|dir]
show flash
show file info [file]
delete [file]
erase
format
cd [dir]
pwd
mkdir [dir]
rmdir [dir]
system:running-config
as well as nvram:startup-config
when copying the configurations on a routerR1# pwd
flash:
R1# dir
Directory of flash:/
1 -rw- 13938482 Dec 20 2006 19:56:16 +00:00 c1641-ipbase-
mz.124-1c.bin
2 -rw- 1621 Dec 20 2006 20:11:24 +00:00 sdmconfig-16xx.cfg
3 -rw- 4834464 Dec 20 2006 20:12:00 +00:00 sdm.tar
4 -rw- 633024 Dec 20 2006 20:12:24 +00:00 es.tar
[Unimportant...]
R1# show file info flash:c1641-ipbase-mz.124-1c.bin
flash:c1641-ipbase-mz.124-1c.bin:
type is image (elf) []
file size is 13938482 bytes, run size is 14103140 bytes
Runnable image, entry point 0x6000F000, run from ram
! With a file that size, we’ll use the delete command
R1# delete flash:c1641-ipbase-mz.124-1c.bin
Delete filename [c1641-ipbase-mz.124-1c.bin]?[enter]
Delete flash:c1641-ipbase-mz.124-1c.bin? [confirm][enter]
R1# sh flash
[Unimportant...]
R1# sh file info flash:c1641-ipbase-mz.124-1c.bin
%Error opening flash:c1641-ipbase-mz.124-1c.bin (File not found)
! We’ll add the new file with the copy
R1# copy tftp://1.1.1.2/c1641-advipservicesk9-mz.124-12.bin/ flash:/c1641-advipservicesk9-mz.124-12.bin
R1# sh flash
R1# sh file information flash:c1641-advipservicesk9-mz.124-12.bin
flash:c1641-advipservicesk9-mz.124-12.bin:
type is image (elf) []
file size is 22103052 bytes, run size is 22266836 bytes
Runnable image, entry point 0x6000F000, run from ram
! Remember that the IOS is expanded into RAM when the router boots
! so the new IOS will not run until you reload the router
usbflash0:
, so to view the contents, you’d type dir usbflash0:
, for example. You can pull these flash cards out, put them in an appropriate slot in your PC, and the card will show up as a drive.Actually, there was no licensing before the new 15.0 IOS code, just your word and honor, and we can only guess based on how all products are downloaded on the Internet daily how well that has worked out for Cisco!
Router# sh license udi
Device# PID SN UDI
-----------------------------------------------------------------------
*0 CISCO2901/K9 FTX1641Y08J CISCO2901/K9:FTX1641Y08J
After the time has expired for your 60-day evaluation period, you can either obtain the license file from the Cisco License Manager (CLM), which is an automated process, or use the manual process through the Cisco Product License Registration portal. Typically only larger companies will use the CLM because you’d need to install software on a server, which then keeps track of all your licenses for you. If you have just a few licenses that you use, you can opt for the manual web browser process found on the Cisco Product License Registration portal and then just add in a few CLI commands.
When you purchase the software package with the features that you want to install, you need to permanently activate the software package using your UDI and the product authorization key (PAK) that you received with your purchase. This is essentially your receipt acknowledging that you purchased the license. You then need to connect the license with a particular router by combining the PAK and the UDI, which you do online at the Cisco Product License Registration portal
You now need to activate the license on the router.
Router# license install ?
Router# license install flash:FTX1626636P_201302111432454160.lic
Router# reload
Router(config)#license boot module c2900 technology-package securityk9
Router# reload
Router# show license
Router# sh license feature
Router# show version
! Save your current license to flash
Router# license save flash:Todd_License.lic
! Restore
Router# license install
! Uninstall licence
Router#license boot module c2900 technology-package securityk9 disable
! Clear licence
Router# license clear securityk9
Router# config t
Router(config)# no license boot module c2900 technology-package securityk9 disable
Router(config)# exit
Router# reload