Switch Configuration on Cisco Packet Tracer

packet-tracer-switch-configuration-example

Switches are very important and mostly used network devices in network world. And most of these switches are Cisco switches.  In this lesson, we will focus on basic Cisco switches configuration on Cisco Packet Tracer. We will configure Cisco Catalyst 2960 Switch with basic switch configuration commands on Cisco Packet Tracer. In other words we will do Packet Tracer Switch Configuration. Switching is one of the main parts of Cisco CCNA and CCNP ENCOR.

 

In our Cisco Packet Tracer Configuration example, we will do the below configurations one by one:

  • Switch Name Configuration
  • Message of The Day Configuration
  • Password Configuration and Encryption
  • Console Configuration
  • Telnet Configuration
  • VLAN IP Address Configuration

 


For Full Cisco Packet Tracer Course For Cisco Hands on Experience please visit course page. 


 

Now let’s start packet tracer basic switch configuration example step by step.

 


You can download packet tracer switch configuration file here


 

Basic Cisco Switch Configuration Workflow

Configuring a Cisco switch becomes much easier when you follow a structured workflow instead of memorizing individual commands. A typical switch configuration starts with accessing the CLI, entering configuration mode, assigning a hostname, configuring passwords and a management IP address, and finally saving the configuration. Following this sequence helps ensure that the switch is properly configured and ready for management and troubleshooting.

 

cisco switch configuration workflow

Cisco Switch Configuration Workflow

 


 

Switch Name Configuration

The first step of Cisco packet tracer switch configuration is name configuration. The other name of this is hostname configuration. As you know, to identify our switch during the configuration, it is a good configuration habit to give a good name to a switch. In real world, in production network, your switch already has a name. You must not change it with another name if you don ‘t have to.

 

To give a name to a Cisco switch, we will use “hostname” command after “enable” and “configure terminal” configuration mode command. Below, we will give IPCiscoSwitch name to our switch.

 


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

 


 

Password Configuration and Encryption

Secondly, we will focus switch password configuration. Here, we will configure more secure password “enable secret password”. To do this, we will use “enable secret” command with our password ipcisco. You will use this password after “enable” command to enter priviledge-exec mode of the switch.

 


IPCiscoSwitch (config)# enable secret ipcisco

 

After that we will use “service password-encryption” command to encrypt switch password. Normally, passwords are stored in running config as clear text. To encrypt this password, we need to use this command. This is important for switch security.

 


IPCiscoSwitch (config)# service password-encryption

 


For More Cisco Configuration Lab Examples you can visit lab page.


 

Console Configuration

There are different ways to connect a Cisco switch. Console connection and telnet connection are two of them. In this step, we will configure console connection of our switch on Cisco packet tracer.  To start console connection configuration, we will use “line console 0” command. After that we will give console password. We can use cisco123 as password. And then we will use “login” command. You will use this password when you login to the router.

 


IPCiscoSwitch (config)# line con 0
IPCiscoSwitch (config-line)# password cisco123
IPCiscoSwitch (config-line)# login

 

Here, we can also use some additional configuration commands for a better switch configuration experience. For example, we can set switch timeout. By default, it is 10 minutes as “exec-timeout 10 0“.  After 10 minutes inactivity session is timout. Here, the first number shows minutes and the second one shows seconds. But we can set it as 10 minutes and 15 seconds. To do this we will use “exec-timout 10 15.

 


IPCiscoSwitch (config-line)# exec-timeout 10 15

 

Here, if we use exec-timout 0 0 command, the switch session will not timeout anymore.

 

Secondly, we can use “logging synchronous” command to avoid command breaks during the configuration.  This is also a good configuration habit and provide a better configuration experience.

 


IPCiscoSwitch (config-line)# logging synchronous

 

Lastly, we can set configuration command history of console connection with “history size” command. Here, we will set it as 10 commands.

 

IPCiscoSwitch (config-line)# history size 10

 


 

Telnet Configuration

The second way to connect a Cisco switch is telnet access. Here, we will configure telnet settings.  For telnet configuration, firstly, we will go under telnet line to configure it for our switch. To do this, we will use “line vty 0 15” command. This means that there are 16 telnet connection that different users can use for this switch.

Under this telnet line connection, we can use the similar commands that we use for console connection. We can also use different values for telnet.

 

IPCiscoSwitch (config)# line vty 0 15
IPCiscoSwitch (config-line)# password cisco123
IPCiscoSwitch (config-line)# login
IPCiscoSwitch (config-line)# exec-timeout 10 15
IPCiscoSwitch (config-line)# logging synchronous
IPCiscoSwitch (config-line)# history size 10

 

After these steps, we have finished console and telnet configuration of our switch on Cisco packet tracer.

 


 

VLAN IP Address Configuration

On switches, for VLANs, we can set ip addresses. To set an ip address to a Virtual LAN, we will firstly enter this VLAN interface. Here, we will give 10.0.0.1/24 ip address to VLAN 1.

 

IPCiscoSwitch (config)# interface Vlan1
IPCiscoSwitch (config-if)# ip address 10.0.0.1 255.255.255.0
IPCiscoSwitch (config-if)# no shutdown
IPCiscoSwitch (config-if)# exit

 


 

How do you Configure a Management IP Address on a Cisco Switch?

Configured VLAN ip address above can be used as management ip address. Here, let’s write all the required commands for management ip address configuration. Normally, to configure a management IP address on a Cisco switch, we should assign an IP address to the Switch Virtual Interface (SVI), typically VLAN 1 or a dedicated management VLAN. After assigning the IP address and subnet mask, we enable the interface with “no shutdown” and configure the default gateway if remote management from another network is required we use “ip default-gateway <ip-address>” command. Here, we will use 10.0.0.1/24 ip as management ip address and 10.0.0.254 as default-gateway ip address.

 


Switch# configure terminal
Switch(config)# interface vlan 1
Switch(config-if)# ip address 10.0.0.1 255.255.255.0
Switch(config-if)# no shutdown
Switch(config-if)# exit
Switch(config)# ip default-gateway 10.0.0.254
Switch(config)# end

 


 

Message of The Day Configuration

The message of the day (MoTD) is used to inform or warn users about the switch. This is basically a warning message. This can be anything that you write but it is basically a message like “Unauthorized access is forbidden”. Here, we will use “banner motd” command with a sign that shows the end of the message. Here, I will use “#” sign.

 


IPCiscoSwitch (config)# banner motd #
Unauthorized access is forbidden#

 

Or

 


IPCiscoSwitch (config)# banner motd #

Be Silent During The Configuration, I am Sleeping:)#

 

Lastly let’s save our all the configuration with “write” command.

 


IPCiscoSwitch (config)# exit
IPCiscoSwitch# write

 

When you logout from the switch with “logout” command or when session is timeout, you will see this message on the switch like below.


IPCiscoSwitch# logout

 


Press RETURN to get started.

 

 

Be Silent During The Configuration, I am Sleeping:)

User Access Verification

Password:

 


 

How do you Save a Cisco Switch Configuration?

To save Cisco switch configuration you can use both “copy running-config startup-config” and “write” commands under privileged EXEC mode. If you want to use this command under global configuration mode, you can use “do” keyword before the command like “do copy running-config startup-config“. This copies the current running configuration stored in RAM to the startup configuration stored in NVRAM. Saving the configuration ensures that all changes are preserved after the switch is rebooted or powered off.

 


IPCiscoSwitch# copy running-config startup-config

 


IPCiscoSwitch# write

 


 

Cisco Switch Memory Architecture

Understanding the Cisco switch memory architecture is essential for learning how a switch stores its operating system, configuration files and runtime information. Each memory type has a specific purpose during the boot process and normal operation. Knowing the difference between RAM, NVRAM, Flash and ROM also helps you understand where configuration files are stored, why unsaved changes disappear after a reboot and how Cisco switches load the IOS during startup.

 

Cisco switch memory architecture

Cisco Switch Memory Architecture

 


Cisco Switch CLI Cheat Sheet

Although there are hundreds of available IOS commands on Cisco switches, a small set of commands is used in almost every basic switch configuration. The cheat sheet below highlights the most common Cisco switch commands that every CCNA student and network engineer should know before moving on to more advanced switching topics.

 

cisco switch cli command cheat sheet

Cisco Switch Commands Sheat Sheet

 


Frequently Asked Questions (FAQ)

How do You Access the Cisco Switch Command Line (CLI)?

You can access Cisco switch CLI through the console port using a terminal emulator such as PuTTY or directly through the Packet Tracer CLI tab. After assigning a management IP address, you can also access the switch remotely using SSH or Telnet.


How do You Configure a Cisco Switch in Packet Tracer?

To configure a Cisco switch in Packet Tracer, open the switch CLI, enter privileged EXEC mode with the enable command, and then enter global configuration mode using configure terminal. From there, you can configure the hostname, management IP address, passwords, VLAN settings and other basic parameters. Finally, save the configuration with copy running-config startup-config so it remains after the switch is restarted.

 


What are the Basic Switch Configuration Commands?

The basic Cisco switch configuration commands include enable, configure terminal, hostname, interface vlan 1, ip address, no shutdown, ip default-gateway, line console 0, line vty 0 4, and copy running-config startup-config. These commands are commonly used during the initial switch configuration in Cisco Packet Tracer and real Cisco switches.

 


How do you Change the Switch Hostname?

You can change the hostname of a Cisco switch by entering global configuration mode and using the “hostname” command followed by the new device name.


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

 


Why does a Layer 2 Switch Need an IP address?

A Layer 2 switch does not require an IP address to forward Ethernet frames between connected devices. However, it does require a management IP address for remote administration using SSH, Telnet, or network management software. Without a management IP, the switch operates normally but can only be managed through the local console connection.

 


What is the Cisco Command to Display the Current Switch Configuration?

The “show running-config” command displays the current active configuration of a Cisco switch. It shows all configured interfaces, VLANs, passwords, management settings, and other active parameters currently running in memory. This is one of the most frequently used verification commands during switch configuration and troubleshooting.

 


Switch# show running-config

 


What are the Most Common Cisco Switch Show Commands?

Network engineers uses some common shows commands to display any information in thee siwtch or for troubleshooting activities. Some of these most used Cisco switch commands are: show running-config, show startup-config, show ip interface brief, show vlan brief, show interfaces status, show mac address-table, show version etc.. These commands help verify the switch configuration, interface status, VLAN assignments, MAC address learning and software version.

 


Switch# show running-config

Switch# show startup-config

Switch# show ip interface brief

Switch# show vlan brief

Switch# show interfaces status

Switch# show mac address-table

Switch# show version

 


Why does the Switch Display “startup-config is not present”?

The message “startup-config is not present” indicates that no startup configuration is stored in the switch’s NVRAM. This commonly occurs on a new Cisco switch or after the startup configuration has been erased. After completing the initial configuration, save it with copy running-config startup-config to prevent this message from appearing after future reloads.

 


Which Cisco Switch Should I Use in Packet Tracer?

For most CCNA Packet Tracer labs, the Cisco 2960 switch is the recommended choice because it supports essential Layer 2 technologies such as VLANs, trunking, STP, EtherChannel and port security. If your lab requires inter-VLAN routing or other Layer 3 features, you can use a Cisco 3560 multilayer switch.

 


How do You Reset a Cisco Switch Configuration?

To reset a Cisco switch to its default configuration, erase the startup configuration with the erase startup-config or write erase command, delete the vlan.dat file if you want to remove existing VLAN information, and then reload the switch. After the restart, the switch boots with its factory default configuration, allowing you to perform a fresh Cisco switch configuration.

 


Switch# write erase
Switch# delete flash:vlan.dat
Switch# reload

 

or

 


Switch# erase startup-config
Switch# delete flash:vlan.dat
Switch# reload

 

 


How do you Backup a Cisco Switch Configuration?

A Cisco switch configuration can be backed up by saving it locally as the startup configuration or by copying it to an external server such as a TFTP, FTP, SCP or USB storage device. Creating regular configuration backups allows you to quickly restore the switch if a hardware failure or configuration error occurs.

 


How do you Erase a Cisco Switch Configuration?

To erase a Cisco switch configuration, use the “erase startup-config” or “write erase” command to remove the saved startup configuration from NVRAM. If you also want to remove VLAN information, delete the vlan.dat file before reloading the switch. After the restart, the switch boots with its default factory configuration.

 


Switch# erase startup-config

 

or

 


Switch# write erase

 


How do you Reload a Cisco Switch?

You can restart a Cisco switch by using the “reload” command in privileged EXEC mode. Before reloading, the switch prompts you to save any unsaved configuration changes. If the running configuration has not been saved, choosing to save it ensures that your latest settings are available after the switch finishes rebooting.

 


Switch# reload

 


Packet Tracer Switch Config

These are the basics of Cisco switch configuration on Cisco Packet Tracer. You can add more configuration steps to these basic switch configuration steps and practice on your own packet tracer example. Doing more practice on such examples, we provide you more Cisco hands on experience. So, Packet Tracer Switch Configuration lesson is imortant for you!

 


 

Some Cisco Configuration Examples

Router DHCP Configuration with Packet Tracer

IPv6 Configuration on Cisco Packet Tracer

SSH Configuration on Packet Tracer

Common Cisco Router Configuration on Packet Tracer

 


What is Packet Tracer? | Download Packet Tracer 


Packet Tracer Labs Coure | Download Packet Tracer Labs


 

gokhan-kosem-instructor-ipcisco

Gokhan Kosem is a Network Engineer, Instructor and the Founder of IPCisco.com with 15+ years of experience in Cisco, Nokia, Huawei, Juniper, Linux, Service Provider Networks, Routing and Switching technologies.

He has worked on the backbone networks of major service providers and network vendors including Nortel, Alcatel-Lucent (Nokia) and has extensive hands-on experience with Cisco, Huawei, Juniper and Nokia networking technologies.

He has trained thousands of networking students worldwide through IPCisco.com, Udemy, books, labs, quizzes, and educational content across multiple social media platforms.

IPCisco.com | Best Route to Your Dreams

Lesson tags: Basic Cisco switch configuration, Switch Configuration, Networking Basics, cisco packet tracer, cisco CLI, Cisco switch, ccna
Back to: Cisco Packet Tracer Lab Course > Basic Router & Switch Configurations

Leave a Reply

Your email address will not be published. Required fields are marked *

ipcisco gold membership

Cisco Packet Tracer Lab Course

Collapse
Expand