Latest

CCNA RnS #14 - CLI Introduction!

 

CCNA RnS – Cisco CLI Introduction

In this article let’s talk about a very famous and useful concept every network administrator needs to understand – Cisco CLI. Cisco uses a consistent CLI format across its routers and campus Switches and we are going to cover that today!

In order to access the device CLI, you need – a terminal (PC or Laptop), a Console Cable, and obviously a device that you want to configure (Router or Switch). Initially, cisco used to provide RJ45 to Serial Cable (DB-9) console cable. In those days, there used to be a serial port on the Laptop or PC. Now as faster option is available instead of serial port that is a USB port.

 

Figure 1: Cisco Console Cable

If you have an old RJ-45 to Serial cable, not to worry there are converters available in the market (Serial to USB converters) that can be used to connect router/switch to laptop equipped with USB cable.

Figure 2: USB to Serial Converter

Figure 3: USB Converter & Console connection

Evolution of Console Connection

Initially switch used to have RJ-45 Console port and desktops equipped with Serial ports. At that time, we used to have RJ-45 to DB-9 console cables provided with Cisco devices.

Figure 4: Physical Connection & Ports Specs.

Figure 5: Old Console Cable

Time changed and desktops were replaced with laptops that has USB ports. The network engineer now needed to buy a Serial to USB converter cable to physically connect the switch console port to the laptop USB port.

Figure 6: Physical Connection & Port Specs.

 

Figure 7: Console Cable & Converter Cable

Now multiple OEMs including Cisco also provide micro-USB console ports on the switch side. And to simplify the setup, a new console cable is provided – mico-USB to USB console cable (CAB-CONSOLE-USB).

Figure 8: Physical connections & Port Specs

Figure 9: Cable Console USB

Once the physical connections are ready, we need some software on the PC to access the CLI of the network device. This software is called terminal software that can make SSH or Telnet connections. I prefer “PuTTY”.

You need to change the “Connection type” to Serial and Speed 9600. Select the correct COM port and hit “Open” button.

Figure 10: Putty Settings to Console Access

Once you successfully access the device CLI, you will be presented with the user EXEC mode also called user mode. This mode allows users to read the device configuration. You can see what is configured (it is limited to the basic configuration that is used for troubleshooting). You will not be able to change/configure anything in user mode.

User mode prompts look like the below that ends with “>”.

Router>

Now if you want a read-write full access, from user mode you need to go to enable mode. Router/Switch enable mode can be accessed using the enable command. You will be prompted to enter the enable secret password before you are granted full access.

Router>enable

Router#

By default, Cisco devices don’t have any password configured for Console access considering the fact that the device is installed in the secured wiring closet. Any user who is trying to physically access the switch is a trusted user in the organization. However, sometimes network administrators configure a password for the console user. 

What to do now? Once you got the console access and got the CLI access you can enter commands that you want to execute. Cisco CLI help feature helps what are the commands executed in any mode, to access the help you just need to type the ? (question) mark. All the available commands and the description will be displayed on the screen.

Let’s say you know the start of the command let’s say “show” but not sure what are the various commands/options under show. You can get help by typing the show and then a question mark. All the possible options will be displayed. Keep continuing using ? mark after each option and finally hit enter. You will get the command output on the screen.

Normally new users play with show commands to see what the switch version is, current configurations, route table, MAC table, interfaces, and all. These show commands don’t disturb the functioning and are read-only commands. Hope you find this informative!

There are various command prompts for you to work on, to name a few

User mode limited read-only access available. Command prompts look like below

Router>

Enable mode – you get full read-only and write access with enable mode. All the configuration parameters (Global or feature specific) can be accessed from the enable mode. The command prompt for enable mode is below –

Router#

Now if you want to configure a port on the router, you need to go to first go to the configuration mode by typing the configure-terminal command

Router# configure terminal
Router(config)#

 Once you type the configure terminal you get the “config” prompt and now you can put the commands here that impact the device as a whole – like the hostname command that will apply to the device.

Router# configure terminal
Router(config)#hostname CBI_Router
CBI_Router(Config)#

 If you want to change the interface parameters you need to go to the interface mode to change the interface parameters. For example, you need to apply a description to the interface (a meaningful full text that shows where this interface connects)

Router# configure terminal
Router(config)#hostname CBI_Router
CBI_Router(config)#interface gig0/0
CBI_Router(config-if)# description “MPLS Link”
CBI_Router(config-if)#

Like interface mode there are other modes as well. Most common mode is router mode that is used to configure the routing parameters.

 Now you have configured a few parameters like hostname and interface description of the above device. All these changes are going to the running configuration of the device. Once the device is rebooted all these changes will be lost as the running configuration is the volatile memory and anything that is there is running configuration, after reload of the device will be lost. To make the persistent changes you need to save all the changes using the write memory command or wr for short.

Router# configure terminal
Router(config)#hostname CBI_Router
CBI_Router(config)#interface gig0/0
CBI_Router(config-if)# description “MPLS Link”
CBI_Router(config-if)# write memory

I can keep continuing to write this article but better to stop here. I hope you find this informative!

 Continue Reading...