CCNA | Intro to the CLI | 4
Introduction to Cisco IOS CLI
Cisco IOS: Operating system for Cisco devices (routers, switches, firewalls).
Different from Apple's iOS.
CLI: Command Line Interface used for configuring devices.
GUI: Graphical User Interface, not covered in this course.
Connecting to a Cisco Device
Connect via console port:
Bring laptop to device.
Use either RJ45 port or USB Mini-B connector.
Required cable:
Rollover cable: RJ45 to DB9 connector for serial port.
Serial ports are becoming rare on modern laptops, often require USB adapter.
Accessing the CLI
Use a terminal emulator (e.g., PuTTY).
Select 'Serial' and then click 'Open' to connect.
Default settings for connection:
Baud rate: 9600 bps.
Data bits: 8.
Stop bits: 1.
Parity: None.
Flow control: None.
CLI Modes
User Exec Mode
Entry level mode, limited access.
Indicated by " > " after the host name.
Privileged Exec Mode
Accessed by using the command
enablefrom User Exec mode.Indicated by " # " after the host name.
More powerful commands available than in User Exec mode.
Packet Tracer
Cisco Packet Tracer: Network simulator useful for CCNA labs.
Limited compared to real devices.
Command Shortcuts
Use the
?to see available commands.Use the Tab key for command auto-completion (e.g., typing
e nfollowed by Tab completes toenable).
Global Configuration Mode
Entering Global Configuration Mode
Command:
configure terminal(shortcut:conf t).Change device configuration.
Setting Passwords
Secure Privileged Exec mode with a password.
Command:
enable password <password>.Passwords are case-sensitive.
Configuration Files
Running Config
Active configuration, modified in CLI.
Command to view:
show running config.
Startup Config
Configuration loaded on device boot.
Command to view:
show startup config.
Saving Configuration
Save running config to startup config:
writewrite memorycopy running-config startup-config
View saved configuration using
show startup config.
Security Considerations
Encrypting Passwords
Command:
service password encryptionencrypts passwords in running config.Number '7' indicates type of encryption used.
Using Enable Secret
Use
enable secret <password>for a more secure encrypted password (indicated by number '5').If both commands are issued,
enable passwordwill be ignored in favor ofenable secret.
Deleting Commands
To remove a command, prefix with
no, e.g.,no service password encryption.
Summary of Commands
User Exec Mode:
enable: Shift to Privileged Exec mode.
Privileged Exec Mode:
configure terminal: Shift to Global Configuration mode.enable password <password>: Set password for Privileged Exec mode.show running config: View current active configuration.Use
write,write memory, orcopy running-config startup-configto save configuration.