Some Cisco Switching useful commands

Configuration

Commands

Cisco# username cisco password myNEWpassword
Cisco# show version
Cisco# show system id
Cisco# show mac address-table
Cisco# show inventory
Cisco (config)# hostname Switch
Switch# copy running-config startup-config
Switch (config)# interface vlan1
ip address 192.168.1.100 255.255.255.0
no ip address dhcp
Switch (config)# interface vlan1
Switch (config-if)# ip default-gateway 192.168.1.254
Switch # reload
Switch (config)# interface range ge1/0/4,ge1/0/30
Switch (config)# interface range ge1/0/4-18
Switch (config)# ip ssh server

Import/Export Config

Switch # copy run tftp://tftp_server/YYYY-MM-DD
Switch # copy tftp://tftp_server/YYYY-MM-DD run

Update Firmware (easy method)

Switch # boot system tftp://tftp_server/firmware.bin

Update Firmware

Switch # copy tftp://tftp_server/firmware.bin flash://system/images/
Switch # show bootvar
Switch # boot system image-2
Switch # reload

PoE

Switch (config)# interface gi1/0/1
Switch (config-if)# power inline off
Switch (config)# interface gi1/0/1
Switch (config-if)# power inline auto
Switch # show power inline
Switch # show power inline gi1/0/1

VLAN

Add a VLAN

Switch (config)# vlan database
Switch (config-vlan)# vlan 4
Switch (config)# interface vlan 4
Switch (config-if)# name VoIP

Set the access VLAN to an interface

Switch (config)# interface GigabitEthernet 1/24
Switch (config-if)# switchport mode access
Switch (config-if)# switchport access vlan4

Configure the allowed VLANs to an interface (Trunk)

Switch (config)# interface te 1/0/1
Switch (config-if)# switchport mode trunk
Switch (config-if)# switchport trunk allowed vlan add 4,100,101,150

Locked Port / Disable port security

Message : Your port has port security enable and has noticed that the MAC address on that port is different from what the port had originally learned.

Switch # set interface active gi2/0/4
Switch # show ports security gi2/0/4
Switch (config) # interface gi2/0/4
Switch (config-if)# no port security
Licence Creative Commons
This website http://shebangthedolphins.net is licensed to the public under a licence Creative Commons Attribution licence.
Contact :