810 likes | 1.31k Vues
Routers and Routing Basics CCNA 2 . Chapter 5. Introduction. The first half of this chapter reviews the boot process The second half examines several topics relating to how to copy files to and from the router. Managing Cisco IOS Software. Router Boot Sequence and Loading Cisco IOS Images
E N D
Routers and Routing Basics CCNA 2 Chapter 5
Introduction • The first half of this chapter reviews the boot process • The second half examines several topics relating to how to copy files to and from the router
Managing Cisco IOS Software • Router Boot Sequence and Loading Cisco IOS Images • Choosing the Cisco IOS Image During the Router Boot Sequence • Troubleshooting and Verifying the Choice of Cisco IOS • Managing Cisco Router IOS and Configuration Files • Cisco IOS File System • Cisco IOS Filenames • Copying and Managing Cisco IOS Images • Copying and Managing Cisco IOS Configuration Files • Recovering from Lost Passwords • Summary
Introduction • Routers perform several functions at initialization, including picking which Cisco IOS image to load into RAM and use. • The final initialization step relates to how the router finds and picks a configuration file to use, typically the startup-configuration is file stored in NVRAM. • To do both steps, the router must find, copy, move, and manipulate files that hold IOS images and files that contain configuration • commands. • This chapter closely examines the options and processes that routers use to manage these types of files.
Router Boot Sequence and Loading Cisco IOS Images • When an engineer first powers on or reboots a router, the router goes through • a four-step process: • 1. Perform a power-on self test (POST). • - The POST process happens automatically, performing basic hardware tests. • 2. Load a bootstrap program. • - The bootstrap program completes the hardware testing and initializes software in the router. • 3. Load an IOS. • - The router loads an IOS image, enabling the router to route IP packets. • 4. Load a startup configuration file. • - The router loads an initial configuration file, which tells IOS the parameters it needs to know – things like IP addresses and routing protocols to use – so that the router can successfully route packets. • - The last three steps require the router to copy the files into RAM,
Moving the Bootstrap, IOS, and Configuration Files into RAM In most networks • all the routers simply load the startup-config file in NVRAM into RAM as the Running-config file during the initialization process. • in other networks, each router may have different settings that affect how each router picks which IOS file to load.
Configuration Register • The configuration register is a 16-bit register that Cisco • routers store in a hidden area of NVRAM that is not part of the startup-config file. • The configuration register’s value tells the router facts about several operating parameters including • Which IOS to load: the full image, ROMMON or RXBoot. • The speed of the router console port. • Whether or not to use the configuration file
Changing and Viewing the Configuration Register’s Value • The configuration register can be viewed using the show version command. • The configuration register can be set in two of ways, • The most commonly used way to set its value is to use the config-register global configuration command. • It can also be set from Rommon Mode • When you set the configuration register’s value, the value is used only after the router is reloaded.
Changing and Viewing the Configuration Register’s Value (Continued) Example shows the (default) value of the configuration register, the user changing the value, and the show • version command stating that the new value will not be • used until the next reload.
Changing and Viewing the Configuration Register’s Value (Continued) • The current value at the end of the example shows the • Current setting (hex 2102) and the setting that will be used • at the next reload of the router (hex 2101).
Choosing the Cisco IOS Image During the Router Boot Sequence • Routers use the following logic to attempt to load an IOS: • 1. Load a limited-function IOS based on whether the configuration register’s last hex digit is set to 0 or 1. • - Engineers can use Step 1 when performing certain maintenance; the OSs loaded at this step cannot route packets, but they can be used for some useful functions, such as password recovery. • 2. Load an IOS based on the configuration of boot system commands in the startup-config file.
Choosing the Cisco IOS Image During the Router Boot Sequence (Continued) • 3. Load the first file in flash memory as the IOS. • - Routers almost always pick their IOS based on either Step 2 or Step 3. • Step 2 and 3 give engineers plenty of choices of how they can make the router load the correct IOS for normal operation of the router • 4. Use TFTP broadcasts to find a TFTP server, and download an IOS from that server. • 5. Load a limited-function IOS from ROM. • - Steps 4 and 5 exist mainly as fail-safe mechanisms when the first three steps do not work.
The Boot Field • Routers use the 4 low-order bits of the configuration register as the boot field. • The boot field tells the router what to do in its first of the five decision steps (Slides 11, 12). • Depending on the value of the boot field and the model of the router, a router can choose to load ROMMON, load RXBoot, or move on to a later step in the five-step list for choosing an IOS to load.
Comparing ROMMON and RXBoot OSs • Only older routers, such as the Cisco 1600 and 2500 series routers, have an RXBoot IOS in ROM. Later, Cisco added all the features of the RXBoot IOS to ROMMON, so newer routers do not need (and do not have) an RXBoot IOS.
How Routers Use the Boot Field to Choose an IOS • If the router loads either ROMMON or RXBoot software, the process is complete, waiting for the network engineer to do whatever low-level maintenance function needs to be done. • However, depending on the configuration register settings, the router may simply move on to Step 2 or even Step 3 of the process of finding an IOS to load. • The most production routers default to use a boot field of 2, because the configuration register defaults to 0x2102, which tells the router to load the IOS
How Routers Use the Boot Field to Choose an IOS(Continued) • Software Configuration Bit Meanings • Bit No.Hex Meaning • 00-03 0x0000-0x000F Boot Field (see Table B-2) • 06 0x0040 Ignore NVM contents • 07 0x0080 OEM bit enabled • 08 0x0100 Break disabled • 10 0x0400 IP broadcast with all zeros • 11-12 0x0800-0x1000 Console line speed • 13 0x2000 Boot default ROM software if network boot fails • 0x4000 IP broadcasts do not have net numbers • 0x8000 Enable diagnostic messages and ignore NVRAM • contents
How Routers Use the Boot Field to Choose an IOS(Continued) • Explanation of Boot Field (Configuration Register Bits 00-03) • Boot Field Meaning • 00 Stays at the system bootstrap prompt • 01 Boots system image on EPROM • 02-F Specifies a default netboot filename • Enables boot system commands that override default • netboot filename1
Choosing the Cisco IOS Based on boot system Commands • The router looks in the startup-config file for any boot system commands and loads the IOS file listed in the commands. • The boot system command may fail for one of several reasons: • - mistype of a long filename • - IOS file erased from flash memory by mistake • - the file may be corrupted • - hardware error trying to access flash memory.
Choosing the Cisco IOS Based on boot system Commands(Continued) • Cisco routers provide a couple of ways to prepare for cases • in which the router fails when trying to load the IOS listed in • a boot system command: • 1. Configure multiple boot system commands, and the router will try each of them sequentially until one of them • works. • 2. After the router has tried all the boot system commands, it moves on to Step 3, in which the router attempts to load the first file it finds in flash memory, no matter what its name is.
Configuring Multiple boot system Commands Example 5-2 shows a typical case of how to use multiple boot system commands in a single configuration. • The configuration shows the following four boot system commands, with the three extra commands giving the engineer extra protection against potential problems.
Configuring Multiple boot system Commands(Continued) • 1. The first boot system command simply references the specific IOS image in flash memory. • 2. To be ready for the possibility that the file may be accidentally erased, the boot system tftp command points to a TFTP server at IP address 10.1.1.1, but with the same filename. In that case, the router attempts to contact the listed TFTP server, transfer a copy of the same IOS file, and load that into RAM. • 3. The boot system flash: command next tells the router to look in flash memory, find the first file in flash (more on what “first file” means in the next section), and load that file as the IOS. • 4. If all these commands fail, the router attempts to use the last boot system command, boot system rom, which tells the router to load ROMMON. This last step would then allow to begin the process of recovering and copying the erased IOS file back into flash.
Configuring Multiple boot system Commands(Continued) • If you add or change boot system commands the copy running-config startup-config command in the example is needed so that the boot system commands will not be lost when the router is rebooted. • If the router loads the IOS from the TFTP server based on the second boot system tftp command, the IOS is copied from the server, into RAM, and used; the file is not stored in flash. • If you later add another boot system command, it is added to the end of the list of boot system commands. If you want to add a new command to the middle of the list instead of the end of the list, you must delete some of the commands by using the no boot system • command, add the new boot system command, and then add the previously deleted commands back into the configuration.
Loading the First File in Flash Memory • When a router fails to find and successfully load an IOS at Step 1 or 2, • it then tries one last time to find an IOS in flash memory. • The router looks in flash, finds the first file in flash, and attempts to use that file as the IOS. • Example shows the output of a show flash command on router R1 with the first file in flash (number 1 on the left).
Broadcasting to Find a Cisco IOS on a TFTP Server • Most routers have been configured so that they choose their IOS images at Step 2 or Step 3. • Step 4 provides the router with one final effort to find and load an IOS. • At this step, the router broadcasts on all interfaces to which a cable has been attached, looking for a TFTP server. • If found, the router asks the TFTP server to send the router a specific • file, with the file using a standard name based in part on the router’s • hostname, and in part on the configuration register value.
Broadcasting to Find a Cisco IOS on a TFTP Server • Step 4 (TFTP) provides the router with one final effort to find and load an IOS. • At this step, the router broadcasts on all interfaces to which a cable has been attached, looking for a TFTP server. • If found, the router asks the TFTP server to send the router a specific • file, with the file using a standard name based in part on the router’s • hostname, and in part on the configuration register value.
Loading a Limited-Function OS from ROM • If the router has given up trying to load a fully functional • IOS, it goes ahead and loads one of the limited-function • OSs, as follows: • If the router has an RXBoot OS (only on older routers), the router loads the RXBoot image. • If the router does not have an RXBoot OS, the router loads ROMMON. • In both cases, the OS loaded by the router can copy an IOS from a • TFTP server or copy an IOS image from a PC attached to the console.
Troubleshooting and Verifying the Choice of Cisco IOS • Routers fail to load an IOS, or load the wrong IOS, for a variety of reasons: • - the configregister and boot system commands may have been configured to incorrect values • - if the boot system commands are configured correctly, the files may simply be missing from flash memory, or the file may not be on the TFTP server. • When referencing a TFTP server, other problems could occur: • - the router may not have a working IP route to reach the TFTP server • - the TFTP server software may not be running at the time • - the router has hardware problems that prevent flash memory from • working.
Determining Wrong IOS • When the router has a possibly wrong IOS loaded, first look at the two • configurable items that impact the five-step IOS decision process: the • configuration register and the boot system commands. • See the configuration register only by looking at the output of the show • version command; the show running-config and show startup-config • commands do not list the value of the configuration register. • After examining the configuration register, examine the boot system • commands in the startup-config file by using the show startup-config • command. • It is important to look at the startup-config file, because the boot system • commands will not be used until the router reboots, and the running-config • file will be lost when the router reboots.
Determining Which Steps Failed • After you determine which specific IOS images the router • will attempt to load, verify that the files are there and • accessible. • Consider the following examples: • For any boot system flash:filename commands, you should verify that the file with that name is in flash, with the same spelling and capitalization. The names are case-sensitive. • For boot system tftp filename ip-address commands, you should verify that the correctly spelled filename is on the TFTP server, that TFTP server software is installed and running on that computer, and that the router can ping the server’s IP address.
Determining Which Steps Failed(Continued) • For a boot system flash command, with no filename listed, make sure the lowest numbered file in flash is the IOS file that you want to load. • In some rare cases, the router hardware may have a problem and be • unable to read the contents of flash memory. In these cases, it may be • best to simply call the Cisco Technical Assistance Center (TAC) and • get advice on how to attack the problem.
Cisco IOS File System • IOS has a file system, named the Cisco IOS File System (IFS). • Three general types of files defined and stored by IOS using the IFS:
Variations of Configuration Commands Styles • The file system created by Cisco IOS has gone through three major • design steps over the years. • As a result, today’s most current IOS releases support three variations • of commands that reference the configuration files: • The pre-Version-10.3 style • The new style as of Version 10.3 (which is the most commonly used style) • The style of commands that use the full IFS names for the configuration files.
Recently Added Stylesof Configuration File Commands • The last column of Table lists prefixes added to IOS as part of the IFS. • These prefixes have • the same sort of meaning as a drive letter with a PC’s OS. For example, a PC’s hard disk drive may be drive letter C:. • With IFS, nvram: of course refers to NVRAM, and system: refers to system files held in RAM, including the running-config file.
Cisco IFS File System Prefixes • Table lists the prefixes defined by IFS, along with • a brief description.
Cisco IOS Filenames • Cisco supports a very large set of customer requirements. As a result, • Cisco offers a large number of different IOS files to its customers. • IOS files differs from each other with the four main points: 1. The differences in Cisco IOS versionsand releases. • To support the various versions and releases, Cisco must create different files for each IOS version number and, inside that version, for each maintenance release. 2. The differences between router model series/Cisco IOS platforms. • 3. The differences in Cisco IOS feature sets. • 4. Other minor differences, including whether the IOS is compressed or relocatable.
Common IOS Feature Sets • IP Base—Provides basic IP routing functions, including all the features covered in this book. • IP Voice—Supports the same features as IP Base, plus support for voice sent inside IP packets (voice over IP, or VoIP). • IP/FW 3DES—Includes the features of IP Base, plus a firewall feature and Triple Digital Encryption Standard (3DES) encryption. This feature set provides many security features. • IP/ADSL/IPX/AT/IBM Plus—Includes IP, IPX, and AppleTalk (AT) routing, support for many proprietary protocols from IBM, and support for asymmetric DSL (ADSL), which is the type of DSL most typically found installed in the United States today. • Enterprise Services—Includes most every feature used in the largest enterprises.
Multiple File Formatsof IOS Files • The file format differs mainly on two features: • - Whether the file is compressed • Compressed IOS files require less space in flash memory, but they require more time when the router reboots, because the router has to uncompress the file before loading it. • - Whether the file is relocatable • With a relocatable IOS file, the router does not have to copy the whole IOS into RAM, instead leaving most of it in flash memory, which saves some space in RAM. IOS files that cannot be relocated must be fully copied into RAM when the IOS is loaded.
Cisco IOS Filenames(Continued) • Cisco names the IOS files so that all four different items • are implied by the name.
Copying IOS Files Using copy Command • The IOS copy command provides a way to copy files to • and from flash memory in the router and a server in the • network. It supports three main protocols: • 1. Trivial File Transfer Protocol (TFTP) • 2. Remote Copy (RCP) • 3. File Transfer Protocol (FTP) • TFTP tends to be the most commonly used option, and it • has been supported in IOS longer than RCP and FTP.
Copying from TFTP Server into Flash Memory • 1. The user enters the copy tftp flash command. • 2. The router asks for the hostname or IP address of the TFTP server and waits for a response. • 3. The user enters 192.168.119.20 and presses Enter. • 4. The router asks for the name of the source file to be taken from the TFTP server and waits for a response. • 5. The user enters C2600-js-l_121-3.bin, presses Enter. • 6. The router asks for the name it should use when storing the file in flash memory, which defaults to the same name as the source file, as shown in brackets. The router then waits for a response.
Copying from TFTP Server into Flash Memory (Continued) • 9. The user presses Enter, taking the default action of erasing all the flash files. • 10. The router asks if the user is sure about erasing flash memory, again asking the user to confirm. • 11. The user presses Enter, taking the default action of erasing flash memory. • 12. The router erases flash memory and then copies the file. Progress on the erasure of flash memory is shown by the router’s displaying another e every few seconds, and progress on the copy is shown by displaying another ! every few seconds. 7. The user presses Enter to accept the default of using the same filename. 8. The router displays several lines and then asks if the user wants to erase flash memory before copying the file. The router then waits for a response.
Copying Using the ROMMON tftpdnld Command • The ROMMON tftpdnld command can work only if the following conditions are met: • The IP network is working well enough that the broken router can send IP packets to and from a TFTP server. • The TFTP server has the appropriate IOS file available for download.
Copying Using the ROMMON tftpdnld Command (Example) (continued)
Copying Using ROMMON and Xmodem • The Xmodem protocol defines a method to transfer files over an asynchronous serial line. • Xmodem was first created to support transferring files over dialed links that used modems. • Because the word “transfer” was frequently abbreviated as “xfer,” Xmodem seemed like a good short name for a protocol for transferring files using modems and dialed serial links.
Copying Using ROMMON and Xmodem (Continued) • To transfer an IOS file into a router using the Xmodem • protocol, you need three basic components: • 1. A router running ROMMON software so that the ROMMON xmodem command can be used. • 2. A PC with the IOS file and a terminal emulator that supports Xmodem—for example, HyperTerminal. • 3. A connection between a PC and the router that connects to the router’s console or the aux ports.
Copying Using ROMMON and Xmodem (Continued) • Using Xmodem to copy a new IOS into a router’s flash memory should be your last resort when trying to get an IOS to load into a Cisco router. • The first option is to use the IOS copy command to copy the correct IOS into flash, assuming you can get some copy of IOS up and working. • If the router cannot load an IOS directly, using ROMMON and the tftpdnld command is the next best option, but this option requires a working IP network and working TFTP server. • The Xmodem option works when no IOS will load in the router and when there is no IP connectivity between the router and a TFTP server.
Components Required for Xmodem Transfer over the Console • Transferring an IOS using Xmodem, with the default console speed, Is a very slow process. • To speed up the process, you can change the speed of the console port up to its maximum speed of 115.2 kbps.
Setting the Configuration Register from ROMMON • To change the speed, you must change the value of the configuration register; to change the register from ROMMON, you need to use the ROMMON confreg command. • The confreg command prompts the user with a series of questions. • The answers to the questions tell ROMMON to what value the confi-guration register should be changed. • As it turns out, the console speed can be changed by changing some of the bits in the configuration register.