
Transcription
Rebooting a RouterThis chapter describes the basic procedure a router follows when it reboots, how to alter the procedure,and how to use the ROM Monitor.For a complete description of the booting commands mentioned in this chapter, refer to the “BootingCommands” chapter in the Cisco IOS Configuration Fundamentals Command Reference. To locatedocumentation of other commands that appear in this chapter, use the command reference master indexor search online.Rebooting a Router Task ListYou can perform the tasks related to rebooting discussed in the following sections: Displaying Booting Information Rebooting Procedures Modifying the Configuration Register Boot Field Setting Environment Variables Scheduling a Reload of the System Image Entering ROM Monitor Mode Manually Loading a System Image from ROM Monitor Configuring High System Availability on the Cisco 7500 SeriesCisco IOS Configuration Fundamentals Configuration GuideFC-207
Rebooting a RouterDisplaying Booting InformationDisplaying Booting InformationUse the following commands in EXEC mode to display information about system software, systemimage files, and configuration files:CommandPurposeshow bootvarLists the contents of the BOOT environment variable, the name of theconfiguration file pointed to by the CONFIG FILE environment variable, and thecontents of the BOOTLDR environment variable.more nvram:startup-configLists the startup configuration information.On all platforms except the Class A Flash file systems, the startup configuration isusually in NVRAM. On Class A Flash file systems, the CONFIG FILEenvironment variable points to the startup configuration, defaulting to NVRAM.Lists the system software release version, system image name, configurationregister setting, and other information.show versionRefer to the Cisco IOS Configuration Fundamentals Command Reference for examples of thesecommands.You can also use the o command (the confreg command for some platforms) in ROM monitor mode tolist the configuration register settings on some models.Rebooting ProceduresThe following sections describe what happens when the router reboots: What Configuration File Does the Router Use upon Startup? What Image Does the Router Use upon Startup?What Configuration File Does the Router Use upon Startup?On all platforms except Class A Flash file system platforms, If the configuration register is set to ignore NVRAM, the router enters setup mode. If the configuration register is not set to ignore NVRAM,– The startup software checks for configuration information in NVRAM.– If NVRAM holds valid configuration commands, the Cisco IOS software executes thecommands automatically at startup.– If the software detects a problem with NVRAM or the configuration it contains (a CRCchecksum error), it enters setup mode and prompts for configuration.Cisco IOS Configuration Fundamentals Configuration GuideFC-208
Rebooting a RouterRebooting ProceduresOn Class A Flash file system platforms, If the configuration register is set to ignore NVRAM, the router enters setup mode. If the configuration register is not set to ignore NVRAM,– The startup software uses the configuration pointed to by the CONFIG FILE environmentvariable.– When the CONFIG FILE environment variable does not exist or is null (such as at first-timestartup), the router uses NVRAM as the default startup device.– When the router uses NVRAM to start up and the system detects a problem with NVRAM orthe configuration it contains, the router enters setup mode.Problems can include a bad checksum for the information in NVRAM or an empty NVRAM with noconfiguration information. See the “Troubleshooting Hardware and Booting Problems” chapterpublication Internetwork Troubleshooting Guide for troubleshooting procedures. See the “Using Setupfor Configuration Changes” chapter in this publication for details on the setup command facility. Formore information on environment variables, refer to the “Setting Environment Variables” section.What Image Does the Router Use upon Startup?When a router is powered on or rebooted, the following events happen: The ROM Monitor initializes. The ROM monitor checks the boot field (the lowest four bits) in the configuration register.– If the last digit of the boot field is 0 (for example, 0x100), the system does not boot an IOSimage and waits for user intervention at the ROM Monitor prompt. From ROM monitor mode,you can manually boot the system using the boot or b command.– If the last digit of the boot field is1 (for example, 0x101), the boot helper image is loaded fromROM. (On some platforms, the boot helper image is specified by the BOOTLDR environmentvariable.)– If the last digit of the boot field is 2 through F (for example, 0x102 through 0x10F), the routerboots the first valid image specified in the configuration file or specified by the BOOTenvironment variable.NoteThe configuration register boot field value is expressed in hexidecimal. Since the boot fieldonly encompasses the last four bits of the configuration register value, the only digit we areconcerned with in this discussion is the last digit. The makes 0x1 (0000 0001) equivalentto 0x101 (1 0000 0001) in discussions of the boot field, as in both cases the last four bitsare 0001.When the boot field is 0x102 through 0x10F, the router goes through each boot system command inorder until it boots a valid image. If bit 13 in the configuration register is set, each command will be triedonce (bit 13 is indicated by the position occupied by b in the following hexidecimal notation: 0xb000).If bit 13 is not set, the boot system commands specifying a network server will be tried up to five moretimes. The timeouts between each consecutive attempt are 2, 4, 16, 256, and 300 seconds.Cisco IOS Configuration Fundamentals Configuration GuideFC-209
Rebooting a RouterRebooting ProceduresIf the router cannot find a valid image, the following events happen:Note If all boot commands in the system configuration file specify booting from a network server and allcommands fail, the system attempts to boot the first valid file in Flash memory. If the “boot-default-ROM-software” option in the configuration register is set, the router will startthe boot image (the image contained in boot ROM or specified by the BOORLDR environmentvariable). If the “boot-default-ROM-software” option in the configuration register is not set, the system waitsfor user intervention at the ROM Monitor prompt. You must boot the router manually. If a fully functional system image is not found, the router will not function and must be reconfiguredthrough a direct console port connection.Refer to your platform documentation for information on the default location of the bootimage.When looking for a bootable file in Flash memory: The system searches for the filename in Flash memory. If a filename is not specified, the softwaresearches through the entire Flash directory for a bootable file instead of picking only the first file. The system attempts to recognize the file in Flash memory. If the file is recognized, the softwaredecides whether it is bootable by performing the following checks:– For run-from-Flash images, the software determines whether it is loaded at the correct executionaddress.– For run-from-RAM images, the software determines whether the system has enough RAM toexecute the image.Figure 11 illustrates the basic booting decision process.Cisco IOS Configuration Fundamentals Configuration GuideFC-210
Rebooting a RouterRebooting ProceduresFigure 11Booting ProcessTheROM monitorinitializesThe system does notboot an image butwaits for commandsat the ROM monitorprompt0What isthe configurationregister bootfield?1The router boots theboot image in bootROM or boot flash2 through FThe router tries thefirst boot systemcommandYesAre thereboot systemcommands in theconfigurationfile?NoIs therea valid imagein the defaultFlash device?YesThe router loadsthe image in theFlash deviceYesThe router isready to useNoWas avalid imageloaded?YesThe router tries toboot from the networkusing the defaultimage nameThe router isready to useNoNoNoDid allof the bootsystem commandsspecifynetbooting?YesThe router tries thenext boot systemcommandThe router bootsthe image inFlash memoryNoThe router boots theboot image in bootROM or boot flashYesYesIs therea valid imagein Flashmemory?NoThe router boots theboot image in bootROM or boot flashS6750Are theremore bootsystemcommands?Wasthe netbootsuccessful?Cisco IOS Configuration Fundamentals Configuration GuideFC-211
Rebooting a RouterModifying the Configuration Register Boot FieldModifying the Configuration Register Boot FieldThe configuration register boot field determines whether the router loads an operating system image, andif so, where it obtains this system image. This section contains the following topics: How the Router Uses the Boot Field Hardware Versus Software Configuration Register Boot Fields Modifying the Software Configuration Register Boot FieldRefer to the documentation for your platform for more information on the configuration register.How the Router Uses the Boot FieldThe lowest four bits of the 16-bit configuration register (bits 3, 2, 1, and 0) form the boot field. Thefollowing boot field values determine if the router loads an operating system and where it obtains thesystem image: When the entire boot field equals 0-0-0-0 (0x0), the router does not load a system image. Instead, itenters ROM monitor or “maintenance” mode from which you can enter ROM monitor commands tomanually load a system image. Refer to the “Manually Loading a System Image from ROMMonitor” section for details on ROM monitor mode. When the entire boot field equals 0-0-0-1 (0x1), the router loads the boot helper or rxboot image. When the entire boot field equals a value between 0-0-1-0 (0x2) and 1-1-1-1 (0xF), the router loadsthe system image specified by boot system commands in the startup configuration file. When thestartup configuration file does not contain boot system commands, the router tries to load a defaultsystem image stored on a network server.When loading a default system image from a network server, the router uses the configurationregister settings to determine the default system image filename for booting from a network server.The router forms the default boot filename by starting with the word cisco and then appending theoctal equivalent of the boot field number in the configuration register, followed by a hyphen (-) andthe processor type name (cisconn-cpu). See the appropriate hardware installation guide for detailson the configuration register and the default filename.Hardware Versus Software Configuration Register Boot FieldsYou modify the boot field from either the hardware configuration register or the software configurationregister, depending on the platform.Most platforms have use a software configuration register. Refer to your hardware documentation forinformation on the configuration register for your platform.The hardware configuration register can be changed only on the processor card with dual in-line package(DIP) switches located at the back of the router. For information on modifying the hardwareconfiguration register, refer to the appropriate hardware installation guide.Cisco IOS Configuration Fundamentals Configuration GuideFC-212
Rebooting a RouterModifying the Configuration Register Boot FieldModifying the Software Configuration Register Boot FieldTo modify the software configuration register boot field, use the following commands:CommandPurposeStep 1show versionObtains the current configuration register setting. The configurationregister is listed as a hexadecimal value.Step 2configure terminalEnters configuration mode, selecting the terminal option.Step 3config-register valueModifies the existing configuration register setting to reflect the way inwhich you want to load a system image. The configuration register valueis in hexadecimal form with a leading “0x.”Step 4endExits configuration mode.Step 5show versionVerifies that the configuration register setting is correct. Repeat steps 2through 5 if the setting is not correct.Step 6reloadReboots the router to make your changes take effect.In ROM monitor mode, use the o command or the confreg command on some platforms to list the valueof the configuration register boot field.Modify the current configuration register setting to reflect the way in which you want to load a systemimage. To do so, change the least significant hexadecimal digit to one of the following: 0 to load the system image manually using the boot command in ROM monitor mode. 1 to load the system image from boot ROMs. On the Cisco 7200 series and Cisco 7500 series, thissetting configures the system to automatically load the system image from bootflash. 2–F to load the system image from boot system commands in the startup configuration file or froma default system image stored on a network server.For example, if the current configuration register setting is 0x101 and you want to load a system imagefrom boot system commands in the startup configuration file, you would change the configurationregister setting to 0x102.Modifying the Software Configuration Register Boot Field ExampleIn the following example, the show version command indicates that the current configuration register isset so that the router does not automatically load an operating system image. Instead, it enters ROMmonitor mode and waits for user-entered ROM monitor commands. The new setting instructs the routerto a load a system image from commands in the startup configuration file or from a default system imagestored on a network server.Router1# show versionCisco Internetwork Operating System SoftwareIOS (tm) 4500 Software (C4500-J-M), Version 11.1(10.4), MAINTENANCE INTERIM SOFTWARECopyright (c) 1986-1997 by cisco Systems, Inc.Compiled Mon 07-Apr-97 19:51 by dschwartImage text-base: 0x600088A0, data-base: 0x60718000ROM: System Bootstrap, Version 5.1(1) [daveu 1], RELEASE SOFTWARE (fc1)FLASH: 4500-XBOOT Bootstrap Software, Version 10.1(1), RELEASE SOFTWARE (fc1)Cisco IOS Configuration Fundamentals Configuration GuideFC-213
Rebooting a RouterSetting Environment VariablesRouter1 uptime is 6 weeks, 5 days, 2 hours, 22 minutesSystem restarted by error - a SegV exception, PC 0x6070F7ACSystem image file is "c4500-j-mz.111-current", booted via flashcisco 4500 (R4K) processor (revision 0x00) with 32768K/4096K bytes of memory.Processor board ID 01242622R4600 processor, Implementation 32, Revision 1.0G.703/E1 software, Version 1.0.Bridging software.SuperLAT software copyright 1990 by Meridian Technology Corp).X.25 software, Version 2.0, NET2, BFE and GOSIP compliant.TN3270 Emulation software (copyright 1994 by TGV Inc).Basic Rate ISDN software, Version 1.0.2 Ethernet/IEEE 802.3 interfaces.2 Token Ring/IEEE 802.5 interfaces.4 ISDN Basic Rate interfaces.128K bytes of non-volatile configuration memory.8192K bytes of processor board System flash (Read/Write)4096K bytes of processor board Boot flash (Read/Write)Configuration register is 0x2100Router1# configure terminalRouter1(config)# config-register 0x210FRouter1(config)# endRouter1# reloadSetting Environment VariablesBecause many platforms can boot images from several locations, these systems use special ROMmonitor environment variables to specify the location and filename of images that the router is to use. Inaddition, Class A Flash file systems can load configuration files from several locations and use anenvironment variable to specify startup configurations.These special environment variables are as follows: BOOT Environment Variable BOOTLDR Environment Variable CONFIG FILE Environment VariableBOOT Environment VariableThe BOOT environment variable specifies a list of bootable system images on various file systems. Referto the “Specify the Startup System Image in the Configuration File” section in the “Loading andMaintaining System Images and Microcode” chapter of the Configuration Fundamentals ConfigurationGuide. After you save the BOOT environment variable to your startup configuration, the router checksthe variable upon startup to determine the device and filename of the image to boot.The router tries to boot the first image in the BOOT environment variable list. If the router isunsuccessful at booting that image, it tries to boot the next image specified in the list. The router trieseach image in the list until it successfully boots. If the router cannot boot any image in the BOOTenvironment variable list, the router attempts to boot the boot image.If an entry in the BOOT environment variable list does not specify a device, the router assumes thedevice is tftp. If an entry in the BOOT environment variable list specifies an invalid device, the routerskips that entry.Cisco IOS Configuration Fundamentals Configuration GuideFC-214
Rebooting a RouterSetting Environment VariablesBOOTLDR Environment VariableThe BOOTLDR environment specifies the Flash file system and filename containing the boot image thatthe ROM monitor uses if it cannot find a valid system image. In addition, a boot image is required toboot the router with an image from a network server.You can change the BOOTLDR environment variable on platforms that use a software boot image ratherthan boot ROMs. On these platforms, the boot image can be changed without having to replace the bootROM.This environment variable allows you to have several boot images. After you save the BOOTLDRenvironment variable to your startup configuration, the router checks the variable upon startup todetermine which boot image to use if the system cannot be loaded.NoteRefer to your platform documentation for information on the default location of the bootimage.CONFIG FILE Environment VariableFor Class A Flash file systems, the CONFIG FILE environment variable specifies the file system andfilename of the configuration file to use for initialization (startup). Valid file systems can includenvram:, bootflash:, slot0:, and slot1:. Refer to the “Location of Configuration Files” section in the“Modifying, Downloading, and Maintaining Configuration Files” chapter for more information ondevices. After you save the CONFIG FILE environment variable to your startup configuration, therouter checks the variable upon startup to determine the location and filename of the configuration fileto use for initialization.The router uses the NVRAM configuration during initialization when the CONFIG FILE environmentvariable does not exist or when it is null (such as at first-time startup). If the router detects a problemwith NVRAM or a checksum error, the router enters setup mode. Refer to the “Using Setup forConfiguration Changes” chapter in this publication for more information on the setup command facility.Controlling Environment VariablesAlthough the ROM monitor controls environment variables, you can create, modify, or view them withcertain commands. To create or modify the BOOT, BOOTLDR, and CONFIG FILE environmentvariables, use the boot system, boot bootldr, and boot config global configuration commands,respectively.Refer to the “Specify the Startup System Image in the Configuration File” section in the “Loading andMaintaining System Images and Microcode” chapter of the Configuration Fundamentals ConfigurationGuide for details on setting the BOOT environment variable. Refer to the “Specify the StartupConfiguration File” section in the “Modifying, Downloading, and Maintaining Configuration Files”chapter of the Configuration Fundamentals Configuration Guide for details on setting theCONFIG FILE variable.Cisco IOS Configuration Fundamentals Configuration GuideFC-215
Rebooting a RouterSetting Environment VariablesNoteWhen you use these three global configuration commands, you affect only the runningconfiguration. You must save the environment variable settings to your startupconfiguration to place the information under ROM monitor control and for the environmentvariables to function as expected. Use the copy system:running-confignvram:startup-config command to save the environment variables from your runningconfiguration to your startup configuration.You can view the contents of the BOOT, BOOTLDR, and the CONFIG FILE environment variables byissuing the show bootvar command. This command displays the settings for these variables as they existin the startup configuration as well as in the running configuration if a running configuration settingdiffers from a startup configuration setting.Use the more nvram:startup-config command to display the contents of the configuration file pointedto by the CONFIG FILE environment variable.Setting the BOOTLDR Environment VariableTo set the BOOTLDR environment variable, use the following commands, beginning in privilegedEXEC mode:CommandPurposeStep 1dir [flash-filesystem:]Verifies that internal Flash or bootflash contains theboot helper image.Step 2configure terminalEnters the configuration mode from the terminal.Step 3boot bootldr file-urlSets the BOOTLDR environment variable to specifythe Flash device and filename of the boot helperimage. This step modifies the runtime BOOTLDRenvironment variable.Step 4endExits configuration mode.Step 5copy system:running-config nvram:startup-configSaves this runtime BOOTLDR environment variableto your startup configuration.Step 6show bootvar(Optional) Verifies the contents of the BOOTLDRenvironment variable.The following example sets the BOOTLDR environment to change the location of the boot helper imagefrom internal Flash to slot 0.Router# dir bootflash:-#- -length- -----date/time------ name1620May 04 1995 26:22:04 rsp-boot-m2620May 24 1995 21:38:14 config27993896 bytes available (1496 bytes used)Router# configure terminalRouter (config)# boot bootldr slot0:rsp-boot-mRouter (config)# endRouter# copy system:running-config nvram:startup-configCisco IOS Configuration Fundamentals Configuration GuideFC-216
Rebooting a RouterScheduling a Reload of the System Image[ok]Router# show bootvarBOOT variable slot0:rsp-boot-mCONFIG FILE variable nvram:Current CONFIG FILE variable slot0:router-configConfiguration register is 0x0Scheduling a Reload of the System ImageYou may want to schedule a reload of the system image to occur on the router at a later time (for example,late at night or during the weekend when the router is used less), or you may want to synchronize a reloadnetwork-wide (for example, to perform a software upgrade on all routers in the network).NoteA scheduled reload must take place within approximately 24 days.Configuring a Scheduled ReloadTo configure the router to reload the Cisco IOS software at a later time, use one of the followingcommands in privileged EXEC command mode:CommandPurposereload in [hh:]mm [text]Schedules a reload of the software to take effect in mm minutes (or hhhours and mm minutes) from now.reload at hh:mm [month day day month][text]Schedules a reload of the software to take place at the specified time (usinga 24-hour clock). If you specify the month and day, the reload is scheduledto take place at the specified time and date. If you do not specify the monthand day, the reload takes place at the specified time on the current day (ifthe specified time is later than the current time), or on the next day (if thespecified time is earlier than the current time). Specifying 00:00 schedulesthe reload for midnight.NoteThe at keyword can only be used if the system clock has been set on the router (eitherthrough NTP, the hardware calendar, or manually). The time is relative to the configuredtime zone on the router. To schedule reloads across several routers to occur simultaneously,the time on each router must be synchronized with NTP.The following example illustrates how to use the reload command to reload the software on the routeron the current day at 7:30 p.m.:Router# reload at 19:30Reload scheduled for 19:30:00 UTC Wed Jun 5 1996 (in 2 hours and 25 minutes)Proceed with reload? [confirm]Cisco IOS Configuration Fundamentals Configuration GuideFC-217
Rebooting a RouterEntering ROM Monitor ModeThe following example illustrates how to use the reload command to reload the software on the routerat a future time:Router# reload at 02:00 jun 20Reload scheduled for 02:00:00 UTC Thu Jun 20 1996 (in 344 hours and 53 minutes)Proceed with reload? [confirm]Display Information about a Scheduled ReloadTo display information about a previously scheduled reload or to determine if a reload has beenscheduled on the router, use the following command in EXEC command mode:CommandPurposeshow reloadDisplay reload information including the time the reload is scheduled to occur, and thereason for the reload if it was specified when the reload was scheduled.Cancel a Scheduled ReloadTo cancel a previously scheduled reload, use the following command in privileged EXEC commandmode:CommandPurposereload cancelCancel a previously scheduled reload of the software.The following example illustrates how to use the reload cancel command to stop a scheduled reload:Router# reload cancelRouter#****** --- SHUTDOWN ABORTED --***Entering ROM Monitor ModeDuring the first 60 seconds of startup, you can force the router to stop booting. The router will enterROM Monitor mode, where you can change the configuration register value or boot the router manually.To stop booting and enter ROM monitor mode, use the following commands in EXEC mode:Step 1CommandPurposereloadEnter ROM monitor mode from privileged EXECmode.Press the Break1 key during the first 60 secondswhile the system is booting.Step 2List the ROM monitor commands.?1.This key will not work on the Cisco 7000 unless it has at least Cisco IOS Release 10 boot ROMs.Cisco IOS Configuration Fundamentals Configuration GuideFC-218
Rebooting a RouterEntering ROM Monitor ModeTimesaverIf you are planning to use ROM monitor mode on a regular basis, or wish users to load usingROM monitor commands, you can configure the system to default to ROMMON. Toautomatically boot your system in ROM monitor mode, reset the configuration register to0x0 by using the config-register 0x0 configuration command. The new configurationregister value, 0x0, takes effect after the router or access server is rebooted with the reloadcommand. If you set the configuration to 0x0, you will have to manually boot the systemfrom the console each time you reload the router or access server.To exit ROMMON mode, use the continue command. If you have changed the configuration, use thecopy running-config startup-config command and then issue the reload command to save yourconfiguration changes.Aliasing ROM Monitoring CommandsThe ROM monitor supports command aliasing modeled on the aliasing function built into the Korn shell.The alias command is used to set and view aliased names. This allows the user to alias command namesto a letter or word. Aliasing is often used to shorten command names or automatically invoke commandoptions.Aliases are stored in NVRAM and remain intact across periods of no power. These are some of the setaliases: b boot h history i intialize/reset r repeat k stack ? helpThe following example shows a pre-aliased menu-type list for ROMMON commands: ? stateToggle cache state (? for help)B [filename] [TFTP Server IP address TFTP Server Name]Load and execute system image from ROM or from TFTP serverC [address] Continue execution [optional address]D /S M L VDeposit value V of size S into location L with modifier ME /S M LExamine location L with size S with modifier MG [address] Begin executionHHelp for commandsIInitializeKStack traceL [filename] [TFTP Server IP address TFTP Server Name]Load system image from ROM or from TFTP server, but do notbegin executionOShow configuration register option settingsPSet the break pointSSingle step next instructionT functionTest device (? for help)Deposit and Examine sizes may be B (byte), L (long) or S (short).Modifiers may be R (register) or S (byte swap).Register names are: D0-D7, A0-A6, SS, US, SR, and PCCisco IOS Configuration Fundamentals Configuration GuideFC-219
Rebooting a RouterManually Loading a System Image from ROM MonitorIf your options appear in the above menu-type format, you can use the listed aliased commands. Toinitialize the router or access server, enter the i command. The i command causes the bootstrap programto reinitialize the hardware, clear the contents of memory, and boot the system. To boot the system imagefile, use the b command.The ROM Monitor software characteristics will vary depending on your platform. For further details onROM monitor mode commands, refer to the appropriate hardware installation guide, or perform a searchon CCO.Manually Loading a System Image from ROM MonitorIf your router does not find a valid system image, or if its configuration file is corrupted at startup, or theconfiguration register is set to enter ROM monitor mode, the system enters ROM monitor mode. Fromthis mode, you can manually load a system image from the following locations: Internal Flash memory or a Flash memory PC card A network server file ROM A local or remote computer, using the Xmodem or Ymodem protocol (Cisco 1600 series andCisco 3600 series only)You may only boot from a location if the router can store an image there. Therefore, not all platformscan manually load from these locations.You can also enter ROM monitor mode by restarting the router and then pressing the Break key orissuing a “send break” command from a telnet session during the first 60 seconds of startup.Manually Booting from Flash Memory in ROMMONTo manually boot from Flash memory, use the following command in ROM Monitor mode:CommandPurposeboot flash [filename]boot flash partition-number:[filename]boot flash flash:[ partition-number:] [filename]boot [flash-fs:][partition-number:][filename](Cisco 1600 series and Cisco 3600 series)boot device:[filename] (Cisco 7000 family)Manually boot the router from Flash. Refer to your hardwaredocumentation for the correct form of th
startup configuration file does not containboot system commands, the router tries to load a default system image stored on a network server. When loading a default system image from a network server, the router uses the configuration register settings to determine the default system