You are on page 1of 6

Accessing the Switch

The first step in configuring a Cisco switch is to access the switch's


command-line interface (CLI). This can be done through a console cable or
through a Telnet or SSH connection. To access the switch through the
console, connect a console cable to the switch and a computer's serial port.
Then, open a terminal emulator software such as HyperTerminal on the
computer and set the baud rate to 9600. Press Enter and the switch's login
prompt will appear.

To access the switch through Telnet or SSH, use the command "telnet
[switch IP address]" or "ssh [switch IP address]" on the computer's command
prompt. The switch's login prompt will then appear.

Entering Configuration Mode

Once logged in, the switch will be in user mode. To enter configuration
mode, use the command "enable" to enter privileged mode and then
"configure terminal" to enter configuration mode. The prompt will change to
"switch(config)#" indicating that the switch is now in configuration mode.

Setting the Hostname

The hostname is the name assigned to the switch and is used to identify the
switch in the network. To set the hostname, use the command "hostname
[hostname]" in configuration mode. For example, to set the hostname to
"switch1", the command would be "hostname switch1".

Setting the IP Address and Default Gateway

The IP address and default gateway are used to communicate with other
devices on the network. To set the IP address and default gateway, use the
command "interface [interface number]" to enter interface configuration
mode. Then, use the command "ip address [IP address] [subnet mask]" to set
the IP address and "ip default-gateway [default gateway]" to set the default
gateway. For example, to set the IP address to 192.168.1.1 and the subnet
mask to 255.255.255.0, the command would be "ip address 192.168.1.1
255.255.255.0". To set the default gateway to 192.168.1.254, the command
would be "ip default-gateway 192.168.1.254".

Enabling and Disabling Interfaces

To enable or disable an interface, use the command "interface [interface


number]" to enter interface configuration mode. Then, use the command
"shutdown" to disable the interface or "no shutdown" to enable the
interface. For example, to disable interface Fa0/1, the command would be
"interface Fa0/1" followed by "shutdown". To enable the interface, the
command would be "interface Fa0/1" followed by "no shutdown".

Setting the VLAN

VLANs are used to segment a network into smaller logical networks. To set
the VLAN, use the command "vlan [VLAN number]" to enter VLAN
configuration mode. Then, use the command "name [VLAN name]" to set the
VLAN name. For example, to set VLAN 10 with the name "sales", the
command would be "vlan 10" followed by "name sales".

Configuring Port Security

Port security is used to restrict access to a switch port by limiting the


number of MAC addresses that can be learned on the port. To configure port
security, use the command "interface [interface number]" to enter interface
configuration mode. Then, use the command "switchport port-security" to
enable port security on the interface. To set the maximum number of MAC
addresses that can be learned on the port, use the command "switchport
port-security maximum [number of addresses]". For example, to enable port
security on interface Fa0/1 and set the maximum number of MAC addresses
to 2, the commands would be "interface Fa0/1" followed by "switchport
port-security" and "switchport port-security maximum 2".
Enabling Spanning Tree Protocol (STP)

STP is used to prevent loops in the network by electing a root bridge and
blocking certain ports. To enable STP, use the command "spanning-tree vlan
[VLAN number] root primary" in configuration mode. This will set the switch
as the primary root bridge for the specified VLAN. To set a specific interface
as the root port, use the command "spanning-tree vlan [VLAN number]
interface [interface number] root primary". For example, to enable STP on
VLAN 10 and set interface Fa0/1 as the root port, the commands would be
"spanning-tree vlan 10 root primary" and "spanning-tree vlan 10 interface
Fa0/1 root primary".

Saving Configuration Changes

Once all of the desired changes have been made, it is important to save the
configuration to the switch's non-volatile memory (NVRAM). This can be
done by using the command "copy running-config startup-config" in
configuration mode. This command will save the current configuration to
the switch's NVRAM so that it will be used when the switch is rebooted.
Cisco Packet Tracer Lab - Basic Switch Configuration | Hostname | MOTD
| Password
1) Configure the hostname of the Switch as SW1

2) Set a message of the day (MOTD) banner for the switch -

*************************************************

Only Authorized Users Allowed

*************************************************

3) Configure a

line console password - India@123

line vty - cisco

enable secret password - Cisco@123

==================================================

Solution

==================================================

1) Configure the hostname of the Switch as SW1

Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname SW1
SW1(config)#exit

2) Set a message of the day (MOTD) banner for the switch

SW1(config)#banner motd $
Enter TEXT message. End with the character '$'.
*************************************************

Only Authorized Users Allowed

*************************************************
$

SW1(config)#^Z
SW1#exit
*************************************************

Only Authorized Users Allowed

*************************************************

SW1>

3) Configure a line console password – Trial@123

ine vty - cisco

enable secret password - Cisco@123

SW1#config t
SW1(config)#line console 0
SW1(config-line)#password Trial@123
SW1(config-line)#login
SW1(config)#enable secret Cisco@123
SW1(config)#exit
SW1#

*************************************************

Only Authorized Users Allowed

*************************************************

User Access Verification

Password:

SW1>en
Password:
SW1#

Link: https://www.youtube.com/watch?v=ZMC1YJB8CLs

You might also like