Basic Switch Configuration
Basic Switch Configuration
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.
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.
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".
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".
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".
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".
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
*************************************************
*************************************************
3) Configure a
==================================================
Solution
==================================================
Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname SW1
SW1(config)#exit
SW1(config)#banner motd $
Enter TEXT message. End with the character '$'.
*************************************************
*************************************************
$
SW1(config)#^Z
SW1#exit
*************************************************
*************************************************
SW1>
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#
*************************************************
*************************************************
Password:
SW1>en
Password:
SW1#
Link: https://www.youtube.com/watch?v=ZMC1YJB8CLs