[CCNA] Cisco Commands Cheat Sheet #1

In this serie of 4-5 posts, we’ll try to create a simple Cisco Commands Cheat Sheet as a reference for CCNA students.

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
  • Router(config-subif)#: subinterface mode = Commands that affect subinterfaces
  • Router(config-line)#: line mode = Commands that affect in lines modes (console, vty, aux…)
  • Router(config-router)#: router configuration mode

Changing switch hostname:

Switch(config)# hostname SW1

Configuring passwords:

SW1(config)# enable secret cisco    ! MD5 hash
SW1(config)# enable password notcisco    ! Clear text

Securing console port:

SW1(config)# line con 0
SW1(config-line)# password cisco
SW1(config-line)# login

Securing terminal lines:

SW1(config)# line vty 0 4
SW1(config-line)# password cisco
SW1(config-line)# login

Encrypting passwords:

SW1(config)# service password-encryption

Configuring banners:

SW1(config)# banner motd $
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
UNAUTHORIZED ACCESS IS PROHIBITED
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
$

Giving the switch an IP address:

SW1(config)# interface vlan 1
SW1(config-if)# ip address 172.16.1.11 255.255.255.0    ! or DHCP
SW1(config-if)# no shutdown

Setting the default gateway:

SW1(config)# ip default-gateway 172.16.1.1

Saving configuration:

SW1# copy running-config startup-config
Destination filename [startup-config]?    ! Press enter to confirm file name.
Building configuration…
[OK]

! Short for write memory.
SW1# wr
Building configuration…
[OK]

Working environment:

name lookup, history, exec-timeout and logging behavior…, also valid for line con 0.

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

Configuring switch to use SSH:

  • Configure DNS domain name:
SW1(config)# ip domain-name example.com
  • Configure a username and password:
SW1(config)# username admin password cisco
  • Generate encryption keys:

The size of the key modulus in the range of 360 to 2048

SW1(config)# crypto key generate rsa
How many bits in the modulus [512]: 1024
  • Define SSH version to use:
SW1(config)# ip ssh version 2
  • Enable vty lines to use SSH:
SW1(config)# line vty 0 4
SW1(config-line)# login local
! You can set vty lines to use only telnet or only ssh or both as in the example.
SW1(config-line)# transport input telnet ssh

Aliases:

Used to create shortcuts for long commands.

SW1(config)# alias exec c configure terminal
SW1(config)# alias exec s show ip interface brief
SW1(config)# alias exec sr show running-config

Description, speed and duplex:

SW1(config)# interface fastEthernet 0/1
SW1(config-if)# description LINK TO INTERNET ROUTER
SW1(config-if)# speed 100    ! Options: 10, 100, auto
! The range keyword used to set a group of interfaces at once.
SW1(config)# interface range fastEthernet 0/5 – 10
SW1(config-if-range)# duplex full (options: half, full, auto)

Verify Basic Configuration:

  • Shows information about the switch and its interfaces, RAM, NVRAM, flash, IOS, etc.
SW1# show version
  • Shows the current configuration file stored in DRAM.
SW1# show running-config
  • Shows the configuration file stored in NVRAM which is used at first boot process.
SW1# show startup-config
  • Lists the commands currently held in the history buffer.
SW1# show history
  • Shows an overview of all interfaces, their physical status, protocol status and ip address if assigned.
SW1# show ip interface brief
  • Shows detailed information about the specified interface, its status, protocol, duplex, speed, encapsulation, last 5 min traffic.
SW1# show interface vlan 1
  • Shows the description of all interfaces
SW1# show interfaces description
  • Shows the status of all interfaces like connected or not, speed, duplex, trunk or access vlan.
SW1# show interfaces status
  • Shows the public encryption key used for SSH.
SW1# show crypto key mypubkey rsa
  • Shows information about the leased IP address (when an interface is configured to get IP address via a dhcp server)
SW1# show dhcp lease

Enjoy !

Advertisements

Tagged: , ,

17 thoughts on “[CCNA] Cisco Commands Cheat Sheet #1

  1. […] Cisco Commands Cheat Sheet #1 […]

  2. […] Cisco Commands Cheat Sheet #1 […]

  3. […] Cisco Commands Cheat Sheet #1 […]

  4. […] Cisco Commands Cheat Sheet #1 […]

  5. […] Cisco Commands Cheat Sheet #1 […]

  6. […] Cisco Commands Cheat Sheet #1 […]

  7. heanre January 6, 2014 at 9:49 pm Reply

    thank you so much for these cheat sheets…i have been looking for cisco tutorials since it’s not properly discussed and i don’t love to waste one semester… 🙂

  8. SweetLifeOfaPlayer January 30, 2014 at 8:33 pm Reply

    Thank you for this… It is so useful 🙂 I am doing this on my college course at the moment and it is great to have all the commands in one place 🙂

    • farman April 8, 2014 at 4:46 pm Reply

      Which course are you in ..

      • SweetLifeOfaPlayer April 9, 2014 at 3:48 pm

        Computer networks and systems managemant 🙂

  9. Ray March 18, 2014 at 10:09 pm Reply

    Yes, I appreciate your posting with the commands. I am taking CCNA currently and Cisco’s online environment does not do a good job of relating a lot of this info. in a meaningful fashion.

  10. Aboubacar sidiq Diallo August 7, 2014 at 1:32 am Reply

    this command are really helpful thanks for the restless job

Leave a Reply :

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: