COMMANDS
Enable / Disable / Exit / End / Abort
enable: move from user EXEC mode to privileged EXEC mode
disable: to return to user EXEC mode.
configure terminal: to move into global configuration mode
exit: to return to the privileged EXEC mode or to exit a sub-configuration mode
end: to move from any sub-configuration mode to the privileged EXEC mode
CTRL+Z: to move from any sub-configuration mode to the privileged EXEC mode
CTRL+SHIFT+6: abort operation
Hostname
Switch# configure terminal
Switch(config)# hostname Sw-Floor-1
Sw-Floor-1(config)#
Secure Console Access
Sw-Floor-1# configure terminal
Sw-Floor-1(config)# line console 0
Sw-Floor-1(config-line)# password cisco
Sw-Floor-1(config-line)# login
Sw-Floor-1(config-line)# end
Sw-Floor-1#
Secure Privileged Access
Sw-Floor-1# configure terminal
Sw-Floor-1(config)# enable password class
Sw-Floor-1(config)# exit
Sw-Floor-1#
Sw-Floor-1# configure terminal
Sw-Floor-1(config)# enable secret class
Sw-Floor-1(config)# exit
Sw-Floor-1#
Secure VTY Lines Access
Sw-Floor-1# configure terminal
Sw-Floor-1(config)# line vty 0 15
Sw-Floor-1(config-line)# password cisco
Sw-Floor-1(config-line)# login
Sw-Floor-1(config-line)# end
Sw-Floor-1#
Encrypt Password
Sw-Floor-1# configure terminal
Sw-Floor-1(config)# service password-encryption
Sw-Floor-1(config)#
Banner
Sw-Floor-1# configure terminal
Sw-Floor-1(config)# banner motd #Authorized Access Only#
Interface configuration
Switch# configure terminal
Switch(config)# interface FastEthernet 0/1
Switch(config-if)#
Config
Switch# show running-config
Switch# show startup-config
Switch# copy running-config startup-config
Switch# erase startup-config
Switch# reload
Virtual Interface configuration
Sw-Floor-1# configure terminal
Sw-Floor-1(config)# interface vlan 1
Sw-Floor-1(config-if)# ip address 192.168.1.20 255.255.255.0
Sw-Floor-1(config-if)# no shutdown
Sw-Floor-1(config-if)# exit
Sw-Floor-1(config)# ip default-gateway 192.168.1.1
Virtual Interface configuration
Sw-Floor-1# configure terminal
Sw-Floor-1(config)# interface vlan 1
Sw-Floor-1(config-if)# ip address 192.168.1.20 255.255.255.0
Sw-Floor-1(config-if)# no shutdown
Sw-Floor-1(config-if)# exit
Sw-Floor-1(config)# ip default-gateway 192.168.1.1
Telnet
Preconditions: in order to connect via TELNET it is necessary to have:
pre-configured a password for “secure privileged access”
pre-configured an ip address on interface VLAN 1
Switch#conf t
Switch(config)#user TYPEYOURUSERNAME password TYPETOURPASSWORD
Switch(config)#line vty 0 15
Switch(config-line)#login local
Switch(config-line)#transport input telnet
Switch(config-line)#exit
from PC: telnet TYPESWITCHIP
SSH
Preconditions: in order to connect via TELNET it is necessary to have:
pre-configured a password for “secure privileged access”
pre-configured an ip address on interface VLAN 1
pre-configured an hostname for the device
pre-configured an ip domain name
Switch(config)#hostname MYSWITCH
MYSWITCH(config)#ip domain-name MYDOMAIN
MYSWITCH(config)#username myUser password myPass
MYSWITCH(config)#line vty 0 15
MYSWITCH(config-line)#transport input ssh
MYSWITCH(config-line)#login local
MYSWITCH(config-line)#exit
MYSWITCH(config)#crypto key generate rsa
The name for the keys will be: MYSWITCH.MYDOMAIN
Choose the size of the key modulus in the range of 360 to 2048 for your
General Purpose Keys. Choosing a key modulus greater than 512 may take
a few minutes.
How many bits in the modulus [512]:
% Generating 512 bit RSA keys, keys will be non-exportable...[OK]
MYSWITCH(config)#
*Mar 1 0:12:47.796: RSA key size needs to be at least 768 bits for ssh version 2
*Mar 1 0:12:47.796: %SSH-5-ENABLED: SSH 1.5 has been enabled
from PC: ssh -l myUser 192.168.1.2