Some Basics
Enter elevated mode/enable mode
Switch>enable
Show device information
Switch#show version
Show current configuration the device is running on
Switch#show running-config
Switch#show run
Show starting configuration of the device
Switch#show startup-config
Swich#show start
Saving current configuration as startup configuration
Switch#copy running-config startup-config
Switch#copy run start
Show interface out of the running configuration
Switch#show run int Gi1/0/1
Show details and configuration of interface
Switch#show int Gi1/0/1
Show all interfaces, their description and status
Switch#show interface status
Minor Configuration
Enter the configuration mode
Switch#config t
Change the hostname of the device
Switch(config)#hostname new_name
Change password for elevated mode
Switch(config)#enable secret "new_password"
Change password for console access (e.g. serial cable)
Switch(config)#line console 0
Switch(config-line)#password "new_password"
Switch(config-line)#login
Change password for vty access (e.g. telnet, ssh)
Switch(config)#line vty 0 15
Switch(config-line)#password "new_password"
Switch(config-line)#login
Encrypt passwords
Switch(config)#service password-encrypt
Remote Access
Generate RSA key for SSH
Switch(config)#crypto key generate rsa modulus 2048
Choose SSH version
Switch(config)#ip ssh version 2
Adjust login attempts
Switch(config)#ip ssh authentication-retries 3
Adjust SSH timeout (idle time)
Switch(config)#ip ssh time-out 60
Interface Configuration
Clear configuration of interface
Switch(config)#default interface Gi1/0/1
Enter interface config
Switch(config)#int Gi1/0/1
Shutting interface down
Switch(config-if)#shut
Bringing the interface up
Switch(config-if)#no shut
Changing interface description
Switch(config-if)#descripion "new_interface_name"
Changing port mode between auto, full and half
Switch(config-if)#duplex auto
Switch(config-if)#duplex full
Switch(config-if)#duplex half
Bandwidth limitation (in kb/s; max 10000000)
Switch(config-if)#bandwidth 200000
VLAN configuration
Create vlan/Enter configuration
Switch(config)#vlan 10
Change vlan description
Switch(config-vlan)#description "vlan_name"
Adding interface to vlan in access mode
Switch(config)#interface Gi1/0/1
Switch(config-if)#switchport mode access vlan 10
Adding interface to vlan in trunk mode
Switch(config)#interface Gi1/0/1
Switch(config-if)#switchport mode access vlan 10
Telephony
Change interface to accept traffic for cisco phones
Switch(config-if)#trust device cisco-phone
Adding interface to access and voice vlan
Switch(config-if)#switchport mode access vlan 10
Switch(config-if)#swichport voice vlan 100
Finishing up
Exit configuration mode, elevated mode or current session
Switch(config)#exit
Switch#exit
Switch>exit
Reading + Troubleshooting
Show Mac-Address table
Switch#show mac-address-table
Show spanning tree
Switch#show spanning-tree
Switch#show spanning-tree interface Gi1/0/1
Switch#show spanning-tree vlan 10
Show spanning tree to root switch
Switch#show spanning-tree root
Information about changes in spanning-tree
Switch#debug spanning-tree events
Resetting
Switch#delete flash:vlan.dat
Switch#erase startup-config
Switch#reload