Diploma in Computer Hardware Engineering
4151 Computer Networks-II
Module - 3 IOS,switches and Router Configuration
Syllabus
CO3: Illustrate the fundamentals of IOS,switches and Router Configuration.
M3.01 Illustrate Switch and Router hardware and memory. 2 Understanding
M3.02 Outline Router and switch interfaces. 2 Understanding
M3.03 Summarize Internetwork Operating Systems.(IOS) 3 Understanding
M3.04 Identify the basic configurations of a Switch. 3 Understanding
M3.05 Illustrate router configuration. 4 Understanding
M3.06 Explain Register setting, clock, various logging. 2 Understanding
Syllabus Contents: Introduction to Switch and Router. Switch and Router Hardware-Router and
Switch Interfaces - Internetwork Operating System (IOS) - Basic configurations of a
Switch-setting and configuring commands– Saving and Erasing Configurations- Memory on
Routers-Basic Router Configuration- Configuring Router with <copy> and TFTP-Setting the
Bootstrap Behavior-Configuration Register Settings-upgrading Router's IOS- Configuring the
Router's Clock-IOS Message Logging.-Setting up Buffered Logging-Setting up Trap Logging.
******************************************************************************
******************
Switch and Routers
Switches and routers are two different types of network devices that are commonly used to
facilitate communication within a computer network. A switch is a networking device that
connects devices together on a local area network (LAN). It operates at the data link layer (Layer
2) of the OSI (Open Systems Interconnection) model and uses MAC (Media Access Control)
addresses to forward data to its destination. A switch is typically used to connect devices like
computers, printers, and servers in a network. Switches may have additional features such as
VLAN (Virtual Local Area Network) support, QoS (Quality of Service) capabilities, and
management interfaces (such as web-based or command-line interfaces) for configuring and
monitoring the switch.
A router, on the other hand, is a networking device that connects multiple networks together,
such as LANs or WANs (wide area networks). It operates at the network layer (Layer 3) of the
OSI model and uses IP (Internet Protocol) addresses to route data between networks. A router is
typically used to connect a local network to the internet. Some routers also have additional
CN2 Module 3 IOS, Switches and Roter Configuration Page No 1 of 13
features such as VPN (Virtual Private Network) support, firewall capabilities, and management
interfaces for configuring and monitoring the router.
In summary, switches are used to connect devices within a network, while routers are used to
connect networks together. Both switches and routers are essential components of modern
computer networks, and their proper configuration and management are critical to ensuring
efficient and secure network communication.
****
Switch and Router Hardware
Switches and routers are both hardware devices used in computer networks. Both switches and
routers come in various form factors, ranging from small home-office devices to large
enterprise-grade equipment. The hardware components of switches and routers can vary
depending on the specific model and intended use case. Here's a brief overview of their hardware
components:
Switch Hardware: A switch is a hardware device used in computer networks to connect devices
together on a local area network (LAN). Here's an overview of the hardware components of a
typical switch:
i) Ports: A switch usually has several Ethernet ports, ranging from 4 to 48 or more, that allow
devices to connect to the switch. Each port has its own unique Media Access Control (MAC)
address.
ii) Backplane: The backplane is the internal switching fabric that connects all the ports together.
It determines the switch's total switching capacity, which is the maximum amount of data that
can be transmitted through the switch at any given time.
iii) Processor: The switch's processor controls the internal operation of the switch and manages
the forwarding of data between ports.
iv) Memory: Switches have different types of memory, including RAM (Random Access
Memory), which is used to store the switch's operating system and configuration files, and CAM
(Content Addressable Memory), which is used to store the MAC addresses of devices connected
to each port.
v) Power Supply: Switches require a power source to operate. They can be powered by a
standard electrical outlet or via Power over Ethernet (PoE) technology, which allows the switch
to power connected devices over Ethernet cables.
vi) Management Interface: Some switches have management interfaces, such as web-based or
command-line interfaces, that allow network administrators to configure and monitor the switch.
***
CN2 Module 3 IOS, Switches and Roter Configuration Page No 2 of 13
Router Hardware: Here's an overview of the hardware components of a typical router:
i) Network Interfaces: A router typically has two or more network interfaces, which allow it to
connect to different networks. For example, a router may have one Ethernet interface for the
local network and another interface for the internet connection. These interfaces can be physical
ports, such as Ethernet or serial interfaces, or they can be virtual interfaces, such as virtual LANs
(VLANs).
ii) Processor: The router's processor controls the internal operation of the router and manages
the forwarding of data between different networks.
iii) Memory: A Cisco router has four memory types:
❖ ROM: This is where the POST script of the router is located. The POST software (Power
On Self Test) is used during startup to perform the initial hardware checking of the
device. The ROM also holds a mini-IOS used for password recovery.
❖ RAM: This is where the running configuration is located. After the device boots up, the
IOS software is loaded into RAM. Also, RAM holds routing tables, network parameters
during operation etc. When configuring the router, we actually change the
running-configuration which as we said is stored into RAM
❖ NVRAM: When we save the running-configuration (using the command “write“) it is
stored into the NVRAM and becomes the startup-configuration. After rebooting the
router, the startup-configuration is loaded from the NVRAM.
❖ Flash: This is like the hard-disk of a PC. It holds the IOS software image file and any
backup configurations that you might save from time to time.
❖ Notes: When you issue the “show running-configuration” command on the router you
instruct the device to display the current running configuration in RAM. When you issue
the “show startup-configuration” command you instruct the router to display the stored
configuration in the NVRAM.
iv) Power Supply: Routers require a power source to operate. They can be powered by a
standard electrical outlet or via Power over Ethernet (PoE) technology.
v) Management Interface: Routers usually have a management interface, such as a web-based
or command-line interface, that allows network administrators to configure and monitor the
router.
***
CN2 Module 3 IOS, Switches and Roter Configuration Page No 3 of 13
Interfaces in a switch: A switch typically has multiple interfaces that allow devices to connect
to the switch and communicate with other devices on the same network. Here are the different
types of interfaces commonly found on switches:
1. Ethernet Ports: Ethernet ports are the most common type of interface found on switches.
These ports use the Ethernet protocol to connect devices to the switch and enable them to
communicate with other devices on the same network. Ethernet ports come in various
speeds, including 10Mbps, 100Mbps, 1Gbps, 10Gbps, 40Gbps, and 100Gbps.
2. Uplink Ports: Uplink ports are used to connect switches together and create a larger
network. These ports typically have higher speeds than regular Ethernet ports and can
support link aggregation, which combines multiple ports into a single logical link for
increased bandwidth.
3. Console Port: A console port is used for local configuration and management of the
switch. It is typically a serial port that connects the switch to a computer or terminal
using a console cable.
4. Management Port: Some switches have a separate management port that provides
remote access to the switch for configuration and management purposes. This port can be
an Ethernet port or a dedicated management interface.
5. USB Port: Some switches have a USB port for connecting a USB device, such as a
storage device or a cellular modem, for additional network connectivity.
***
Interfaces in a Router: The different interfaces on a router enable it to connect to different
networks and devices, allowing it to route data between them and provide internet access to local
area networks. Management interfaces allow administrators to configure and monitor the router.
1. Ethernet Interfaces: Ethernet interfaces are the most common type of interface found on
routers. These ports use the Ethernet protocol to connect to devices on a local area
network (LAN) and enable them to communicate with each other.
2. WAN Interfaces: WAN (Wide Area Network) interfaces are used to connect the router to
the internet or other remote networks. Common types of WAN interfaces include DSL,
cable modem, fiber optic, and cellular connections.
3. Serial Interfaces: Serial interfaces are used for connecting to other routers or networking
devices using serial cables. These interfaces are commonly used in Wide Area Networks
(WANs) and other long-distance connections.
4. Wireless Interfaces: Some routers have wireless interfaces that allow devices to connect
to the router using Wi-Fi.
5. USB Interfaces: Some routers have USB interfaces that allow you to connect a USB
storage device or cellular modem for additional network connectivity.
CN2 Module 3 IOS, Switches and Roter Configuration Page No 4 of 13
6. Console Port: A console port is used for local configuration and management of the
router. It is typically a serial port that connects the router to a computer or terminal using
a console cable.
7. Management Port: Some routers have a dedicated management port that provides
remote access to the router for configuration and management purposes.
****
Internetwork Operating System (IOS)
An Internetwork Operating System (IOS) is a proprietary operating system used in Cisco routers
and switches. It is a network operating system that is designed to provide functionality for
managing and configuring networking devices.
Features and functions of IOS:
1) Command Line Interface (CLI): IOS provides a CLI for the configuration and
management of networking devices. The CLI allows network administrators to enter
commands to configure and monitor the device.
2) Network Protocols: IOS supports a wide range of network protocols, including TCP/IP,
OSPF, EIGRP, BGP, and VLANs.
3) Routing and Switching: IOS provides routing and switching functionality, which allows
it to route data between different networks and switch data between devices on the same
network.
4) Security: IOS provides security features such as access control lists (ACLs), Virtual
Private Networks (VPNs), and firewalls to protect the network from unauthorized access
and attacks.
5) Network Management: IOS provides network management functionality, including
Simple Network Management Protocol (SNMP), which allows network administrators to
monitor and manage networking devices.
6) Software Upgrades: IOS supports software upgrades, which allow network
administrators to upgrade the software on the device to add new features or fix bugs.
Overall, IOS is a robust operating system that provides a wide range of features and functions for
managing and configuring networking devices. It is a widely used operating system in the
networking industry, particularly in Cisco routers and switches.
There are two types of IOS operating systems:
1) IOS XE - runs on top of a Linux kernel. IOS XE and IOS share a lot of the same code,
but IOS XR is considered to be a completely different code base.
2) IOS XR - based on QNX a commercial Unix-like real-time operating system. IOS XR
supports software-defined networking (SDN) and the embedded systems market.
***
CN2 Module 3 IOS, Switches and Roter Configuration Page No 5 of 13
Basic Configurations of a Switch
Here are some basic configurations of a switch:
1) Setting a Hostname: The hostname is a unique name given to the switch to identify it on
the network. It can be set using the command "hostname <name>" in the configuration
mode.
2) Configuring Interfaces: Switches have multiple interfaces and each interface needs to
be configured. The basic configuration for an interface includes setting its speed, duplex
mode, and VLAN assignment. These can be configured using the "interface <interface>"
command in the configuration mode.
3) Configuring VLANs: Virtual Local Area Networks (VLANs) are used to segregate
network traffic and improve network performance. VLANs can be created using the "vlan
<vlan-number>" command in the configuration mode.
4) Configuring Trunk Ports: Trunk ports are used to carry multiple VLANs between
switches. To configure a trunk port, use the "interface <interface>" command and then
the "switchport mode trunk" command.
5) Configuring Access Ports: Access ports are used to connect end devices to the switch.
Access ports are configured to carry traffic for a single VLAN using the "interface
<interface>" command and then the "switchport mode access" command.
6) Configuring Port Security: Port security is used to restrict the number of devices that
can connect to a switch port. This is done by setting the maximum number of MAC
addresses allowed on a port. Port security can be configured using the "interface
<interface>" command and then the "switchport port-security" command.
7) Configuring Spanning Tree Protocol: Spanning Tree Protocol (STP) is used to prevent
loops in the network. To enable STP, use the "spanning-tree <mode>" command in the
configuration mode.
Overall, these basic configurations can be performed on a switch to ensure that it is properly
configured and optimized for the network. More advanced configurations may be required for
larger or more complex networks.
****
Saving and Erasing Configurations in a switch
Saving and erasing configurations in a switch are important tasks that allow you to manage and
maintain the switch settings. Here's how to save and erase configurations in a switch:
1) Saving Configurations: The configurations in a switch can be saved in the non-volatile
memory (NVRAM) using the "copy running-config startup-config" command. This
command saves the current running configuration to the startup configuration file, which
is loaded when the switch is rebooted.
CN2 Module 3 IOS, Switches and Roter Configuration Page No 6 of 13
2) Erasing Configurations: To erase the configurations on a switch, the "erase
startup-config" command can be used. This command erases the startup configuration
file from NVRAM, so when the switch is rebooted, it will have no configurations loaded.
3) Resetting to Factory Default: To reset a switch to its factory default settings, the "erase
startup-config" command followed by the "reload" command can be used. When the
switch is rebooted, it will have no configurations loaded, and the user will be prompted to
go through the initial configuration process. Alternatively, some switches have a physical
reset button that can be pressed for a certain amount of time to reset the switch to factory
default settings.
4) Viewing Current Configuration: The "show running-config" and "show
startup-config" commands can be used to view the current configurations in the switch.
Note: Before erasing or resetting a switch, be sure to have a backup of the configurations in case
of the need to restore them later.
****
Basic Router Configurations
Here are some basic router configurations:
1. Accessing the Router: Open a web browser and enter the IP address of the router
(typically 192.168.1.1 or 192.168.0.1) in the address bar. Log in to the router with the
default username and password or the one you set up during the initial setup.
2. Setting up the Wireless Network: Navigate to the wireless settings and choose a unique
name (SSID) for your wireless network. Set a strong password for your network to
prevent unauthorized access.
3. DHCP Configuration: DHCP (Dynamic Host Configuration Protocol) assigns IP
addresses to devices connected to the network. Configure the DHCP settings to assign IP
addresses automatically to devices.
4. Port Forwarding: If you need to access devices on your network from outside, you need
to forward the necessary ports. Navigate to the port forwarding settings, and specify the
device's IP address and the port number you want to forward.
5. ACL (Access Control List): It is a function in a router that controls network traffic by
allowing or denying access to network resources based on a set of rules. ACLs are used
to filter traffic based on various criteria such as source IP address, destination IP address,
protocol type, port number, and more.
6. Firmware Upgrade: It is essential to keep the router's firmware up-to-date to improve
the security and performance of your network. Check for firmware updates regularly and
install them when available.
7. Routing management: It is a critical function of the router that determines how traffic is
directed through the network. It is based on various criteria like routing protocol, routing
metrics, static/dynamic routes, etc.
CN2 Module 3 IOS, Switches and Roter Configuration Page No 7 of 13
Note that router configurations can vary depending on the brand and model of the router. It is
best to refer to the router's documentation or the manufacturer's website for specific instructions.
***
Configuring router with copy command
To configure a router using the "copy" command, the following steps can be used.
Step.1: Connect to the router using a console cable and a terminal emulator such as PuTTY.
Step.2: Enter privileged mode by typing "enable" and the enable password if configured.
Step.3: Enter configuration mode by typing "configure terminal" or "conf t".
Step.4: Make the necessary configuration changes using the appropriate commands. For
example, you can configure an IP address on an interface using the "interface" and "ip address"
commands.
Step.5: Save the configuration to NVRAM using the "copy running-config startup-config"
command.This command saves the current running configuration to non-volatile RAM
(NVRAM), which is retained even after a reboot.
Step.6: Verify that the configuration has been saved by typing "show startup-config" or "show
running-config". These commands display the startup configuration and the current running
configuration, respectively.
Step.7: Reload the router to ensure that the startup configuration is used after a reboot, using
reload command.
***
Configuring router with tftp command
To configure a router using the TFTP (Trivial File Transfer Protocol) command, the following
steps can be used.
1. Download and install a TFTP server on the computer. There are several free TFTP server
software options available online, such as Tftpd32 and SolarWinds TFTP Server.
2. Configure the TFTP server to allow file transfers and set the directory where
configuration files will be stored.
3. Connect to the router using a console cable and a terminal emulator such as PuTTY or
Tera Term.
4. Enter privileged mode by typing "enable" and the enable password if configured.
5. Enter configuration mode by typing "configure terminal" or "conf t".
CN2 Module 3 IOS, Switches and Roter Configuration Page No 8 of 13
6. Make the necessary configuration changes using the appropriate commands. For
example, you can configure an IP address on an interface using the "interface" and "ip
address" commands:
7. Save the configuration to a file on your computer using the TFTP command. For
example, if the TFTP server is running on IP address 192.168.1.100, you can use the
following command to save the configuration to a file named "router-config" on the
TFTP server:
Command:
copy running-config tftp
Address or name of remote host []? 192.168.1.100
Destination filename [router-config]?
8. Verify that the configuration has been saved to the TFTP server by checking the directory
where the TFTP server stores files.
9. To restore the configuration from the TFTP server to the router, use the following
command:
Command:
copy tftp running-config
Address or name of remote host []? 192.168.1.100
Source filename []? Router-config
This command copies the configuration file named "router-config" from the TFTP server
to the running configuration on the router.
10. Save the running configuration to non-volatile RAM (NVRAM) using the "copy
running-config startup-config" command:
***
Setting the Bootstrap Behavior
Bootstrap is a mechanism used by Cisco routers to boot the operating system image and load the
router configuration. By default, a router's bootstrap behavior is set to load the operating system
image from the first available source, such as flash memory or a network server, and load the
configuration from non-volatile RAM (NVRAM). However, we can configure the bootstrap
behavior to modify this default behavior. Here's how to set the bootstrap behavior:
1. Connect to the router using a console cable and a terminal emulator such as PuTTY.
2. Enter privileged mode by typing "enable" and the enable password if configured.
3. Enter global configuration mode by typing "configure terminal" or "conf t".
4. Set the configuration register value to specify the bootstrap behavior. The configuration
register is an 8-bit value stored in non-volatile RAM (NVRAM) that controls the
behavior of the router during the bootstrap process. The following are some common
configuration register values that modify the default behavior:
CN2 Module 3 IOS, Switches and Roter Configuration Page No 9 of 13
A. 0x2102: Load the operating system image from flash memory and the
configuration from NVRAM (default behavior).
B. 0x2142: Ignore the contents of NVRAM and boot the router without loading a
configuration. This can be useful if you need to recover a lost password or
configuration.
C. 0x2101: Load the operating system image from ROM (read-only memory) instead
of flash memory.
D. 0x2100: Enter ROM monitor mode, which allows you to perform low-level
diagnostics and troubleshooting.
E. To set the configuration register value, use the following command:
config-register value, Replace "value" with the desired 8-bit hexadecimal value,
such as 0x2142.
5. Save the configuration to non-volatile RAM (NVRAM) using the "copy running-config
startup-config" command:
6. To verify the bootstrap behavior, use the "show version" command. The output includes a
line that shows the current configuration register value:
***
Upgrading router IOS
To upgrade the IOS (Internetwork Operating System) of a router, the following steps can be
performed.
1. Download the new IOS image from the Cisco website. Make sure to select the correct
IOS image for the router model and hardware configuration.
2. Verify that there is enough free space on the router's flash memory to store the new IOS
image. Use the "show flash" command to display the current flash memory usage and
available space.
3. Back up the current configuration to a TFTP server or another external storage device
using the "copy running-config tftp" or "copy running-config flash" command.
4. Connect to the router using a console cable and a terminal emulator such as PuTTY.
5. Enter privileged mode by typing "enable" and the enable password if configured.
6. Enter global configuration mode by typing "configure terminal" or "conf t".
7. Use the "boot system" command to specify the new IOS image as the default boot
image. For example: boot system flash:new_ios_image_filename.bin.
8. Save the configuration to non-volatile RAM (NVRAM) using the "copy running-config
startup-config" command.
9. Use the "show bootvar" command to verify that the new IOS image is set as the default
boot image.
10. Use the "copy tftp flash" command to copy the new IOS image from the TFTP server to
the router's flash memory.
CN2 Module 3 IOS, Switches and Roter Configuration Page No 10 of 13
11. Use the "verify" command to verify the integrity of the new IOS image.
12. Reload the router to activate the new IOS image using the "reload" command. Follow the
on-screen prompts to save the configuration and reboot the router.
****
Configuring the Router's Clock
Configuring the router's clock is important for accurate timekeeping, which is required for
various network services such as authentication, authorization, and accounting (AAA), log
timestamps, and certificate validation. To configure the router's clock, e the following steps
required:
1. Connect to the router using a console cable and a terminal emulator such as PuTTY or
Tera Term.
2. Enter privileged mode by typing "enable" and the enable password if configured.
3. Enter global configuration mode by typing "configure terminal" or "conf t".
4. Use the "clock set" command to set the current date and time.
For example: clock set 14:30:00 01 Apr 2023.
5. Optionally, configure the router to synchronize its clock with an external time source
using the Network Time Protocol (NTP). For this, one or more NTP servers must be
specified to query for time updates. For example: ntp server “IP address of the NTP
server”. Multiple NTP servers can be specified. separated by spaces or commas.
6. Save the configuration to non-volatile RAM (NVRAM) using the "copy running-config
startup-config" command.
7. Verify the clock settings using the "show clock" command:
***
IOS Message Logging
In Cisco IOS, message logging is used to record system messages and other events for
troubleshooting, analysis, and auditing purposes. By default, message logging is sent to the
router's console and logging buffer. However, we can configure the router to send messages to
other destinations such as a Syslog server or a file on the router's flash memory.
To configure message logging in IOS, the following steps are needed.
1. Enter privileged mode by typing "enable" and the enable password if configured.
2. Enter global configuration mode by typing "configure terminal" or "conf t".
3. Configure the logging facility level using the "logging facility" command followed by a
facility code. For example, to set the logging facility level to "local7" (reserved for
user-defined messages), type: logging facility local7.
CN2 Module 3 IOS, Switches and Roter Configuration Page No 11 of 13
4. Configure the logging severity level using the "logging console" and/or "logging buffer"
commands followed by a severity level. For example, to log messages of severity level
"warnlogging console warnings
logging console warnings
logging buffer warnings
5. Optionally, configure the router to log messages to a file on the router's flash memory
using the "logging file" command followed by the filename and severity level.
Ex: logging file flash:log.txt warnings - This command logs messages of severity level
"warning" or higher to the file "log.txt" on the router's flash memory.
6. Save the configuration to non-volatile RAM (NVRAM) using the "copy running-config
startup-config" command.
7. Verify the logging settings using the "show logging" command.
***
Buffered logging
In Cisco IOS, buffered logging allows you to store system messages in a circular buffer
in the router's memory. This buffer retains the most recent messages up to a certain
number or size, depending on the router's configuration. Buffered logging is useful for
capturing transient events that may not be captured in real-time by other logging
methods, such as console logging or remote syslog.
1. Configure the logging buffer size using the "logging buffered" command
followed by the number of messages or the buffer size in bytes. For example, to
set the buffer size to 1000 messages, type: logging buffered 1000
2. Optionally, configure the router to save the buffered log messages to a file on the
router's flash memory using the "logging buffered <size> filename" command.
For example, to save the buffered messages to a file named "buffered-log.txt" on
the router's flash memory.
3. Verify the logging buffer settings using the "show logging" command.
***
Trap logging
In Cisco IOS, trap logging is a type of event notification mechanism that sends system
messages to a network management station (NMS) or syslog server. Traps are sent
asynchronously, meaning that they are generated and sent immediately when a specified
event occurs, without waiting for a polling request from the NMS. Trap logging is useful
for monitoring specific events or conditions that may require immediate attention, such as
interface status changes, routing protocol events, or security violations.
1. Configure the router to send traps to a syslog server or an SNMP (Simple
Network Management Protocol) management station using the "snmp-server"
CN2 Module 3 IOS, Switches and Roter Configuration Page No 12 of 13
command. For example, to send traps to a syslog server at IP address 10.1.1.100,
type: snmp-server host 10.1.1.100 traps
2. Or, to send traps to an SNMP management station using community string
"public", type: snmp-server community public
3. Configure the router to generate traps for specific events using the "snmp-server
enable traps" command followed by the trap type. For example, to generate traps
for interface status changes, type: snmp-server enable traps interface.
4. Or, to generate traps for routing protocol events, type: snmp-server enable traps
ospf.
5. Verify the trap settings using the "show snmp" command.
****
CN2 Module 3 IOS, Switches and Roter Configuration Page No 13 of 13