networking:cisco:switch_command_reference
Table of Contents
BASIC DEVICE COMMANDS
Show Running Configuration File
#show running-config
Show Startup Configuration File (NVRAM)
#show startup-config
Copy Changes from Running Config to the Startup Config
#copy running-config startup-config
Show Version (Platform Type / OS Revision / Last Boot / Memory / Interfaces / Conf Register)
#show version
BASIC SETINGS
Set a Warning Banner for Login Prompt
>enable #configure terminal #banner motd & #banner line1 #banner line2 & #exit
Change BAUD rate
switch#configure terminal switch(config)#line con 0 switch(config-line)#speed 9600 switch(config-line)#end switch#wr
Set hostname
>enable #configure terminal #hostname router1 #exit
DEVICE SECURITY
Set Password and Level for Exec & Non-Exec Access (>enable
#configure terminal #enable password level 15 EnablePass1
Set Level and Secret Password Access (recommended method)
>enable #configure terminal #enable secret level 15 EnableSecret1 #exit
SAVING RESTORING AND DELETING CONFIGURATIONS
Save Running Config to Startup Config
#copy running-configuration startup-configuration
Save Running Config to a Remote TFTP Server
#copy running-configuration tftp <enter IP> <enter filename>
Save Config From Remote TFTP Server to the Running Config
#copy tftp running-configuration <enter IP> <enter filename> Delete NVRAM #delete nvram
Delete Current configuration
#write erase <confirm> #reload
INFORMATIONAL COMAMNDS
Show Spanning Tree Information (port cost/hello interval/root bridge address)
>show spantree
MAC ADDRESSES
Show Mac Address Table (Shows which Devices are Connected to which Port)
>show mac-address-table
Permanently Assign a Device MAC Address to a Port
#conf term (config)#mac-address-table permanent 1111-1111-1111 e0/5 (config)#mac-address-table static 3333.3333.3333.3333 vlan 1 int fa0/3
Clear Mac Address Table
#clear mac-address-table
Configure Port Security to “Sticky Learn” the MAC Address Connected and only Allow that Device to Connect
1900
#conf term (config)#int e0/5 (config-if)#port secure (config-if)#port secure max-mac-count 1
2950
#conf term (config)#interface fa0/3 (config-if)#switchport port-security (config-if)#switchport mode access (config-if)#switchport port-security maxumim 1
VLANS
Show VLAN
>show vlan
Show Port VLAN Membership Information
>show vlan-membership
Show VLAN Interface Information
>show interface vlan 1
Create VLANs
#conf term (config)#vlan 30 name desktops (config)#vlan 25 name servers (config)#vlan 20 name printers
OR
#vlan database (vlan)#vlan 10 name testing (vlan)#vlan 12
Removing VLANs
#conf term (config)#no vlan 30 (config)#no vlan 25 name servers (config)#no vlan 20 printers
OR
#vlan database (vlan)#no vlan 10 (vlan)#no vlan 12
Delete the VLAN information from Flash or NVRAM, and reload the switch
# delete flash:vlan.dat <confirm> # reload <confirm>
Assigning a VLAN to a Single Port 1900
#conf term (config)#interface fa0/0 (config-if)#vlan-membership static 30
2950
#conf term (config)#interface fa0/0 (config-if)#switchport mode access (config-if)#switchport access vlan 40
Removing a Single Port VLAN Assignment (Defaults Back to VLAN 1) 1900
#conf term (config)#interface fa0/0 (config-if)#no vlan-membership static 30
Assign a VLAN to a Range of Ports 1900
#conf term (config)#interface range fast 0/2 – 5 (config-if)#switchport access vlan 30
Assign an IP to a VLAN 1900
#conf term (config)#interface vlan 1 (config-if)#ip address 10.0.1.1 255.255.255.0
VTP (Virtual Trunking Protocol)
Show VTP Status
>show vtp status
Show Trunk Information (1900)
>show trunk a>show trunk b
Set the VTP Domain
#conf term (config)#vtp domain mydomain #vlan database (config)#vtp domain mydomain
Set Switch as a VTP Server
#vlan database (vlan)#vtp server (vlan)#vtp domain mydomain (vlan)#vtp password mypass1
Set Switch as a VTP Client
#vlan database (vlan)#vtp client (vlan)#vtp domain mydomain (vlan)#vtp password mypass1
Trunk Link Create a Trunk Link that will Carry the VLAN Configurations
SW1#conf term SW1(config)#interface fast 0/24 SW1(config-if)#switchport mode trunk SW2#conf term SW2(config)#interface fast 0/24 SW2(config-if)#switchport mode trunk
Dynamic Trunk Link Create a Dynamic Trunk Link that will Carry the VLAN Configurations
SW1#conf term SW1(config)#interface fast 0/24 SW1(config-if)#switchport mode dynamic desirable SW2#conf term SW2(config)#interface fast 0/24 SW2(config-if)#switchport mode dynamic desirable
networking/cisco/switch_command_reference.txt · Last modified: 2016/03/03 18:45 by rplecko
