- 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:
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.
configure terminal
:hostname
:- Usage: Sets the device's hostname.
- Example:
Router(config)# hostname MyRouter
- Explanation: Changes the name of the device for easier identification.
Interface Configuration:
interface
:- Usage: Enters interface configuration mode.
- Example:
Router(config)# interface GigabitEthernet0/0
- Explanation: Used to configure settings for a specific interface.
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.
no shutdown
:- Usage: Enables an interface.
- Example:
Router(config-if)# no shutdown
- Explanation: Activates the interface, making it operational.
Routing and Switching:
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.
ip default-gateway
:vlan
: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.
switchport access vlan
:
Troubleshooting:
ping
:- Usage: Tests connectivity to another device.
- Example:
Router# ping 192.168.1.1
- Explanation: Sends ICMP echo requests to verify network connectivity.
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.
show interfaces
:- Usage: Displays detailed information about interfaces.
- Example:
Router# show interfaces
- Explanation: Provides status and statistics for all interfaces.
show running-config
:- Usage: Displays the current configuration.
- Example:
Router# show running-config
- Explanation: Shows the active configuration in RAM.
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.
debug
:- Usage: Provides real-time debugging information.
- Example:
Router# debug ip packet
- Explanation: Used for troubleshooting by displaying detailed information about network operations.
Security:
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.
line vty
:password
:- Usage: Sets a password for access.
- Example:
Router(config-line)# password mypassword
- Explanation: Configures a password for accessing the device.
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:
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.
reload
: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.
access-list Cisco commands configure terminal copy running-config startup-config debug enable hostname interface ip address ip default-gateway line vty network configuration network engineer no shutdown password ping reload router Security service password-encryption show interfaces show ip route show running-config show startup-config show version switch switchport access vlan switchport mode traceroute Troubleshooting vlan