2. Cisco iOS
1. What is Cisco IOS?
Cisco IOS (Internetwork Operating System) is the operating system software used on most Cisco network devices, such as routers and switches. It’s the software that manages the hardware, networking functions, routing protocols, security settings, and more on Cisco devices. In Packet Tracer (a network simulation software), Cisco IOS mimics the behavior of real Cisco devices, allowing you to practice network configurations, management, and troubleshooting.
###3. eyeatures of Cisco IO
- Command Line Interface (CLI): Cisco devices are primarily configured and managed through a text-based CLI.
- Routing and Switching: It includes features to manage routing, switching, security, and wireless network configurations.
- Protocols: Cisco IOS supports a variety of networking protocols like TCP/IP, RIP, OSPF, EIGRP, and more.
- Security: You can configure firewalls, access control lists (ACLs), VPNs, and other security measures.
2. Beginner’s Guide to Cisco IOS
Here’s a simple guide to get started with Cisco IOS, especially useful in tools like Packet Tracer:
2.1 Accessing Cisco IOS (CLI)
When you start a Cisco device in Packet Tracer, you access the IOS through the CLI.
- To open the CLI:
- Click on the device (e.g., Router or Switch).
- Go to the “CLI” tab to access the command-line interface.
2.2 Basic Commands
Here are a few essential commands you need to know:
-
enable
:- This command is used to enter privileged EXEC mode.
- You need to be in this mode to execute most configuration commands.
Router> enableRouter# -
disable
:- Exits privileged EXEC mode.
Router# disableRouter> -
configure terminal
(orconf t
):- Used to enter global configuration mode, where you can configure the router or switch.
Router# configure terminalRouter(config)# -
exit
:- Exits from the current mode to the previous mode.
2.3 Basic Configuration
Here’s how you can set up a router or switch in Packet Tracer.
For a Router:
-
Configure Hostname** Set the router’s name to identify it in your network.
Router(config)# hostname MyRouterMyRouter(config)# -
Set Password: Set a password for security.
MyRouter(config)# enable secret mypassword -
Configure Interface** (Assigning an IP address to router interface):
- Go to the interface (e.g.,
GigabitEthernet0/0
). - Enable the interface and assign an IP address.
MyRouter(config)# interface GigabitEthernet0/0MyRouter(config-if)# ip address 192.168.1.1 255.255.255.0MyRouter(config-if)# no shutdownMyRouter(config-if)# exitno shutdown
: Turns on the interface.ip address
: Assigns an IP address and subnet mask to the interface.
- Go to the interface (e.g.,
-
Configure Routing (Static Route): You can add routing information (e.g., static routing) to your router.
MyRouter(config)# ip route 0.0.0.0 0.0.0.0 192.168.1.2This creates a default route to reach all unknown networks via the IP address
192.168.1.2
.
2.4 Switch Configuration
Switches work differently than routers. They are mostly used for creating VLANs and managing Layer 2 traffic.
-
Set Hostname:
Switch(config)# hostname MySwitchMySwitch(config)# -
Assign IP Address (for management): Assign an IP address to a switch’s virtual interface to manage it via the network.
MySwitch(config)# interface vlan 1MySwitch(config-if)# ip address 192.168.1.10 255.255.255.0MySwitch(config-if)# no shutdownMySwitch(config-if)# exit -
Create VLANs: Create VLANs to logically segment the network.
MySwitch(config)# vlan 10MySwitch(config-vlan)# name SalesMySwitch(config-vlan)# exit -
Assign Ports to VLANs: Assign physical ports to the VLANs.
MySwitch(config)# interface range fa0/1 - 24MySwitch(config-if-range)# switchport mode accessMySwitch(config-if-range)# switchport access vlan 10MySwitch(config-if-range)# exit
2.5 Saving Configuration
After configuring a device, save your settings to avoid losing them when the device is rebooted.
-
Save configuration to startup configuration:
MyRouter# copy running-config startup-config
2.6 Verifying Configuration
After configuring a device, you can verify your settings using the following commands:
show running-config
: Shows the current configuration.show ip interface brief
: Displays interface status and IP address information.show version
: Displays information about the device, including IOS version.
2.7 Common Troubleshooting Commands
-
ping
: Tests connectivity between devices.MyRouter# ping 192.168.1.10 -
traceroute
: Traces the path to a destination.MyRouter# traceroute 192.168.1.10 -
show ip route
: Displays the routing table of the device.MyRouter# show ip route
3. Operating Modes
In Cisco IOS, there are different modes that provide various levels of access and control over the device’s configuration and operation. Understanding these modes is essential for efficiently managing and configuring Cisco devices.
3.1 User EXEC Mode
- Prompt:
Router>
- Purpose: This is the first mode you enter when accessing a Cisco device.
- Access Level: Basic access with limited functionality.
- Use Cases:
- Checking basic system information (e.g.,
show version
,show ip interface brief
). - Running basic commands like
ping
ortraceroute
.
- Checking basic system information (e.g.,
- Limitations:
- Cannot modify device configuration.
- Cannot make any permanent changes.
Example:
Router> show ip interface brief
3.2 Privileged EXEC Mode (Enable Mode)
- Prompt:
Router#
- Purpose: This mode allows you to perform more advanced operations and configuration.
- Access Level: Higher access level than User EXEC. In this mode, you can execute most commands related to device configuration, troubleshooting, and management.
- Use Cases:
- Entering global configuration mode (e.g.,
configure terminal
). - Viewing system information (e.g.,
show running-config
,show ip route
). - Performing diagnostics and troubleshooting commands.
- Entering global configuration mode (e.g.,
- How to Enter: Type
enable
in User EXEC mode. - Limitations: You cannot make permanent changes to the device’s configuration until you enter Global Configuration Mode.
Example:
Router> enableRouter# show running-config
3.3 Global Configuration Mode
- Prompt:
Router(config)#
- Purpose: This is the mode where you can configure global settings for the entire router or switch.
- Access Level: The highest level of configuration access.
- Use Cases:
- Configure basic settings (hostname, password, interfaces).
- Set up routing protocols (e.g., OSPF, EIGRP).
- Configure interfaces, IP addresses, and routing.
- How to Enter: From Privileged EXEC Mode, type
configure terminal
. - Limitations: Changes made in Global Configuration Mode affect the entire device, so be careful when configuring.
Example:
Router# configure terminalRouter(config)# hostname MyRouterRouter(config)# interface gigabitEthernet0/0Router(config-if)# ip address 192.168.1.1 255.255.255.0
3.4 Interface Configuration Mode
- Prompt:
Router(config-if)#
- Purpose: This mode is used to configure individual interfaces (such as Ethernet, Serial, or Gigabit interfaces).
- Access Level: Focused on configuring settings specific to network interfaces.
- Use Cases:
- Assigning IP addresses to interfaces.
- Enabling or disabling interfaces (
no shutdown
). - Configuring interface settings (speed, duplex, description).
- How to Enter: From Global Configuration Mode, use
interface
followed by the interface name (e.g.,interface gigabitEthernet0/0
). - Limitations: You can only configure settings for a specific interface in this mode.
Example:
Router(config)# interface gigabitEthernet0/0Router(config-if)# ip address 192.168.1.1 255.255.255.0Router(config-if)# no shutdown
3.5 Line Configuration Mode
- Prompt:
Router(config-line)#
- Purpose: This mode is used to configure specific settings for console, AUX, and VTY lines (used for terminal access).
- Access Level: Allows configuration of user access methods.
- Use Cases:
- Configuring console line password (for direct access).
- Configuring VTY line passwords (for remote access, such as via SSH or Telnet).
- Setting idle-timeout for remote sessions.
- How to Enter: From Global Configuration Mode, type
line
followed by the line type (e.g.,line vty 0 4
for remote access lines). - Limitations: You can only configure line-specific settings in this mode.
Example:
Router(config)# line vty 0 4Router(config-line)# password ciscoRouter(config-line)# login
3.6 Privilege EXEC Mode (Other Modes)
- Prompt:
Router#
- Purpose: This is a special EXEC mode for performing advanced diagnostics and troubleshooting.
- Access Level: Full access to diagnostic commands and commands related to debugging.
- Use Cases:
- Running commands like
show
,debug
, andping
. - Performing in-depth troubleshooting.
- Running commands like
- Limitations: Some commands might not be available based on configuration and user privilege settings.
Example:
Router# show ip interface briefRouter# debug ip packet
3.Comparison of Modes
Mode | Prompt | Purpose | Access Level | Main Use |
---|---|---|---|---|
User EXEC Mode | Router> | Basic access for checking device status | Lowest | Viewing basic device information, testing connectivity. |
Privileged EXEC Mode | Router# | Advanced access, execute most commands | Higher than User EXEC | Configuration tasks, diagnostics, troubleshooting. |
Global Configuration Mode | Router(config)# | Configuration of global device settings | Highest | Setting device-wide parameters (routing, interfaces, etc.). |
Interface Configuration Mode | Router(config-if)# | Configure individual interfaces | Specific to interface | Configuring specific interfaces (IP, speed, etc.). |
Line Configuration Mode | Router(config-line)# | Configuring terminal access methods (console, VTY) | Specific to line | Configuring access policies, passwords, timeouts for terminal lines. |