Cisco CLI Cheat Sheet

 

Cisco Serial Console Settings:
Baudrate: 9600
Data Bits: 8
Parity: None
Stop Bits: 1
Flow Control: None

Enters configuration mode
switch# configure terminal

Configuration mode for the specified interface
switch(config)# interface type slot/port

Disables the interface
switch(config-if)# shutdown

Restarts the interface
switch(config-if)# no shutdown

User Mode:
Router>

Privilege Mode:
Router>enable
Router#

Global Configuration Mode:
config t or configuration terminal
Router#config t
Router(config)#

Administrative commands
> enable
# clock set (hh:mm:ss)
# terminal history size 256
# config t
(config t)# hostname (name-of-the-router)
(config t)# clock timezone ?
(config t)# ntp up
(config t)# ntp update-calendar
(config t)# enable password (password)
(config t)# service password-encryption

A stronger way and stronger encryption of the password:
(config t)# enable secret (password)

# sh ip int brief

STP – Spanning Tree Protocol

Original STP – IEEE 802.1D
Supports redundancy in a layer 2 network
Keeping a loop-free topoloy

Types of STP
CST: Common Spanning-Tree
PVST: Per-VLAN Spanning-Tree
PVST+: Per-VLAN Spanning-Tree Plus
Rapid-PVST: Rapid Spanning-Tree

Command Syntax

# sh spanning-tree
(config)# spanning-tree mode rapid-pvst
(config)# no spanning-tree uplinkfast
(config)# no spanning-tree backbonefast

vlan vtp

Set one switch vtp operating mode as “server” and the other swtiches as “access”
Example: Setup sw0 as server by defining a vtp domain.

sw0 (config)# vtp domain ferdy
sw1 (config)# vtp mode client
sw2 (config)# vtp mode client

sw0# sh vlan
sw0# config t
sw0 (config)# vlan 10
sw0 (config-vlan)# name HR
sw0 (config-vlan)# vlan 20
sw0 (config-vlan)# name ACCT
sw0 (config-vlan)# do wr

sw0 (config)# vtp domain ferdy
sw0 (config)# do sh vtp status

sw0 (config)# int range f0/22-24
sw0 (config-if-range)# switchport mode trunk
sw0 (config-if-range)# do wr

sw0# sh int trunk

Set other switch switchport mode to access, example sw1.

sw1 (config)# vtp mode client
sw1 (config)# int range f0/1-15
sw1 (config-if-range)# switchport mode access
sw1 (config-if-range)# switchport access vlan 10
sw1 (config-if-range)# do wr