meta data for this page
  •  

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
network:switches:cisco:cli [2024/06/26 19:29] niziaknetwork:switches:cisco:cli [2024/08/19 12:43] (current) niziak
Line 1: Line 1:
 ====== CLI ====== ====== CLI ======
 +
 +===== info =====
 +
 +<code bash>
 +sh ver
 +</code>
 +===== passwords =====
 +
 +<code>
 +conf term
 +username admin privilege 15 secret password123
 +enable secret 0 <pass>
 +! for telnet:
 +line vty 0 4
 +login
 +password <pass>
 +end
 +wr
 +copy run start
 +</code>
 +
  
 ===== STARTUP_CONFIG_IGNORED ===== ===== STARTUP_CONFIG_IGNORED =====
Line 45: Line 66:
  
 ===== LLDP ===== ===== LLDP =====
 +Link Layer Discovery Protocol
 +
 <code> <code>
 enable enable
Line 69: Line 92:
 </code> </code>
  
-===== VLAN ===== 
  
-<code> +===== reload =====
-enable +
-show vlan +
-configure terminal+
  
-! delete vlan 7 +Reboots switch: 
-no vlan 7+<code>reload</code>
  
-! add tagged vlan 28 
-vlan 28 
-name admin 
-end 
  
-show vlan+===== Find MAC on ports =====
  
-configure terminal +<code> 
-interface range Gi0/1-28 +sh mac address-table vlan 1 
-switchport trunk encapsulation dot1q +sh mac address-table vlan 1 | include 50eb\.f62e
-switchport trunk native vlan 1 +
-switchport trunk allowed vlan add 28,255 +
-no shut +
-end+
 </code> </code>
  
 <code> <code>
-configure terminal +show interface Gi0/40 
-interface range Gi0/1-28 +show controllers
-! to remove all ports from VLAN: +
-no switchport access vlan +
-end+
 </code> </code>
  
-==== VLAN IP address ==== 
  
-<code>+===== show port counters ===== 
 + 
 +<code cli> 
 +show interface counters 
 enable enable
-configure terminal +clear counters 
-interface vlan 1 +</code>
-no ip address DHCP +
-no ip address +
-exit+
  
-int vlan 28 +===== diagnose port =====
-ip address 192.168.28.31 255.255.252.0 +
-no shutdown +
-exit+
  
-ip default-gateway 192.168.28.1 +<code cli>show interface Gi0/17</code>
-ip name-server 192.168.28.1 +
-exit+
  
-show ip redirects +Using Time Domain Reflectometer
-show spanning-tree vlan 28 +
-sh int vlan 28+
  
-copy running-config startup-config+<code cli> 
 +enable 
 +test cable-diagnostics tdr int Gi0/17 
 +show cable-diagnostics tdr int Gi0/17
 </code> </code>
 +
 +===== VTP =====
  
 <code> <code>
-wr +Jul 11 05:50:11.999: %DTP-5-DOMAINMISMATCH: Unable to perform trunk negotiation on port Gi1/1 because of VTP domain mismatch.
-copy running-config startup-config+
 </code> </code>
  
-==== put port in on VLAN ==== +Disable VTP:
 <code> <code>
 +enable
 conf term conf term
-interface Gi1/48 +interface range Gi1/1-48 
-switchport access vlan 28+switchport mode access 
 +switchport nonegotiate
 end end
-wr 
-</code> 
- 
- 
-===== reload ===== 
- 
-<code>reload</code> 
- 
-===== RSTP ===== 
- 
-<code> 
-show spanning-tree summary 
-enable 
-config 
-spanning-tree mode ? 
-spanning-tree mode rapid-pvst 
- 
-spanning-tree vlan 1 priority 57344 
-spanning-tree vlan 2 priority 57344 
-spanning-tree vlan 28 priority 57344 
-spanning-tree vlan 255 priority 57344 
-exit 
- 
-show spanning-tree bridge 
- 
 wr wr
 copy run star copy run star
- 
 </code> </code>
  
-Disable STP:+Set VTP domain
 <code> <code>
-enable +conf term 
-config terminal +vtp domain home 
-Switch(config)#no spanning-tree vlan 1+vtp mode transparent 
 +vtp password home 
 +end
 wr wr
 copy run star copy run star
Line 181: Line 163:
  
  
-===== Find MAC on ports =====+===== SNMP =====
  
 <code> <code>
-sh mac address-table vlan 1 
-</code> 
- 
-<code> 
-show interface Gi0/40 
-show controllers 
-</code> 
- 
- 
-===== show port counters ===== 
- 
-<code cli> 
-show interface counters 
- 
 enable enable
-clear counters+switch# configure terminal 
 +switch(config)# snmp-server community public RO 
 +switch(config)# exit 
 +switch# copy running-config startup-config
 </code> </code>
  
-===== diagnose port ===== 
- 
-<code cli>show interface Gi0/17</code> 
- 
-Using Time Domain Reflectometer 
- 
-<code cli> 
-enable 
-test cable-diagnostics tdr int Gi0/17 
-show cable-diagnostics tdr int Gi0/17 
-</code>