User Tools

Site Tools


networking:cisco:switch_command_reference

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

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