Skip to content

2. Cisco iOS

1. What is Cisco IOS?

Play

Cisco iOS Introduction

Cisco iOS Basic Commands

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> enable
    Router#
  • disable:

    • Exits privileged EXEC mode.
    Router# disable
    Router>
  • configure terminal (or conf t):

    • Used to enter global configuration mode, where you can configure the router or switch.
    Router# configure terminal
    Router(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:

  1. Configure Hostname** Set the router’s name to identify it in your network.

    Router(config)# hostname MyRouter
    MyRouter(config)#
  2. Set Password: Set a password for security.

    MyRouter(config)# enable secret mypassword
  3. 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/0
    MyRouter(config-if)# ip address 192.168.1.1 255.255.255.0
    MyRouter(config-if)# no shutdown
    MyRouter(config-if)# exit
    • no shutdown: Turns on the interface.
    • ip address: Assigns an IP address and subnet mask to the interface.
  4. 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.2

    This 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.

  1. Set Hostname:

    Switch(config)# hostname MySwitch
    MySwitch(config)#
  2. 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 1
    MySwitch(config-if)# ip address 192.168.1.10 255.255.255.0
    MySwitch(config-if)# no shutdown
    MySwitch(config-if)# exit
  3. Create VLANs: Create VLANs to logically segment the network.

    MySwitch(config)# vlan 10
    MySwitch(config-vlan)# name Sales
    MySwitch(config-vlan)# exit
  4. Assign Ports to VLANs: Assign physical ports to the VLANs.

    MySwitch(config)# interface range fa0/1 - 24
    MySwitch(config-if-range)# switchport mode access
    MySwitch(config-if-range)# switchport access vlan 10
    MySwitch(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 or traceroute.
  • Limitations:
    • Cannot modify device configuration.
    • Cannot make any permanent changes.

Example:

Terminal window
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.
  • 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:

Terminal window
Router> enable
Router# 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:

Terminal window
Router# configure terminal
Router(config)# hostname MyRouter
Router(config)# interface gigabitEthernet0/0
Router(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:

Terminal window
Router(config)# interface gigabitEthernet0/0
Router(config-if)# ip address 192.168.1.1 255.255.255.0
Router(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:

Terminal window
Router(config)# line vty 0 4
Router(config-line)# password cisco
Router(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, and ping.
    • Performing in-depth troubleshooting.
  • Limitations: Some commands might not be available based on configuration and user privilege settings.

Example:

Terminal window
Router# show ip interface brief
Router# debug ip packet

3.Comparison of Modes

ModePromptPurposeAccess LevelMain Use
User EXEC ModeRouter>Basic access for checking device statusLowestViewing basic device information, testing connectivity.
Privileged EXEC ModeRouter#Advanced access, execute most commandsHigher than User EXECConfiguration tasks, diagnostics, troubleshooting.
Global Configuration ModeRouter(config)#Configuration of global device settingsHighestSetting device-wide parameters (routing, interfaces, etc.).
Interface Configuration ModeRouter(config-if)#Configure individual interfacesSpecific to interfaceConfiguring specific interfaces (IP, speed, etc.).
Line Configuration ModeRouter(config-line)#Configuring terminal access methods (console, VTY)Specific to lineConfiguring access policies, passwords, timeouts for terminal lines.