chitika2

الاثنين، 6 أكتوبر 2014

Lesson 2 - Navigating in Cisco IOS

Lesson 2 - Navigating in Cisco IOS

Once, you have connected to your Cisco switch or router console port, and power up the device you will see some information displayed during the start of the device. If the device has no initial configuration you are presented with:

Pic. 1 - System Configuration Dialog


You can safely cancel this request as its capability to configure the device is not very impressive. Instead, you are going to do things all professionals do: command after command.

What follows is bunch of messages sent to the screen and after hitting the Enter key few times you get something like this (here is the router, but a switch would introduce itself as ... Switch> ):
Router>

IOS Modes (contexts)

This prompt of the device tells you in which 'context' you are, and the one above with the '>' character is known as 'user exec mode' or 'privilege level 1 mode'. You can't configure much in this mode of operation. It is designed as a 'monitoring' mode not a 'configuration' one. Also, the monitoring capability is limited. For instance, you can't see the running configuration of the device.

Type in the following command:
Router>enable
Router#

The prompt changes to '#' which is called 'privileged exec mode', 'enabled mode' or sometimes 'privilege level 15 mode'. I would like to draw your attention to two things here. Both modes of operation (or contexts, if you like) have two things in common:
  1. They are used primarily to monitor the device (you will be using 'show' and 'debug' commands in those modes).
  2. They are context for immediate execution of your commands. If the syntax is correct, system executes the command immediately.
Those two modes differ from one another as well:
  1. User Exec Mode - is limited in terms of what information will be available.
  2. Enabled Exec Mode - gives the operator ALL information (like root or Administrator account on a computer).
Question Mark 

As the commands take many attributes your best friend is the question mark '?'. This help is known as the 'context-sensitive help'. This means that depending on which context you use, while typing a question mark (?) the system is going to list the commands that can be executed in that particular mode of operation. See more in the attached video.

Configurations

In order to configure things in Cisco IOS (except for some minor changes), you must enter the 'global configuration mode' first which is characterized by the following prompt:
Router(config)#

This context can be accessed by typing the following command in the 'privileged exec mode':
Router#configure terminal

Whatever you configure this particular mode it is going to be applied to the device as a whole unit(e.g. hostname, default gateway on a switch etc.).

If you want to enter the context of the interface to configure it with some parameters like ip address, speed, duplex, description etc. , you must enter that interface from the global configuration mode like the one below:
Router(config)#interface fastethernet1/0

If you do not know what interfaces your device has, type the following command in the enabled mode:

Router#show ip interface brief

As you see, in the 'global configuration mode' I did the following actions in order to access the context of the interface:
  1. Entered the interface type (here: Fast Ethernet).
  2. Referenced the module number (here: 1)
  3. Referenced the port number in the module 1 (here: 0)
Please, note that routers count ports starting from 0, switches starting from 1.

You'll learn other contexts as we go through numerous labs and video presentations.

Abbreviations

You don't have to type in the full words of the commands and certain attributes that follow the commands. For instance, instead of typing:
Router#configure terminal
Router(config)#

You can type:
Router#conf t
Router(config)#

As long as the abbreviation uniquely describes which command you want to use, the system has no problem accepting it.

Shortcuts And Keystrokes

When you type enough of the characters that uniquely identify the command in a given context you can use 'tab' key and the system is going to complete the command on the screen for you (just like in Linux).

I often use the following keystrokes while editing the commands:
  • CTRL-z - takes the cursor back to the 'enabled exec' mode from any other context
  • CTRL-a - takes the cursor to the beginning of the line
  • CTRL-e - takes the cursor to the end of the line
  • CTRL-k - erases everything to the right of the cursor
  • CTRL-u - erases everything to the left of the cursor
  • Upper Arrow or CTRL-P - displays previous command from the history buffer
  • Lower Arrow or CTRL-N - displays next command from the history buffer
System keeps the record of up to ten (default) commands you typed in. You can increase/decrease the history buffer up to 256 commands.

If you want to check the history buffer size, type in:

Router#show terminal | include history

Changing the buffer size can be accomplished with the following command in the 'enabled mode'
Router#terminal history size 256

The above command  will increase the size of the history buffer to 256 commands.

If you want to see the buffer (which commands were typed) use this command:

Router#show history
    Please, take a look at the video I posted below to see most of those things in action. Practice them until you are confident with the content of this lesson before you proceed to the next one.

    Next lesson is going to be about creating an initial configuration of our router and/or switch.

    ليست هناك تعليقات:

    إرسال تعليق