Tools  

Basic Configuration of a Cisco Switch using the Cisco Packet Tracer Simulator

Introduction

Welcome to the world of networking! If you want to become a network administrator or just learn how networks work, you're in the right place. A Cisco switch is a smart device that helps computers and other devices talk to each other in a local network. It sends data to the right place, making the network fast and safe.

With Cisco Packet Tracer, you can practice these skills in a safe, virtual space without using real hardware. This guide will show you the basic steps to set up a new switch, add simple security, and get it ready to work in a network.

What is Cisco Packet Tracer Simulator?

Cisco Packet Tracer is a free tool that helps students and beginners practice networking. One of the first tasks in networking is learning how to set up (configure) a Cisco switch. In this guide, we will use simple steps to configure a switch in Packet Tracer.

Download Link:  https://www.netacad.com/resources/lab-downloads

Once you download Cisco Packet Tracer, you can install it and start using it to build virtual networks. You just open the program, choose devices like switches, routers, and computers, and drag them into the workspace. Then, you connect them with cables and click on each device to set it up. It’s a simple way to learn how networks work without needing real equipment.

What is Switch?

A switch is a Networking device that connects computers, printers, and other devices in a network. It helps them send and receive information to the right place. Instead of sending data to every device, the switch sends it only to the one that needs it. This makes the network faster and safer. Switches are used in homes, schools, and offices to keep everything connected.

Step 1. Add a Switch in Packet Tracer

  • Open Cisco Packet Tracer.

  • Drag a 2960 switch and a PC  to the workspace.

  • Use a console cable from the PC to the switch for CLI access.

  • Then, connect a PC to the switch using a copper straight-through cable.

If you use a console cable from the PC to the switch for CLI access for the first time 

A console connection is a direct link between your computer and a Cisco switch or router using a console cable. It lets you open the CLI and configure the device even if it has no IP address or network connection.

  1. Click on the PC

  2. Go to the Desktop tab

  3. Click on the Terminal window.

Then you can start the configuration using the following steps and configuration commands.

Step 2. Access the Switch  ( Enter Privileged Mode)  

Enter Privileged Mode is a mode on a Cisco switch or router that lets you do more than normal. In this mode, you can see all the settings and make important changes. It is also called “enable mode.

  • Click on the switch.

  • Go to the CLI tab.

  • Press Enter to start.

Step 3. Go to Configuration Mode ( Enter Global Configuration Mode )

Global Configuration Mode is a mode in a Cisco switch or router where you can change the main settings of the device. In this mode, you can set things like the device name, passwords, and other important settings that affect the whole switch or router.

Switch> enable
Switch# configure terminal
Switch(config)#

Step 4. Change the Switch Name

Every Cisco device should have its own name instead of the default "Switch." A name (hostname) helps you know which device you are working on, especially when using remote access like SSH.

  • Rules for names:

  • Must start with a letter

  • Must end with a letter or number

  • No spaces (use letters, numbers, or dashes only)

  • Less than 64 characters

Example: naming a switch SW1.

Switch> enable 
Switch# configure terminal 
Switch(config)# hostname SW1 
SW1(config)# 

Step 5. Configure Passwords

Passwords keep network devices safe from hackers. Weak passwords are easy to guess, so strong ones must be used.

Good password rules:

  • At least 8 characters

  • Use big and small letters, numbers, and symbols

  • Do not use the same password everywhere

  • Do not use simple words

  • You can use a password maker (generator) to create strong ones

  • Always encrypt passwords and show a legal warning when people log in

In class or labs, we use simple passwords (like cisco), but in real life always use strong passwords.

Console password

The console password is a simple security step that protects your switch. It stops anyone without permission from using the console port (the physical port on the switch) to change its settings.

SW1(config)# line console 0 
SW1(config-line)# password cisco 
SW1(config-line)# login 

Enable password

The enable password is a password for a Cisco switch or router. It stops people who don’t have permission from entering Privileged Mode and changing important settings.

SW1(config)# enable secret class

Remote access (VTY) password

The Remote Access (VTY) password is a password for a Cisco switch or router. It lets people connect to the device from another computer and stops anyone without permission from accessing it.

S1(config)# line vty 0 4 
S1(config-line)# password cisco 
S1(config-line)# login 

Verify Configuration

SW1#show running-configuration

Encrypt Passwords

By default, passwords in the running-config and startup-config files are shown in plain text. This is not safe because anyone who sees the files can read the passwords.

To hide (encrypt) them, use this command in global config mode.

SW1# configure terminal 
SW1(config)# service password-encryption 

Verify Configuration

SW1# show running-config

Step 6. Banner Messages

Passwords help protect devices, but it’s also important to warn that only authorized users may access them. This is done by adding a banner message. A banner can also serve as a legal notice in case of unauthorized access.

To set it, use the command:

banner motd # Your Message Here #

The # is a delimiter that marks the start and end of the message. After setting it, the banner will appear every time someone tries to access the device.

By entering the wrong password, you can see and verify the banner message.

Step 7. Set an IP Address on VLAN 1

This will allow you to manage the switch.

SW1(config)# interface vlan 1 
SW1(config-if)# ip address 192.168.1.2 255.255.255.0 
SW1(config-if)# no shutdown

Step 8. Add a Default Gateway

SW1(config)# ip default-gateway 192.168.1.1 

 

Step 9. Save Your Work

S1# copy running-config startup-config

Step 10. Configure the PC1

  • Click on PC1 in the workspace.

  • Go to the Desktop tab.

  • Select IP Configuration.

 Enter the following details in the IP Configuration window.

  • IP Address: 192.168.1.10

  • Subnet Mask: 255.255.255.0

  • Default Gateway: 192.168.1.1

Step 11. Test the Connection

  • On the PC, open Command Prompt.

  • Type: ping 192.168.1.2

  • If you get replies, the switch is working!

Conclusion

We configured a Cisco switch and a PC in Packet Tracer using simple steps. The switch now has a name, IP address, and passwords, and the PC is set up with its own IP. With this setup, the PC and switch can talk to each other, and the switch is ready for more networking practice.