Cisco Switch Configuration basic commands

Cisco switches are widely used in enterprise networks for their reliability and advanced features. However, configuring these switches can be a daunting task for those new to networking. In this article, we will cover some basic commands that are commonly used when configuring Cisco switches.

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.

Console Access: Connect a console cable to the switch and a computer's serial port. Open terminal emulator software such as PuTTY and set the baud rate to 9600. Press Enter and the switch's login prompt will appear.

Remote Access: Use Telnet or SSH commands to connect remotely:

telnet [switch IP address]
ssh [switch IP address]

Entering Configuration Mode

Once logged in, the switch will be in user mode. To enter configuration mode, use these commands:

Switch> enable
Switch# configure terminal
Switch(config)#

The prompt changes to Switch(config)# indicating configuration mode is active.

Setting the Hostname

The hostname identifies the switch in the network. Set it using:

Switch(config)# hostname SW-Office-1
SW-Office-1(config)#

Configuring Management Interface

For switch management, configure the VLAN 1 interface with an IP address:

Switch(config)# interface vlan 1
Switch(config-if)# ip address 192.168.1.10 255.255.255.0
Switch(config-if)# no shutdown
Switch(config-if)# exit
Switch(config)# ip default-gateway 192.168.1.1

Managing Switch Ports

To enable or disable specific interfaces:

Switch(config)# interface fastethernet 0/1
Switch(config-if)# no shutdown
Switch(config-if)# exit

Switch(config)# interface fastethernet 0/2
Switch(config-if)# shutdown

Use no shutdown to enable and shutdown to disable ports.

Creating and Managing VLANs

VLANs segment networks into logical groups. Create VLANs using:

Switch(config)# vlan 10
Switch(config-vlan)# name Sales
Switch(config-vlan)# exit

Switch(config)# vlan 20
Switch(config-vlan)# name Engineering
Switch(config-vlan)# exit

Assign ports to VLANs:

Switch(config)# interface fastethernet 0/5
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 10

Basic Port Security

Port security restricts access by limiting MAC addresses per port:

Switch(config)# interface fastethernet 0/3
Switch(config-if)# switchport mode access
Switch(config-if)# switchport port-security
Switch(config-if)# switchport port-security maximum 2
Switch(config-if)# switchport port-security violation restrict

Essential Show Commands

Use these commands to verify configuration and monitor status:

Switch# show running-config
Switch# show vlan brief
Switch# show interface status
Switch# show mac address-table
Switch# show port-security interface fastethernet 0/3

Saving Configuration

Save your configuration to prevent loss during reboot:

Switch# copy running-config startup-config

Or use the shorter command:

Switch# write memory

Conclusion

These basic Cisco switch configuration commands provide the foundation for network management. Mastering hostname assignment, VLAN creation, port management, and configuration saving enables effective switch administration. Always save your configuration and refer to Cisco documentation for advanced features specific to your network requirements.

Updated on: 2026-03-16T23:36:12+05:30

4K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements