All Cisco Commands Cheat Sheet

All Cisco Commands Cheat Sheet

Download
Download is available until [expire_date]
  • Version
  • Download 974
  • File Size 1.07 MB
  • File Count 1
  • Create Date June 27, 2023
  • Last Updated December 10, 2024

Here’s a comprehensive guide to the most popular Cisco router and switch commands for network engineers:

Basic Commands:

  1. enable:
    • Usage: Enters privileged EXEC mode.
    • Example: Router> enable
    • Explanation: This command is used to access the privileged mode where you can execute more advanced commands.
  2. configure terminal:
    • Usage: Enters global configuration mode.
    • Example: Router# configure terminal
    • Explanation: Allows you to make configuration changes to the router or switch.
  3. hostname:
    • Usage: Sets the device's hostname.
    • Example: Router(config)# hostname MyRouter
    • Explanation: Changes the name of the device for easier identification.

Interface Configuration:

  1. interface:
    • Usage: Enters interface configuration mode.
    • Example: Router(config)# interface GigabitEthernet0/0
    • Explanation: Used to configure settings for a specific interface.
  2. ip address:
    • Usage: Assigns an IP address to an interface.
    • Example: Router(config-if)# ip address 192.168.1.1 255.255.255.0
    • Explanation: Sets the IP address and subnet mask for an interface.
  3. no shutdown:
    • Usage: Enables an interface.
    • Example: Router(config-if)# no shutdown
    • Explanation: Activates the interface, making it operational.

Routing and Switching:

  1. show ip route:
    • Usage: Displays the routing table.
    • Example: Router# show ip route
    • Explanation: Shows the routes known to the router and how packets will be forwarded.
  2. ip default-gateway:
    • Usage: Sets the default gateway for a switch.
    • Example: Switch(config)# ip default-gateway 192.168.1.1
    • Explanation: Configures the default gateway for Layer 2 switches.
  3. vlan:
    • Usage: Configures VLANs on a switch.
    • Example: Switch(config)# vlan 10
    • Explanation: Creates or modifies a VLAN.
  4. switchport mode:
    • Usage: Configures the mode of a switch port.
    • Example: Switch(config-if)# switchport mode access
    • Explanation: Sets the port to access mode, which is used for end devices.
  5. switchport access vlan:
    • Usage: Assigns a VLAN to an access port.
    • Example: Switch(config-if)# switchport access vlan 10
    • Explanation: Associates the port with a specific VLAN.

Troubleshooting:

  1. ping:
    • Usage: Tests connectivity to another device.
    • Example: Router# ping 192.168.1.1
    • Explanation: Sends ICMP echo requests to verify network connectivity.
  2. traceroute:
    • Usage: Traces the path packets take to a destination.
    • Example: Router# traceroute 192.168.1.1
    • Explanation: Helps identify the path and any points of failure along the route.
  3. show interfaces:
    • Usage: Displays detailed information about interfaces.
    • Example: Router# show interfaces
    • Explanation: Provides status and statistics for all interfaces.
  4. show running-config:
    • Usage: Displays the current configuration.
    • Example: Router# show running-config
    • Explanation: Shows the active configuration in RAM.
  5. show startup-config:
    • Usage: Displays the configuration stored in NVRAM.
    • Example: Router# show startup-config
    • Explanation: Shows the configuration that will be used on the next reboot.
  6. debug:
    • Usage: Provides real-time debugging information.
    • Example: Router# debug ip packet
    • Explanation: Used for troubleshooting by displaying detailed information about network operations.

Security:

  1. access-list:
    • Usage: Configures access control lists (ACLs).
    • Example: Router(config)# access-list 10 permit 192.168.1.0 0.0.0.255
    • Explanation: Defines rules for permitting or denying traffic.
  2. line vty:
    • Usage: Configures virtual terminal lines for remote access.
    • Example: Router(config)# line vty 0 4
    • Explanation: Sets up parameters for Telnet or SSH access.
  3. password:
    • Usage: Sets a password for access.
    • Example: Router(config-line)# password mypassword
    • Explanation: Configures a password for accessing the device.
  4. service password-encryption:
    • Usage: Encrypts passwords in the configuration file.
    • Example: Router(config)# service password-encryption
    • Explanation: Enhances security by encrypting passwords.

Additional Useful Commands:

  1. copy running-config startup-config:
    • Usage: Saves the current configuration to NVRAM.
    • Example: Router# copy running-config startup-config
    • Explanation: Ensures that the current configuration is preserved across reboots.
  2. reload:
    • Usage: Reboots the device.
    • Example: Router# reload
    • Explanation: Restarts the router or switch, applying any saved configurations.
  3. show version:
    • Usage: Displays software and hardware information.
    • Example: Router# show version
    • Explanation: Provides details about the device's IOS version, uptime, and hardware specifications.

These commands are fundamental for managing and troubleshooting Cisco routers and switches, ensuring network stability and performance. Mastery of these commands is essential for network engineers to effectively configure, monitor, and secure network devices.

Spread the word:

Leave a Reply