
Mode Navigation
R> enable
//enters the Privileged EXEC mode
R# configure terminal
//enters the global config mode
R(config)# interface
<type>/<number>
//enters the interface type/number
config mode
Example: interface fa0/1
Tips and Tricks
?
//displays all the possible commands
in the current mode
<tab>
//autocompletes the rest of the
command
do <command>
//executes the command in the
Privileged Exec mode, regardless of the
current shell mode
<shortcut>
//you can execute a command by
typing just the first letters of it and press
enter
<click Fast Forward Time>
//increases the time of booting the
devices
exit
//exits the current mode
end
//exits the current mode and enters the
Privileged EXEC mode
<CTRL+SHIFT+6>
//interrupts the execution of the
current command
no <command>
//cancels the command/ deletes the
configuration of that command
Example: en
conf t
int fa0/0
Show commands
show running-config
//view the router’s/switch’s entire
active configuration
show ip interface brief
//view the available interfaces and their
brief parameters (IP, active, etc.)
show ip route
//view the routing table
show mac-address-table
//view the CAM table
show spanning-tree
//view spanning-tree (STP) parameters
show VLAN brief
//view VLAN parameters
show interface VLAN brief
//view VLAN’s brief parameters on
interfaces
Basic commands
#ADD IPs (on router’s interfaces)
R(config)# interface
<type>/<number>
//enters the interface config mode
R(config-if)# ip address <IP>
<decimal-MASK>
//sets the IP and the mask to the
interface
R(config-if)# no shutdown
//enables the interfaces (brings it up)
Example: int fa0/3
ip add 10.10.10.1 255.255.255.248
no shut
Spanning Tree Protocol
spanning-tree vlan <vlan-number>
priority <value>
//sets the priority <value> of the switch
for the STP by vlan
VLAN Configuration
(only on Switch)
#MODE ACCESS (interfaces connected
to end-devices)
vlan <vlan-number>
//creates the VLAN
interface <type>/<number>
//enters the interface that needs to be
configured
switchport mode access
//sets the access mode
switchport access vlan <vlan-
number>
//sets the access vlan
Example: vlan 10
int fa0/2
sw mo acc
sw acc vlan 10
#MODE TRUNK (interfaces connected
to other switches or routers)
interface <type>/<number>
enters the interface that needs to be
configured
switchport mode trunk
sets the trunk mode
swithcport trunk allowed vlan
<vlan-number>/all
sets the vlans that are allowed on that
link (some vlans or a range or vlans or
all vlans)
Example: vlan 10
int fa0/1
sw mo tr
sw tr allowed vlan 10
or
sw tr allowed vlan all
or
sw tr allowed vlan range 10-20
#MANAGEMENT VLAN (configuration
on switch)
interface vlan <vlan-number>
//enters the VLAN interface
ip address <IP> <MASK>
//assigns the IP address and mask
PC> telnet <IP>
//connects to the switch’s IP
Example: int vlan 99
ip add 10.10.10.99 255.255.255.0
PC> telnet 10.10.10.99
CAM Table
mac-address-table static <MAC
address> vlan <vlan-number>
interface <type>/<number>
//the MAC address will be stored as
static in the CAM table
clear mac-address-table
//flush the contents of the CAM table
Example: en
conf t
mac-address-tabel static
0001.6458.8b1a vlan 10 int fa0/1
Routing Configuration
ip route <destination network>
<destination network’s mask>
<next-hop>
//sets the route to the destination
network through the next-hop
Example: en
conf t
ip route 10.10.10.0 255.255.255.0
192.168.0.1
ip route 0.0.0.0 0.0.0.0 <next-
hop>
//sets the default route: all the packets
with unknown destinations will be sent
through that next-hop
Subnetting 101
192.168.0.0/22
R1R2 – one network – 2H
VLAN10 – one network – 126H
VLAN20 – one network – 29H
R2C – one network – 200H
• add default gateway and extra 2
• write them in descending order
• find closest power of 2
o 200+1+2 <= 28
o 126+1+2 <= 28
o 29+1+2 <= 25
o 2+2 <= 22
• the power of 2 represents the
mask
o 32-power -> /mask
Example:
o power is 6
o then mask is /26
• R2C
o 192.168.0.0/24 ->
192.168.0.255/24
• VLAN10
o 192.168.1.0/24 ->
192.168.1.255/24
• VLAN20
o 192.168.2.0/27 ->
192.168.2.31/27
• R1R2
o 192.168.2.32/30 ->
192.168.2.35/30
Cheatsheet Packet Tracer/Cisco
IOS