Switch Configuration on Cisco Packet Tracer


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


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 ip address to VLAN 1.


IPCiscoSwitch (config)# interface Vlan1

IPCiscoSwitch (config-if)# ip address

IPCiscoSwitch (config-if)# exit



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#




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.


Press RETURN to get started.



Be Silent During The Configuration, I am Sleeping:)

User Access Verification




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

Back to: Cisco Packet Tracer Lab Course > Basic Configurations

Leave a Reply

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

Cisco Packet Tracer Lab Course