# Enter privileged EXEC mode
Switch> enable
# Enter global configuration mode
Switch# configure terminal
Switch(config)#
# Exit configuration mode
Switch(config)# exit
Switch(config)# end
Setting Hostname
# Set switch hostname
Switch(config)# hostname Switch1
Switch1(config)#
Password Configuration
# Set enable password (encrypted)
Switch1(config)# enable secret enable
# Set console password
Switch1(config)# line console 0
Switch1(config-line)# password console123
Switch1(config-line)# login
Switch1(config-line)# exit
SSH Configuration
Basic SSH Setup
# Set domain name
Switch1(config)# ip domain-name nasa.com
# Generate RSA key pair
Switch1(config)# crypto key generate rsa
# Choose key size (recommended: 1024 or 2048 bits)
# Set SSH version
Switch1(config)# ip ssh version 2
VTY Line Configuration
# Configure VTY lines 0-4 for SSH only
Switch1(config)# line vty 0 4
Switch1(config-line)# transport input ssh
Switch1(config-line)# login local
Switch1(config-line)# exit
# Disable VTY lines 5-15
Switch1(config)# line vty 5 15
Switch1(config-line)# transport input none
Switch1(config-line)# exit
User Account Management
# Create user with highest privilege
Switch1(config)# username admin privilege 15 secret nasa2025
# Create regular user
Switch1(config)# username user1 privilege 1 secret userpass
VLAN Configuration
Creating VLANs
# Create VLAN and assign name
Switch1(config)# vlan 10
Switch1(config-vlan)# name VLAN10
Switch1(config-vlan)# exit
Assigning Ports to VLANs
# Assign single port to VLAN
Switch1(config)# interface FastEthernet0/1
Switch1(config-if)# switchport mode access
Switch1(config-if)# switchport access vlan 10
Switch1(config-if)# exit
# Assign multiple ports to same VLAN
Switch1(config)# interface range fa0/1-5
Switch1(config-if-range)# switchport mode access
Switch1(config-if-range)# switchport access vlan 10
Switch1(config-if-range)# exit
# Show running configuration
Switch1# show running-config
# Show startup configuration
Switch1# show startup-config
# Show version information
Switch1# show version
# Show interfaces status
Switch1# show interfaces status
VLAN Information
# Show VLAN information
Switch1# show vlan brief
Switch1# show vlan
# Show interfaces and their VLAN assignments
Switch1# show interfaces switchport
EtherChannel Information
# Show EtherChannel summary
Switch1# show etherchannel summary
# Show port-channel information
Switch1# show interfaces port-channel 1
SSH and Security
# Show SSH connections
Switch1# show ssh
# Show users currently logged in
Switch1# show users
# Show crypto key information
Switch1# show crypto key mypubkey rsa
Saving Configuration
Save Commands
# Save running config to startup config
Switch1# copy running-config startup-config
Switch1# write memory # Alternative command
Switch1# wr # Shortest form
# Copy config to TFTP server
Switch1# copy running-config tftp