Cisco Router archives - Network technologies and trends

Network technologies and trends:

Cisco Router

Nov 21 2009   11:36AM GMT

How to configure the System prompt in a Cisco Router or a Cisco Switch?



Posted by: Yasir Irfan
Cisco Router, Cisco Router tips, Cisco Switches, Cisco Tips, How to configure the System prompt in a Cisco Router or a Cisco Switch, System prompt, no prompt, TTY, VTY, config t, hostname, Cisco Hostname, %h:%n%p, active telnet sessions, Telnet, Cisco Device, Network Tips, Network Technologies and Trends

 

There is a cool handy way to know TTY sessions established in any Cisco Router or a Cisco Switch. By using this feature you can know the number of active telnet sessions from the prompt itself.

Normally whenever you log to any Cisco Router or Switch you will find this menu

ITKE-AS01#

 

By using the “prompt” command you can see the difference

 

You might be wondering how come this is possible, ok now let me show you how to enable this feature in a Cisco Router or a Cisco Switch,

Log in to your Cisco Device and use the following command “prompt %h:%n%p”

 

ITKE-AS01#config t

ITKE-AS01 (config)# prompt %h:%n%p
ITKE-AS01 (config)# exit

 

In the example I have used three escape sequences to set the prompt name to the hostname (%h), followed by the command number (%n) and then followed by the appropriate prompt character for the current command mode (%p).

You can see the difference in the hostname after applying the “prompt %h:%n%p” command.

ITKE-AS01:1#sho users

    Line       User       Host(s)              Idle       Location

*  1 vty 0     yasir      idle                 00:00:00 10.0.0.5

 

  Interface      User        Mode                     Idle     Peer Address

ITKE-AS01:1#

 

As the number of TTY session increases you can see the incremental change in the hostname with the sequence number as displayed below.

Example with two TTY sessions

ITKE-AS01:2#sho users

    Line       User       Host(s)              Idle       Location

   1 vty 0     yasir      idle                 00:00:23 10.0.0.5

*  2 vty 1     itkeuser      idle                 00:00:00 10.0.0.5

 

  Interface      User        Mode                     Idle     Peer Address

 

ITKE-AS01:2#

 

Example with three TTY sessions

ITKE-AS01:3#sho users

    Line       User       Host(s)              Idle       Location

   1 vty 0     yasir      idle                 00:01:14 10.0.0.5

   2 vty 1     itkeuser      idle           00:00:50 10.0.0.6

*  3 vty 2     itkeadmin   idle         00:00:00 10.0.0.7

 

  Interface      User        Mode                     Idle     Peer Address

 

ITKE-AS01:3#

 

Example with four TTY sessions

ITKE-AS01:4#sho users

    Line       User       Host(s)              Idle       Location

   1 vty 0     yasir      idle                 00:01:43 10.0.0.5

   2 vty 1     itkeuser      idle            00:01:20 10.0.0.6

   3 vty 2     itkeadmin   idle            00:00:29 10.0.0.7

*  4 vty 3     yasir      idle                 00:00:00 10.0.0.5

 

  Interface      User        Mode                     Idle     Peer Address

 

ITKE-AS01:4#

 

I you want to disable the TTY display enter the “no prompt” command as shown below.
ITKE-AS01:4#config t
ITKE-AS01:4 (config)# no prompt

 

Following are the prompt Variables available for the “prompt” command.

Nov 17 2009   6:38AM GMT

How to disable SSH in Cisco Devices?



Posted by: Yasir Irfan
How to disable SSH in Cisco devices, SSH, Cisco Router, Cisco Switch, crypto key zeroize rsa, enable SSH, Disable SSH, Cisco-remote-access, remote access, Routing and Switching, ssh disable, ssh enable, ssh reconfigure, Cisco Tips, Cisco Networking, Router Configuration, Switch Configuration, disable SSH in Cisco routers, disable SSH in Cisco Switches, Network Technologies and Trends, Cisco Commands

We all know the importance of SSH, and it is one of most used method for remote access of Cisco Devices either it might be a Cisco Router or a Cisco Switch. Most of the Network Engineers I come across say it is so complicated to either enable or disable the SSH in Cisco Devices.

 If you simply try to use “no commands” used to enable SSH it will not work. Here is the tip to disable the SSH in either Cisco Router or Cisco Switches.

 Commands used to enable SSH in a Cisco Device

ITKE-AS1(config)#ip domain-name itke.com

ITKE-AS1(config)#crypto key generate rsa general-keys modulus 512

The name for the keys will be: ITKE-AS1.itke.com

 

% The key modulus size is 512 bits

% Generating 512 bit RSA keys, keys will be non-exportable…[OK]

 

ITKE-AS1(config)#

ITKE-AS1(config)#aaa new-model

ITKE-AS1(config)#aaa authentication login default local

ITKE-AS1(config)#aaa authentication exec default local

 

Commands used to disable SSH in a Cisco Device

Do notice if you use the command “no crypto key generate rsa” it will not work rather the device will suggest you to use the ‘crypto key zeroize rsa’ command, amazing isn’t it

ITKE-AS1(config)#no crypto key generate rsa

% Use ‘crypto key zeroize rsa’ to delete signature keys.

 

ITKE-AS1(config)#crypto key zeroize rsa

% All RSA keys will be removed.

% All router certs issued using these keys will

will also be removed.

Do you really want to remove these keys? [yes/no]: yes

ITKE-AS1(config)#


Sep 12 2009   7:34AM GMT

How to capture a text using PuTTY client?



Posted by: Yasir Irfan
PuTTY, Telnet, SSH, Telnet Client, Backup, running config, Startup config, Cisco Router, Cisco Switch, Cisco Tips, Cisco backup

 

PuTTY doesn’t need any introduction as its one of the widely used for remote console utility. PuTTY is an SSH and telnet client.

In day to day operational activities we do telnet or SSH to our Cisco routers or Switches, at times we need to backup a running or startup config or   a Cisco router or a switch or even some times we need to capture the terminal session logs for technical information etc.  This is can be easily done by using the PuTTY client.

I will show you how to capture a text using PuTTY client.

Once you have established a remote session with a Cisco router or a Switch, follow the following steps

 

Step 1: Right Click on the menu bar and select “Change Settings”

 

Step 2: Click logging under the icon Session.

 

Step 3: Then select “All Session Output”.

 

Step 4: Select the location using the browse button and enter the desired file name and click apply.

 

These steps will create the log file in the specified location and it will log everything you did in that particular telnet or SSH session.