Basic Cisco Switch Configuration - 1. Enable SSH
Below is the steps need to be followed for enable SSH.
- Crate a Packet Tracer Topology Lab
- Basic IP Setting for connectivity
- Set hostname and domain-name on Switch
- Set console and enable password for SSH login
- Generate the RSA Keys
- Setup the Line VTY configurations
- Create the username password for SSH access from PC
- Verify SSH access
Packet Tracer Lab Topology
Basic IP Setting for connectivity
The next step is assign ip address to all devices. For keeping it simple and making basic connectivity we will assign just two IP address to these device. We will assign the IP address to PC. For this will open the PC setting and then IP configuration. Here we will assign 192.168.1.1 for PC and 192.168.1.20 for switch both will use 255.255.255.0 as subnet.
Switch> enable
Switch# config t
Switch(config)#interface vlan 1
Switch (config-if)# ip address 192.168.1.20 255.255.255.0
Switch (config -if)#no shut
Set host-name and domain-name on Switch
For SSh configurations you need to configure a host-name and domain-name for your switch you can follow below simple commands for this.
Switch # config t
Switch (config)#hostname Floor-1
Floor-1 ( config)#ip domain-name netconsole.com
Set console and enable password for SSH login
For SSH access it is required that you must configure the console and enable password on your cisco switch. You can set these two passwords with following commands.
Floor-1 ( config)#line console 0
Floor-1 (config-line)#password cisco
Floor-1 (config -line)#logging synchronous
Floor-1 (config- line)#login local
Floor-1 (config- line)#exit
Floor-1 # enable secret cisco
Generate the RSA Keys
Your Cisco switch must have RSA keys to proceed with SSH process. You can generate the RSA keys with following command.
Floor-1 ( config)# crypto key generate rsa
How many bits in the modulus [512]: 1024
% Generating 1024 bit RSA keys, keys will be non-exportable…[OK]
Setup the Line VTY configurations
Floor-1 ( config)#line vty 0 4
Floor-1 ( config-line)#transport input ssh
Floor-1 ( config -line)#login local
Floor-1 (config- line)#password 7
Floor-1(config- line ) #exit
Create the username password for SSH access from PC
Floor-1# config t
Floor-1 (config ) # username admin password cisco
Make sure the password encryption services is enabled on your switch, this service will encrypt your password, & when you do “sh run”, you’ll see only the encrypted password, not clear text password.
Floor-1# service password-encryption
Verify SSH access from Host
Once you done with the above configurations you can test all these configuration by creating a SSH connection from Host. You do it the command ssh –l <username> <IP address>. Open the host command prompt and use the command
C:\>ssh -l admin 192.168.1.20
It will ask for password, provide the password that you created with this username in previous steps. Then it asked for console password and then you need to provide the enable password. Now you are in your Cisco switch. You can perform switch configurations from your host.
Excellent Post Keep it Up
ReplyDelete