Showing posts with label Commands. Show all posts
Showing posts with label Commands. Show all posts

Booting a Cisco Device

Before a router starts the booting process, it has to initialize its interfaces and then load the operating system and configuration file. To control this process the user has to find the type of image file and configuration file used by router.

When the router bots-up, the sequence of steps called as boot sequence occurs which helps to the hardware and load the required software. The boot sequence consists of following steps

Step 1: Power- on self-test: The router performs a POST is a series of hardware test that verify whether all components of the device are functional such as the POST. While performing this test the router also determines what hardware is present. The POST is stored in and executes from microcode in ROM.

Step 2: Load and run bootstrap code: The bootstrap code finds and loads Cisco IOS software. It is stored in ROM that is used to execute programs. The bootstrap program is responsible for finding the location of IOS software and then loading the file. By default, the IOS software is loaded from the flash memory in all Cisco routers. Once the IOS software is loaded, the bootstrap is not used until the router is reloaded.

Step 3: Load the IOS software: The configuration register and configuration file in NVRAM helps to determine the location of IOS image and helps to know the type of IOS image has to be used. Once it is found, the image is loaded into the RAM and starts the IOS running. Some of the router does not image from RAM but it executes directly from the Flash memory.

Step 4: Find the Configuration: The default is to look for a valid configuration file stored in NVRAM. It is also known as startup-fig.

Step 5: Load the configuration: If the stratup- config s in the NVRAM, is loaded and executed. If the startup-config is not found then the router will start the setup mode configuration upon boot up.


Using the setup command

If the router does not have a configuration file it will automatically enter Setup mode when you switch it on. Setup mode presents you with a prompted dialog called as the configuration dialog in which you can establish an initial configuration.

The prompts in the system configuration dialog of the startup command facilitate default answers inside the bracket [ ] following a question. Pressing Return key helps to use default. If the system has bee configured previously, then the default will be the currently configured values.

When the configuration process in the setup mode is completed, the configuration. When you enter “YES” the configuration will be executed and saved to NVRAM. If you enter “NO”, the configuration will not be saved and the process will start again

Setup Configuration Dialog

There are two options while using setup mode: Basic Management and Extended Setup. Basic Management only provides the configuration which allows to connect to the router but Extended setup provides the power to configure some global parameters in addition to this it also gives interface configuration parameters.

Setting global parameters

After checking the current interface summary, a prompt which signifies that the user has to enter global parameters for the router appears. These global parameters are nothing but the configuration values specified by the user.

The prompt appears as illustrated in the above figure...

The first global parameter which you can set is the host name. at initial configuration, the router name is displayed between the square brackets for example [Router]. The next global parameter is to set various passwords. First you have to enter enable password. When you enter the password characters for the prompt, Enter enable secret; the characters are then encrypted. This enhances the security of the password. Whenever you view the configuration file, the encrypted form of the password cannot be read.

Note: Enable secret password is secret word which is used instead of enable password when it exists. The “enable password” is used when “enable secret password” is not see.

Gathering Basic Routing Information

To get the basic information about router configuration, the user has to enter the commands at the CLI. The commands are generally the “show” commands. The show command cab be used o display configuration and parameters that is set.

For example:

Router#show clock

Typing Ctrl + Z will take back to global configuration mode. By using question mark (?) at any prompt you cab view list of all commands that are available and can be executed at that prompt.

Router(config)#?


gives all the commands which can be executed in the global configuration mode. This feature is referred as context-sensitive help. The question mark cab also be used to find commands which start with a certain letter. Like by typing c? at the prompt displays all the commands which start with the letter c.

Note: If you have typed an incorrect command, the caret symbol (^) and help response indicate the error. Notice that the caret symbol is displayed at the point in the command string where IOS detect an incorrect command, keyword. This error location allows you to find and correct syntax errors easily.

Show version command

The show version command is used to provide basic information on what type of Cisco IOS the router is using. In addition to this, it also gives information on system hardware, what software version you are using as well as the names, sources of configuration files and their boot images.

For example:

show version command

Basics of Cisco IOS

The IOS (Internetworking Operating System) runs on all Cisco routers and also some Cisco switches and allows you to configure the devices as well. This lesson starts to build a foundation for understanding the standard Cisco IOS. In this lesson, you will also learn the IOS modes of operation, syntax, storage and organization to better understand the array of options within IOS. In addition to this, you will also learn how to start a router for the first time by using correct commands and start-up sequence.

Definition of IOS

IOS (inter-networking Operating Systems )  is the operating system which controls all the functions of the devices such as access lists to queuing and provides the User Interface (UI) for managing the device. Generally, UI is the command line interface (CLI) in Cisco devices which is similar to other popular CLIs such as DOS and C shell in UNIX.

IOS version and structure

Cisco IOS is versioned using three numbers and some letters, in the general form a.b(c.d)e, where:
  1. a is the major version number.
  2. b is the minor version number.
  3. c is the release number, which begins at one and increments as new releases in the same a.b train are released.
  4. d (omitted from general releases) is the interim build number.
  5. e (zero, one or two letters) is the release train identifier, such as none (which designates the mainline, see below), T (for Technology), E (for Enterprise), S (for Service provider), XA as a special functionality train, XB as a different special functionality train, etc.

Rebuilds : Often a rebuild is compiled to fix a single specific problem or vulnerability for a given IOS version. For example, 12.1(8)E14 is a Rebuild, the 14 denoting the 14th rebuild of 12.1(8)E. Rebuilds are produced to either quickly repair a defect, or to satisfy customers who do not want to upgrade to a later major revision because they may be running critical infrastructure on their devices, and hence prefer to minimize change and risk.

Interim releases : Are usually produced on a weekly basis, and form a roll-up of current development effort. The Cisco advisory web site may list more than one possible interim to fix an associated issue (the reason for this is unknown to the general public).

Maintenance releases : Rigorously tested releases that are made available and include enhancements and bug fixes. Cisco recommend upgrading to Maintenance releases where possible, over Interim and Rebuild releases.

The file naming convention is done by making use of the version of IOS and then adding all sorts of other specific information. The example, you may see an IOS image like this c4500-js40-120-3t-mz. To better understand this convention, read the steps below.
  • The c4500 is for platform and it indicates that this image is for 4500 series router.
  • The js40 indicates the feature set, in indicates that this image is for 4500 series router.
  • The 120-3t is the version (12.0(3)T)
  • M indicates that the software has to be executed from RAM.
  • Z indicates that the file is zipped or compressed and it has to be decompressed into executable .bin format before loading into the device. A decompressed file is usually denoted with a 1.
Cisco Router IOS

Cisco internetwork Operating System was developed to deliver network services. IOS runs on most Cisco routers and on some Cisco switches such as catalyst 2950.

IOS of Cisco router is responsible for
  • Carrying network protocols and
  • Prevent unauthorized use of network.
  • Providing network reliability for connecting to network resources.
Cisco ISO can be accessed through console port of a router, from a modem into the auxiliary port or even through Telnet.

Router Components

Cisco router use ROM and RAM similar to computers. Instead of hard drives, routers use special types of memory known as flash of NVRAM and these memories have unique function. The different types of memory include Random Access Memory, flash memory, Non-volatile memory and Read-Only Memory. Each of these are explained below

Random Access Memory (RAM) :

RAM is the only type of volatile memory in the router. With volatile memory, the contents are lost if the router loses power.

RAM contains a running copy of the Cisco IOS , which is loaded into RAM from the FLASH memory. It also contains the running copy of the configuration file which is loaded into the RAM from the NVRAM at start-up. In addition to this, it stores routing table, ARP tables and other data structures. RAM also provides packet buffering capabilities.

Non-volatile RAM (NVRAM) :

NVRAM (Nonvolatile RAM) is used to store the router’s startup configuration file and configuration register. It doesn’t lose data when power is switched off. So the contents of the start-up configuration file are maintained even when you switch off or restart the router

Flash Memory

Flash memory also holds a copy of IOS image. By flashing a new version on to the chip, this IOS image can be easily upgraded. Flash memory does not loss its contents when the router is switched off.

Read-Only Memory (ROM) :

ROM is used to store the router’s bootstrap start-up program, operating system software, and power-on diagnostic tests programs. ROM contains microcode for basic functions to start and maintain the router. RXBOOT is also contained in ROM. The table describes the major functions of Cisco router components.

Command-Line Interface (CLI IOS Command Modes)

IOS software uses a command-line (CLI as its traditional console environment. The
IOS interface is similar to a UNIX or DOS commands but the main difference is that IOS has a user interface with several command modes. Certain functions such as configuring a network interface can only be performed in a specific command mode. Each command mode permits to configure different configuration components.

User EXEC mode (user mode)

The first mode which is presented upon logging into the router is the user mode. In this mode, only a limited number of commands can be executed and no configuration parameters ca be read or modified. This mode will not help to perform any sort of debug and it does not contain informational (show) commands and also you cannot reconfigure device in any way. User mode helps to view some basic information such as routing table and the status of the components. In this mode, the prompt appears like this

Router> The greater than (>) symbol indicates that you are in user mode

Privileged EXEC Mode (enable mode)

The second mode is the privilege mode which is also known as enable mode. This mode allows users to view the system configuration, restart the system and enter configuration mode. It allows you to access all commands usable by the device and allows all the commands that are available in user mode.

To enter into the enable mode, type enable command which will ask for password (if password is set). This password will be either the enable secret of enable password. The user has to enter correct password or secret password to access privileged mode. Enable secret password will be in encrypted form when it is stored in the configuration and it is safer. Once you enter into the enable mode, the prompt will be changed to # sign it will be as shown below

Router>enable

Password:

Router#

In the privileged mode, you can use any standard commands such as show command and debug command. Debug command are special commands used to perform advanced diagnostics on the system. Few other configuration commands such as clear, clock, reload, copy and erase can be used in privilege mode. To exit the privileged mode, the user has to enter disable command.

To configure parameters of the router, one needs to proceed from privileged EXEC mode to the global configuration mode.

Global Configuration Mode

By typing configure terminal takes user to the global configurations mode from the enable mode which helps to configure the device. This mode allows users to modify the running system configuration. Once the user enter into the configuration mode, the prompt again changes which can be illustrated as shown below

Router # configure terminal

Router(config)#

This is also known as global configuration mode because all the commands used here will have an affect on the entire device.

Global configuration mode consists of sub modes  such as interface mode and line mode. As the configuration sub-modes changes depending on what is being configured, the words within the parenthesis also changes for example: when user enters interface configuration sub-mode, the prompt changes to (config-if)# following the router name.

To exit configuration mode, the user can enter end or press Ctrl+Z

Interface Mode

The commands entered in this mode affect the current interface only. Interface command can be used to modify the configuration of a specific interface. In order to perform any change enter into global configuration mode:

Router 1 (config)# interface serial 0

OR

Router 1 (config)# int serial 0

The result will be:

Router 1 (config-if)#

The prompt changes to Router (config-if) # which indicates that you are in interface configuration mode.

Line Mode

Line command helps to configure user-mode passwords. The prompt then changes to Route (config-line)#;

Router (config)# line con 0

OR

Router 1 (config)line vty 0 4

The result will be:

Router 1 (config-line)#

The line console 0 commands are called as major command and it is also known as global command. The commands which are entered from (config-line) prompt are known as global command.

Each mode is represented by a different prompt, as show in the table below:-

Command mode

Command and mode Prompt Command to enter mode
User EXEC Router> Login
Privileged EXEC Router# Enable
Global Configuration Router(config)# Configure terminal
Interface Configuration Router(config-if)# Interface type number ( from the global configuration mode )
Line Configuration Router(config-line)# Line line_type line_number editing_line_number ( from global configuration mode )


Enhanced Editing Commands and History Commands

The user interface contains an enhanced editing mode that provides a set of editing key functions. No terminal editing command at the privileged mode helps to disable advanced editing features. You can also re-enable these features bu using terminal editing command. The table below shows some of the editing commands and how it can be helpful while working on router

Editing commands

Command Meaning
Ctrl+A Will take cursor to the beginning of the current line
Ctrl+E Moves the cursor to the end of the line
Esc+B Moves back one word
Ctrl+B Moves back one character
Ctrl+F Move forward one character
Esc+F Moves forward one character
Ctrl+D Deleted the single character
Backspace Removes one character to the left of the cursor
Ctrl+R Redisplays a line
Ctrl+U Erases a line
Ctrl+W Erases a word
Ctrl+Z Ends configuration mode and returns to EXEC mode

Router Command History

Router command history will shown the commands which are typed previously. The history size can be changed and it can be verified by using show terminal command. The table below shows the router command history with the commands:

Command Meaning
Ctrl+P or up arrow Shows last command entered
Ctrl+N or down arrow Shows previous command entered
show history Shows last 10 commands typed by default
show terminal Shows terminal configuration and history buffer size
terminal history size Changes buffer size but the maximum size is 256