Cisco Switch Basic Configuration – Explained
1■■ Accessing the Switch
Start in user EXEC mode (Switch>), use 'enable' to enter privileged EXEC mode (Switch#), then 'configure
terminal' to enter global configuration mode. This is required to configure the switch.
2■■ Setting a Hostname
Command:
Switch(config)# hostname Office-Switch
This changes the default 'Switch' prompt to 'Office-Switch', helping identify the device.
3■■ Setting an Enable (Privileged) Password
Command:
Switch(config)# enable secret MySecurePassword
Protects privileged mode with an encrypted password so only authorized users can change settings.
4■■ Configuring Console Access
Commands:
Switch(config)# line console 0
Switch(config-line)# password MyConsolePassword
Switch(config-line)# login
Switch(config-line)# exit
Secures physical console access with a password.
5■■ Configuring VTY (Remote) Access
Commands:
Switch(config)# line vty 0 4
Switch(config-line)# password MyVTYPassword
Switch(config-line)# login
Switch(config-line)# exit
Secures Telnet/SSH remote access with a password.
6■■ Enabling SSH (Preferred over Telnet)
Commands:
Switch(config)# ip domain-name [Link]
Switch(config)# crypto key generate rsa
Switch(config)# ip ssh version 2
Switch(config)# line vty 0 4
Switch(config-line)# transport input ssh
Switch(config-line)# login local
Switch(config-line)# exit
Switch(config)# username admin privilege 15 secret AdminPass123
Sets domain name, generates encryption keys, enables SSH version 2, restricts to SSH only, and creates a
local admin user.
7■■ Assigning an IP Address to the Switch (SVI)
Commands:
Switch(config)# interface vlan 1
Switch(config-if)# ip address [Link] [Link]
Switch(config-if)# no shutdown
Gives the switch a management IP address so you can manage it remotely.
8■■ Setting a Default Gateway
Command:
Switch(config)# ip default-gateway [Link]
Tells the switch where to send management traffic destined for other networks.
9■■ Saving the Configuration
Command:
Switch# copy running-config startup-config
Saves the running configuration to NVRAM so it persists after reboot.
■ Optional – Basic VLAN Creation
Commands:
Switch(config)# vlan 10
Switch(config-vlan)# name Sales
Switch(config-vlan)# exit
Switch(config)# interface fastEthernet 0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 10
Creates VLAN 10 named 'Sales' and assigns port Fa0/1 to it for network segmentation.