Routers and Routing Basics CCNA 2 Chapter 2 www.ciscopress.com 1 Introduction to Routers Operating the Cisco IOS CLI The Cisco IOS CLI Router EXEC Modes Router Configuration Modes Cisco IOS Fundamentals Starting, Configuring, Accessing, and Using a Router Initial Booting of a Router Creating an Initial Configuration Using Setup Mode Accessing a Router Using a Router CLI Summary www.ciscopress.com 2 Operating the Cisco IOS CLI • Cisco puts all the important software features of a router into one large OS, called Cisco IOS. • The IOS provides all the core features of a router, including the following: – Controlling the sending and receiving of packets in the router’s physical interfaces – Storing packets in RAM until the outgoing interface is available to forward the packet – Routing (forwarding) packets – Dynamically learning routes using routing protocols www.ciscopress.com 3 The Cisco IOS CLI • The router’s user interface is called the command-line interface (CLI). • The CLI is not graphical - instead, it is a text-based user interface. • The CLI is powerful because it unlocks thousands of router commands and options, allowing the Administrator to make choices not available on the GUI. • The IOS CLI can be accessed using a terminal emulator. www.ciscopress.com 4 Three Methods to Access a Router CLI ■ Router console port—Uses cables between the PC and the router console port ■ Router auxiliary (aux) port—Uses modems and a telephone circuit between the PC and the router aux port ■ Telnet—Uses the IP network between the PC and the router www.ciscopress.com 5 Terminal Emulator (HyperTerminal) Accessing a Router www.ciscopress.com 6 Router EXEC Modes • The IOS CLI has many different areas or parts, called modes. • The term EXEC mode comes from command executive. • To provide a basic level of security, IOS creates two different levels of EXEC mode by default: user EXEC mode and privileged EXEC mode. www.ciscopress.com 7 Comparing User and Privileged EXEC Modes www.ciscopress.com 8 Navigating to and from User and Privileged (Enable) Modes in a Router www.ciscopress.com 9 Minimum Requirements for Configuring Two Routers The routers simply need to be configured with the correct IP addresses and masks, along with a routing protocol. www.ciscopress.com 10 Configuration Process and Configuration Modes 1. The configure terminal EXEC command moves the user from privileged EXEC mode into global configuration mode. 2. The interface command moves the CLI from global configuration mode into interface configuration mode. 3. The router rip command moves the CLI into a routing protocol configuration mode, as signified by a prompt ending in (config-router)#. www.ciscopress.com 11 Cisco IOS Features ■ Cisco manufactures many different models of router hardware, with each model being a member of a router platform, series, or family. ■ Some IOS images have fewer features and some have more features, to provide flexible pricing. ■ Cisco updates the software over time with new features and bug fixes. Cisco creates new IOS images for each new version of IOS software. ■ Some IOS images are compressed to save storage space, and some are not. www.ciscopress.com 12 Cisco IOS Filename Example www.ciscopress.com 13 Storing Cisco IOS in Flash Memory and RAM Before installing a new IOS into a router, you need to check to see if the flash memory in the router has enough space to hold the new IOS (R1 has 8192 KB of flash memory). Output from the show flash Command www.ciscopress.com 14 Finding the Amount of Router RAM Using the show version Command www.ciscopress.com 15 Two Alternative OSs • Two OSs, or operating environments, are called – ROM Monitor (ROMMON) and – boot ROM • The main uses of ROMMON mode are as follows: – To provide a low-level debugging tool that is available even when flash memory has been erased or corrupted – To provide a means of putting a normal IOS file into flash memory in case flash memory is erased or becomes corrupted – To provide a means to recover or reset router passwords www.ciscopress.com 16 Two Alternative OSs (Continued) The other alternative OS is called the boot ROM IOS, or sometimes RX-boot mode – Boot ROM software resides in the ROM chips – Unlike ROMMON, the boot ROM software is an IOS image, although a very basic one – The purpose of this basic IOS is to allow an engineer to load new IOS images into flash memory when the image cannot be loaded due to other issues www.ciscopress.com 17 Key Features and Facts About Alternative OSs www.ciscopress.com 18 Initial Booting of a Router • The process of doing the overhead work to make the computer ready to use is called booting, or the boot process, or rebooting the computer. • When booting, the router generates messages about the boot process and sends them out the console port. • Router output during the boot process – – – – – The version of IOS being loaded The number of interfaces The types of interfaces The amount of NVRAM The amount of flash memory www.ciscopress.com 19 Initial Booting of a Router (Continued) • Besides the information in the boot messages sent to the console, the router also gives some indication about the boot process through the LEDs on the back of the router. • When interfaces are sending a lot of traffic, the LEDs might even appear to be on all the time www.ciscopress.com 20 Initial Booting of a Router (Continued) Router takes four steps when booting: – performs a power-on self test (POST) – loads a bootstrap program – loads an IOS image into RAM and switches from using the bootstrap software to using the IOS software – loads an initial configuration into RAM, called the startup configuration www.ciscopress.com 21 Loading the Bootstrap Program from ROM www.ciscopress.com 22 Finding the Version of the Bootstrap Program www.ciscopress.com 23 Alternative Sources for IOS Image The bootstrap program has three main alternatives from which to get the IOS image: A. Flash memory B. An external TFTP server C. ROM www.ciscopress.com 24 Configuration Register • Cisco provides two tools with which to tell the router which IOS image to load. • The first tool is called the configuration register, or simply config register. • The config register is a 16-bit value stored in the router, typically listed as a four-digit hexadecimal number, like 0x2102. www.ciscopress.com 25 Configuration Register (Continued) The last hex digit of the config register is called the boot field, and the boot field tells the bootstrap program what software to load, as follows: ■ Boot field of hex 0—Load ROMMON ■ Boot field of hex 1—Load boot ROM IOS ■ Boot field of hex 2 through F—Load an IOS from another location, typically from flash memory If a router initializes when the boot field is 0 or 1, the router knows exactly what to do. www.ciscopress.com 26 boot system Command If the boot field is any other value, the router must use another tool, called the boot system configuration command: 1. Attempt to load the IOS image listed in the first boot system command found in the router’s configuration file. 2. If the attempt to load that IOS image fails, attempt to load the IOS image listed in the next boot system command found in the configuration file. 3. If an IOS image has not been successfully loaded after all boot system commands have been tried, or if no boot system commands exist, load the first IOS image found in flash memory. www.ciscopress.com 27 Loading the Startup Configuration into RAM Configuration loaded into RAM is called the running-config file because it is the configuration actually used by the IOS that is executing, or running, at the current time. www.ciscopress.com 28 Startup-config File Locations • The router can choose to ignore the startup-config file in NVRAM, and starts with no configuration (password recovery). • The router can be configured to load an initial configuration from a TFTP server, based on the existence of boot config commands in the NVRAM startup-config file. • The router can search for an available TFTP server by sending broadcasts and try to find an appropriate configuration file on the server. • The router can load the startup-config file in NVRAM which is the default. www.ciscopress.com 29 Creating an Initial Configuration Using Setup Mode • Setup mode is another tool for configuring routers. • In setup mode is a method by which the router sends a series of questions to the console. • The router builds an initial Configuration based on the answers, temporary stores it in RAM (running-config file) and can save it permanently in NVRAM (startup-config file). • Setup mode is reachable in two ways: – enter the setup command from privileged mode, or – boot the router when NVRAM is empty. www.ciscopress.com 30 Empty NVRAM NVRAM might be empty for the following reasons: ■ The router was just unpacked from its shipping box and has not yet been configured. ■ A user issued a privileged mode EXEC command such as erase startupconfig or write erase, both of which erase the contents of the startup-config file in NVRAM. www.ciscopress.com 31 Setup Mode • If a router completes the initialization process with no configuration loaded, the router cannot route any packets. • The router gives the network engineer an opportunity to use setup mode to easily configure the router. • To do so, the router poses a question to the engineer by sending a message to the console. www.ciscopress.com 32 Setup Mode (Continued) www.ciscopress.com 33 Setup Mode (Continued) • The router asks questions about some of the basic things that can be configured on a router, and the engineer’s answers to those questions tell the router what configuration commands to create. • The router often suggests a default answer, shown in brackets. • The user can always quit the process by pressing Ctrl-C at any point in the process. www.ciscopress.com 34 The Three Options at the End of the Setup Process ■ Option 0—Ignore all the answers that were given in setup mode, and give the user a user mode command prompt. As a result, the router will still not have any configuration. ■ Option 1—The user answered some of the questions incorrectly, so ignore all the answers given in setup mode. Start setup again so that the user can answer correctly this time. ■ Option 2—Use the answers given in setup mode, creating a startupconfig file in NVRAM and an identical running-config file in RAM. (The user also sees a new user mode command prompt.) www.ciscopress.com 35 Cabling and Accessing a Router Console Port Step 1 Connect a rollover cable to the router console port. (The console port is typically an RJ-45 jack, and the rollover cable also typically has an RJ-45 connector.) Step 2 Connect a converter to the other end of the rollover cable. Since many PC serial ports use a DB-9 serial port connector, so an RJ-45-to-DB-9 converter would be used. Step 3 Connect the DB-9 end of the converter to the serial port on the PC. www.ciscopress.com 36 Emulator Settings The emulator settings must be as follows to match the default settings on the router console port: ■ 9600 bps ■ 8 data bits ■ No parity ■ 1 stop bit ■ No flow control www.ciscopress.com 37 Common Terminal Emulators for Different OSs www.ciscopress.com 38 CLI Modes as Implied by Different Command Prompts www.ciscopress.com 39 Command Prompts Used by Different CLI Modes www.ciscopress.com 40 Router Password Basics www.ciscopress.com 41 Example Password Prompting by a Router • When configured to require passwords, the router prompts the user to supply the passwords. • Router does not display the password that is entered, so the example simply lists a string of the letter z to represent the password being entered. www.ciscopress.com 42 enable secret and enable password Commands • The two global configuration commands that can configure the enable password are enable password pw and enable secret pw, where pw represents the text of the password. • Together, these two configuration commands define what IOS expects to be entered when the user enters the enable command and the router prompts the user for a password. www.ciscopress.com 43 enable secret and enable password Commands (Continued) ■ If only one of the two commands (enable secret or enable password) is configured, IOS expects the user to enter the password as defined in that single configuration command. ■ If both the enable secret and enable password commands are configured, the router expects the password as defined in the enable secret command. In this case, the route ignores the password defined in the enable password command. ■ If neither the enable secret nor enable password command is configured, the behavior varies. If the user is at the console, the router automatically allows the user access to enable mode. If the user is not at the console, the router rejects the enable command. www.ciscopress.com 44 Using a Router CLI This section focuses on five main topics: – – – – How to find commands available from the CLI How to find the available options on a known command How to retrieve an old command so you can repeat it How to edit the command line to change something about the command – How to interpret the automatic help that occurs when you mistype a command www.ciscopress.com 45 Finding IOS Commands Using ? www.ciscopress.com 46 Getting Help for the Options on a Command www.ciscopress.com 47 Getting Help for the Options on a Command (Continued) www.ciscopress.com 48 Commands and Key Combinations Related to Command Recall www.ciscopress.com 49 CLI Enhanced Editing Feature The best way to check out and understand enhanced editing mode is to use the CLI of a real router. www.ciscopress.com 50 Error Messages When a Command Is Mistyped www.ciscopress.com 51 The show version Command www.ciscopress.com 52 Cross-reference List for Used Example ■ IOS version and descriptive information—Version 12.3(11)T3 ■ Bootstrap ROM version—12.3(8r)T8 ■ Router uptime—20 minutes ■ Last restart method—Returned to ROM by power-on ■ System image file and location—flash:c1841advipservicesk9-mz.123-11.T3.bin ■ Router platform/series/model—Cisco 1841 ■ Amount of RAM—117760K/13312K bytes ■ Amount of NVRAM—191K bytes ■ Amount of flash memory—31744K bytes ■ Configuration register setting—0x2102 www.ciscopress.com 53 Summary • Cisco IOS is the OS that runs inside Cisco routers. • Cisco IOS software provides a command-line interface (CLI) to allow users to access, use, and control IOS. A terminal emulator can be used to access the CLI, using one of three main methods of connecting to the router: – Using cabling to the router’s console port – Using a modem to dial in to the router’s aux port – Using Telnet over an IP network • Access via any of these three methods can be password protected using the console, auxiliary, and Telnet passwords, respectively. www.ciscopress.com 54 Summary (Continued) • The CLI includes a wide variety of modes. Two of these modes, user EXEC mode and privileged (enable) EXEC mode, allow the user to enter commands. • Configuration mode allows the user to enter configuration commands, which are commands that tell IOS what parameters to use when routing packets. • Users can navigate between modes using several commands. The user begins in user mode, moving to privileged mode by using the enable command. From there, the configure terminal command moves the user into global configuration mode. • IOS supports a large variety of features to help the user navigate the CLI. www.ciscopress.com 55