CCNA Cheat Sheet
CCNA Cheat Sheet
CCNA Cheat Sheet
Sheet #1
Router Modes:
Router>: User mode = Limited to basic monitoring commands
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-if)#: interface mode = Commands that affect interfaces
Configuring passwords:
1 SW1(config)# enable secret cisco ! MD5 hash
3 SW1(config-line)# login
3 SW1(config-line)# login
Encrypting passwords:
1 SW1(config)# service password-encryption
Configuring banners:
1 SW1(config)# banner motd $
2
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
3
UNAUTHORIZED ACCESS IS PROHIBITED
4
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
5
$
3 SW1(config-if)# no shutdown
Saving configuration:
1 SW1# copy running-config startup-config
9 [OK]
Working environment:
name lookup, history, exec-timeout and logging behavior, also valid for line con 0.
1 SW1(config)# no ip domain-lookup
2 SW1(config)# line vty 0 4
4 SW1(config-line)# exec-timeout 10 30
3 ! You can set vty lines to use only telnet or only ssh or both as in the
example.
4
SW1(config-line)# transport input telnet ssh
Aliases:
Shows the configuration file stored in NVRAM which is used at first boot process.
SW1# show startup-config
1
Shows an overview of all interfaces, their physical status, protocol status and ip
address if assigned.
SW1# show ip interface brief
1
Shows detailed information about the specified interface, its status, protocol, duplex,
speed, encapsulation, last 5 min traffic.
SW1# show interface vlan 1
1
Shows the status of all interfaces like connected or not, speed, duplex, trunk or
access vlan.
SW1# show interfaces status
1
Enjoy !
The sticky keyword is used to let the interface dynamically learns and configures the MAC
addresses of the currently connected hosts.
The transparent VTP mode is used when an engineer wants to deactivate VTP on a particular
switch
Portfast and BPDU guard are enabled only on interfaces connected to end user hosts
Enjoy !
This section includes IOS commands that are absolutely identical on both routers and
switches, except the part of line aux 0 which is configured only on router because switches
do not have an auxiliary port.
1 Router(config)# hostname R1
13 R1(config-line)# exit
R1(config-line)# login
16
R1(config-line)# logging synchronous
17
R1(config-line)# exec-timeout 30 0
18
R1(config-line)# exit
19
R1(config)# banner motd $
20
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
21
UNAUTHORIZED ACCESS IS PROHIBITED
22
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
23 $
24 R1(config)# alias exec c configure terminal
25 R1(config)# alias exec s show ip interface brief
27 R1(config)# no ip domain-lookup
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
R1(config)# interface fastEthernet 0/0
2 R1(config-if)# description LINK TO LOCAL LAN THROUGH SW1
3 R1(config-if)# ip address 172.16.1.1 255.255.255.0
4 R1(config-if)# no shutdown
5 R1(config-if)# exit
Static route:
Using next hop:
R1(config)# ip route 10.1.2.0 255.255.255.0 10.1.128.1
1
Default Route:
1 R1(config)# ip route 0.0.0.0 0.0.0.0 199.1.1.1
RIPv2 Configuration:
1 R1(config)# router rip
2 R1(config-router)# version 2
4 R1(config-router)# no auto-summary
RIPv2 Verification:
Shows information about the running routing protocol process:
R1# show ip protocols
1
OSPF Configuration:
Enter OSPF router configuration mode:
R1(config)# router ospf 10 ! 10 = process ID
1
Configure one or more network commands to identify which interfaces will run OSPF:
1 R1(config-router)# network 10.0.0.0 0.255.255.255 area 0
2 R1(config-router)# network 172.16.8.0 0.0.7.255 area 0
3 R1(config-router)# network 192.168.1.254 0.0.0.0 area 1
Impact routing choices by tuning interface cost using one of the following ways
(Optional):
Changing the reference bandwidth that used by OSPF to calculate the cost:
1 R1(config-router)# auto-cost reference-bandwidth 1000 ! in Mbps
OSPF verification:
Shows information about the running routing protocol process:
R1# show ip protocols
1
Shows all neighboring routers along with their respective adjacency state:
R1# show ip ospf neighbors
1
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
1 R1(config-keychain)# key 1
1 R1(config-keychain-key)# key-string1stKEY
EIGRP Verification:
Shows routes learned via EIGRP only:
R1# show ip route eigrp
1
Lists statistics on numbers of EIGRP messages sent and received by the router:
R1# show ip eigrp traffic
1
Enjoy !
Enable the ACL on the chosen router interface in the correct direction (in or out):
R1(config-if)# ip access-group 2 out
1
2 R1(config-line)# access-class 99 in
Extended ACL matches packets based on source & des.IP addresses, protocol, source
& des. Port numbers andother criteria as well
1 R1(config)# access-list 101 remark MY_ACCESS_LIST
2 R1(config)# access-list 101 deny iphost 10.1.1.1 host 10.2.2.2
3 R1(config)# access-list 101 deny tcp 10.1.1.0 0.0.0.255 any eq 23
4 R1(config)# access-list 101 deny icmp 10.1.1.1 0.0.0.0 any
5 R1(config)# access-list 101 deny tcphost 10.1.1.0 host 10.0.0.1 eq 80
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.
Named standard ACL:
1 R1(config)# ip access-list standard MY_STANDARD_ACL
2
R1(config-std-nacl)# permit 10.1.1.0 0.0.0.255
3 R1(config-std-nacl)# deny 10.2.2.2
4 R1(config-std-nacl)# permit any
5 R1(config)# interface fastEthernet 0/1
DHCP Server
Define a DHCP pool and give it a name:
R1(config)# ip dhcp pool MY_POOL
1
Define network and mask to use in this pool and the default gateway:
1 R1(dhcp-config)# network 192.168.1.0 255.255.255.0
2 R1(dhcp-config)# default-router 192.168.1.1
Shows all the leased ip addresses from all configured DHCP pools:
R1# show ip dhcp binding
1
Enjoy !
Cisco Commands Cheat Sheet # 5
PPP Configuration:
1 R1(config)# interface serial 0/0
PPP Authentication:
CHAP:
Configure the hostname:
R1(config)# hostname ALPHA
1
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
1 routers
2
ALPHA(config)# username BETA password XYZ
PAP:
Configure the hostname:
R1(config)# hostname ALPHA
1
Configure the name of the other end router and the shared password:
ALPHA(config)# username BETA password XYZ
1
Enable PAP authentication on the interface and define the username and password to
be sent by PAP:
1 ALPHA(config)# interface serial 0/0
2 ALPHA(config-if)# ppp authentication pap
3 ALPHA(config-if)# ppp pap sent-username ALPHA password XYZ
Frame Relay:
Lists messages about certain Frame Relay events, including Inverse ARP messaeges:
R1# debug frame-relay events
1
Dynamic NAT:
Define the outside and inside interfaces
3 <ul>
4 <li>The same as dynamic NAT with the use of the overload keyword at the end of NAT
statement:</li>
5
</ul>
6
<pre>
7
8 R1(config)# ip nat inside source list 3 pool PUB overload
NAT verification and troubleshoot:
Useful in viewing the configuration of NAT pool and the inside and outside interfaces:
R1# show running-config
1
Shows counters for packets and NAT table entries, as well as basic configuration
information:
R1# show ip nat stasitics
1
Issues a log message describing each packet whose ip address is translated with NAT:
R1# debug ip nat
1
Enjoy !