Cisco Commands Cheat Sheet
Cisco Commands Cheat Sheet
Cisco Commands Cheat Sheet
Router Modes:
Router#: Privileged mode (exec-level mode) = Provides access to all other router commands
Router(config)#: global configuration mode = Commands that affect the entire system
Router(config-line)#: line mode = Commands that affect in lines modes (console, vty, aux)
Configuring passwords:
1
2
Encrypting passwords:
1
Configuring banners:
1
2
3
4
5
! or DHCP
Saving configuration:
1
2
3
4
5
6
7
8
9
Working environment:
name lookup, history, exec-timeout and logging behavior, also valid for line con 0.
1
2
3
4
5
SW1(config)# no ip domain-lookup
SW1(config)# line vty 0 4
SW1(config-line)# history size 15
SW1(config-line)# exec-timeout 10 30
SW1(config-line)# logging synchronous
1
2
1
2
3
4
Aliases:
Used to create shortcuts for long commands.
1
2
3
Shows information about the switch and its interfaces, RAM, NVRAM, flash, IOS, etc.
SW1# show version
Shows the configuration file stored in NVRAM which is used at first boot process.
SW1# show startup-config
assigned.
SW1# show ip interface brief
Shows an overview of all interfaces, their physical status, protocol status and ip address if
Shows detailed information about the specified interface, its status, protocol, duplex, speed,
Shows the status of all interfaces like connected or not, speed, duplex, trunk or access vlan.
SW1# show interfaces status
Shows information about the leased IP address (when an interface is configured to get IP
The sticky keyword is used to let the interface dynamically learns and configures the MAC addresses of
the currently connected hosts.
SW1(config-if)# switchport port-security mac-address 68b5.9965.1195
Configuring VLANs:
SW1(config)# vlan 10
SW1(config-vlan)# name SALES
Configuring Trunks:
SW1(config)# interface fastEthernet 0/1
SW1(config-if)# switchport mode trunk
SW1(config-if)# shutdown
SW1(config-if)# nonegotiate
Configuring VTP:
The transparent VTP mode is used when an engineer wants to deactivate VTP on a particular switch
SW1(config)# vtp mode server
! case-sensitive
! case-sensitive
Lists all the trunk ports on a switch including the trunk allowed VLANs:
Lists VTP configuration (mode, domain-name, version, etc) and revision number:
STP optimization:
Portfast and BPDU guard are enabled only on interfaces connected to end user hosts
SW1(config-if)# spanning-tree portfast
SW1(config-if)# spanning-tree bpduguard enable
Shows information about the directly connected cisco devices including interfaces names
capabilities:
Shows detailed information about the neighboring cisco devices including device address and
version of IOS they run:
1
2
3
Router(config)# hostname R1
R1(config)# enable secret cisco
R1(config)# line con 0
R1(config-line)# password cisco
4
5
6
7
R1(config-line)# login
R1(config-line)# logging synchronous
R1(config-line)# exec-timeout 30 0
R1(config-line)# exit
10
11
R1(config-line)# login
R1(config-line)# logging synchronous
R1(config-line)# exec-timeout 30 0
12
R1(config-line)# exit
13
14
15
R1(config-line)# login
16
17
R1(config-line)# exec-timeout 30 0
18
R1(config-line)# exit
19
20
21
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
22
23
$
R1(config)# alias exec c configure terminal
24
25
26
R1(config)# no ip domain-lookup
27
28
29
30
31
R1(config)# ip ssh version 2
32
33
34
35
36
37
38
Configuring router interfaces:
Clock rate is set only on the DCE side, typically the ISP side. On your router which is DTE you dont need
to set clocking.
1
2
R1(config-if)# no shutdown
R1(config-if)# exit
8
9
10
Configuring Router-On-Stick for vlan routing:
1
R1(config)# interface fastEthernet 0/0
2
R1(config-if)# no shutdown
Static route:
1
Default Route:
R1(config)# ip route 0.0.0.0 0.0.0.0 199.1.1.1
1
RIPv2 Configuration:
1
R1(config)# router rip
2
R1(config-router)# version 2
R1(config-router)# no auto-summary
RIPv2 Verification:
1
Shows detailed information about the route to the specified destination network:
OSPF Configuration:
1
Configure one or more network commands to identify which interfaces will run OSPF:
Impact routing choices by tuning interface cost using one of the following ways (Optional):
! in Kbps
Changing the reference bandwidth that used by OSPF to calculate the cost:
OSPF verification:
1
Shows all neighboring routers along with their respective adjacency state:
R1# show ip ospf neighbors
! in Mbps
EIGRP Configuration:
1
Configure one or more network commands to enable EIGRP on the specified interfaces:
R1(config-router)# maximum-paths 6
R1(config-router)# variance 4
! in Kbps)
! tens of microseconds
EIGRP Authentication:
The key-string value and the mode must be the same on both routers. Lifetime options of the keys
requires the clock of the routers to be set correctly, better use NTP, or it can cause problems
R1(config-keychain)# key 1
R1(config-keychain-key)# key-string1stKEY
EIGRP Verification:
1
Lists statistics on numbers of EIGRP messages sent and received by the router:
R1# show ip eigrp traffic
Enable the ACL on the chosen router interface in the correct direction (in or out):
R1(config-if)# ip access-group 2 out
R1(config-line)# access-class 99 in
Extended ACL should be placed as close as possible to the source of the packet.
Extended ACL matches packets based on source & des.IP addresses, protocol, source & des. Port
numbers andother criteria as well
1
2
7
8
Named ACL:
Named ACLs use names to identify ACLs rather than numbers, and commands that permit or
deny traffic are written in a sub mode called named ACL mode (nacl).
Named ACL enables the editing of the ACL (deleting or inserting statements) by sequencing
statements of the ACL.
1
2
3
4
5
R1(config-ext-nacl)# no 20
number 20
Verifying ACLs:
Shows all ACLs configured on a router with counters at the end of each statement:
! OR
DHCP Server
1
Define network and mask to use in this pool and the default gateway:
Shows the status of the specified pool and the leased addresses from that pool:
R1# show ip dhcp pool POOL_1
Shows all the leased ip addresses from all configured DHCP pools:
R1# show ip dhcp binding
PPP Authentication:
CHAP:
1
1
2
Configure the name of the other end router and the shared password:
! The password used is shared password, that means it must be the same on both
routers
ALPHA(config)# username BETA password XYZ
PAP:
1
Configure the name of the other end router and the shared password:
ALPHA(config)# username BETA password XYZ
Enable PAP authentication on the interface and define the username and password to be sent by
PAP:
Useful for viewing the configuration of usernames and passwords used to authenticate PPP:
R1# show running-config
Frame Relay:
4
5
6
7
8
10
11
12
1
2
3
R1(config-subif)# frame-relay interface-dlci 102
4
5
10
11
12
13
R3(config)# interface serial 0/0.301 point-to-point
14
15
16
Frame Relay Verification and troubleshoot:
1
Lists messages about certain Frame Relay events, including Inverse ARP messaeges:
R1# debug frame-relay events
Static NAT:
Dynamic NAT:
<ul>
<li>The same as dynamic NAT with the use of the overload keyword at the end of NAT
statement:</li>
</ul>
<pre>
7
8
Useful in viewing the configuration of NAT pool and the inside and outside interfaces:
R1# show running-config
Shows counters for packets and NAT table entries, as well as basic configuration information:
R1# show ip nat stasitics
Issues a log message describing each packet whose ip address is translated with NAT:
R1# debug ip nat