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 18:50] 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 =====
 +
 +<code>
 +%SYS-6-STARTUP_CONFIG_IGNORED: System startup configuration is ignored based on the configuration register setting.
 +</code>
 +
 +<code>
 +sh version
 +...
 +Configuration register is 0x141
 +</code>
 +
 +[[https://www.cisco.com/c/en/us/support/docs/routers/10000-series-routers/50421-config-register-use.html]]
 +
 +<code>
 +enable
 +dir
 +conf term
 +boot system flash bootflash:cat4500-ipbasek9-mz.122-54.SG1.bin
 +exit
 +wr
 +copy run star
 +
 +config-register 0x102
 +
 +reload
 +</code>
 +
  
 ===== Console baud rate ===== ===== Console baud rate =====
Line 16: Line 66:
  
 ===== LLDP ===== ===== LLDP =====
 +Link Layer Discovery Protocol
 +
 <code> <code>
 enable enable
Line 40: Line 92:
 </code> </code>
  
-===== VLAN ===== 
- 
-<code> 
-enable 
-show vlan 
-configure terminal 
- 
-! delete vlan 7 
-no vlan 7 
- 
-! add tagged vlan 28 
-vlan 28 
-name admin 
-end 
- 
-show vlan 
- 
-configure terminal 
-vlan 28 
-interface range Gi0/1-28 
-switchport trunk encapsulation dot1q 
-switchport trunk native vlan 1 
-switchport trunk allowed vlan add 28,255 
-no shut 
-end 
-</code> 
- 
-<code> 
-configure terminal 
-interface range Gi0/1-28 
-! to remove all ports from VLAN: 
-no switchport access vlan 
-end 
-</code> 
- 
-==== VLAN IP address ==== 
- 
-<code> 
-enable 
-configure terminal 
-interface vlan 1 
-no ip address DHCP 
-no ip address 
-exit 
- 
-int vlan 28 
-ip address 192.168.28.31 255.255.252.0 
-no shutdown 
-exit 
- 
-ip default-gateway 192.168.28.1 
-ip name-server 192.168.28.1 
-exit 
- 
-show ip redirects 
-show spanning-tree vlan 28 
-sh int vlan 28 
- 
-copy running-config startup-config 
-</code> 
- 
-<code> 
-wr 
-copy running-config startup-config 
-</code> 
  
 ===== reload ===== ===== reload =====
  
 +Reboots switch:
 <code>reload</code> <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 
-copy run star 
- 
-</code> 
- 
-Disable STP: 
-<code> 
-enable 
-config terminal 
-Switch(config)#no spanning-tree vlan 1 
-wr 
-copy run star 
-</code> 
  
  
Line 146: Line 103:
 <code> <code>
 sh mac address-table vlan 1 sh mac address-table vlan 1
 +sh mac address-table vlan 1 | include 50eb\.f62e
 </code> </code>
  
Line 174: Line 132:
 show cable-diagnostics tdr int Gi0/17 show cable-diagnostics tdr int Gi0/17
 </code> </code>
 +
 +===== VTP =====
 +
 +<code>
 +Jul 11 05:50:11.999: %DTP-5-DOMAINMISMATCH: Unable to perform trunk negotiation on port Gi1/1 because of VTP domain mismatch.
 +</code>
 +
 +Disable VTP:
 +<code>
 +enable
 +conf term
 +interface range Gi1/1-48
 +switchport mode access
 +switchport nonegotiate
 +end
 +wr
 +copy run star
 +</code>
 +
 +Set VTP domain
 +<code>
 +conf term
 +vtp domain home
 +vtp mode transparent
 +vtp password home
 +end
 +wr
 +copy run star
 +</code>
 +
 +
 +===== SNMP =====
 +
 +<code>
 +enable
 +switch# configure terminal
 +switch(config)# snmp-server community public RO
 +switch(config)# exit
 +switch# copy running-config startup-config
 +</code>
 +