Basic Switch Configuration (Cisco)

A Cisco Catalyst Switch includes hundreds of commands to fulfill the requirement of network. In this article, I will explain the essential commands. As a instructor I can personally assure you that those individuals who spent time in learning the essential technologies have always had a much higher chance of success, both in exam and on job.

To take full advantage of this article I recommend you to use Packet Tracer software. Packet Tracer is a network simulator software developed by Cisco System for critical hands-on experience. This software includes all necessary devices for the practice of entry level cisco exams. You can download Packet Tracer freely from our site. For this article I assume that you have packet tracer installed on your system.

Command reference, mode, and, purpose

User EXEC: Allow you to connect with remote devices, perform basic tests, temporary change terminal setting, list system information

  • Switch>
  • Privileged EXEC: Allow you to set operating parameters. It also includes high level testing and list commands like show, copy, debug.

  • Switch#
  • Global Configuration: Contain commands those affect the entire system

  • Switch(config)#
  • Interface Configuration: Contain commands those modify the operation of an interface

  • Switch(config-if)#
  • VLAN configuration: Create new VLAN or configure, modify, delete existing VLAN.

  • Switch(config-vlan)#
  • Line configuration: Line configuration commands modify the operation of a terminal line. Line configuration commands always follow a line command, which defines a line number.

  • Switch(config-line)#
  • Example of Cisco Switch Basic Configuration

    switch>enable

    switch#configure terminal

    switch(config)#hostname switch1

    switch1(config)#line console 0

    swicth1(config-line)#password linecon4321

    switch1(config-line)#login

    switch1(config-line)#exit

    switch1(config)#line aux 0

    switch1(config)#line vty 0 15

    siwtch1(config-line)#telnet4321

    switch1(config-line)#login

    switch1(config--line)#exit

    switch1(config)#exit

    switch1#copy run start

    How to reset switch to factory defaults

    Switch>enable

    Switch#delete flash:vlan.dat

    Delete filename [vlan.dat]? [Press Enter Key]

    Delete flash:vlan.dat? [confirm] [ Reconfirm by pressing enter key]

    Switch#erase startup-config

    Switch#reload

    How to set IP address in Switch

    IP address is the address of device in network. Switch allows us to set IP address on interface level. IP address assigned on interface is used to manage that particular interface. To manage entire switch we have to assign IP address to VLAN1( Default VLAN of switch). We also have to set default gateway IP address from global configuration mode. In following example we would assign IP 172.16.10.2 255.255.255.0 to VLAN1 and set default gateway to 172.16.10.1.

    Switch>enable

    Switch#configure terminal

    Switch(config)#interface vlan1

    Switch(config-if)#ip address 172.16.10.2 255.255.255.0

    Switch(config-if)#exit

    Switch(config)#ip default-gateway 172.16.10.1

    How to set interface description

    Switches have several interfaces. Adding description to interface is a good habit. It may help you in finding correct interface. To add description use following commands. In following example we would add description Development VLAN to interface FastEthernet 0/1.

    Switch(config)#interface fastethernet 0/1

    Switch(config-if)#description Development VLAN

    How to clear mac address table

    Switch stores MAC addresses in MAC address table. Gradually it could be full. Once it full, switch automatically starts removing old entries. You can also clear these tables manually from privileged exec mode. To delete all entries use following command

    switch#clear mac address-table

    To delete only dynamic entries use

    switch#clear mac address-table dynamic

    How to add static MAC address in CAM table

    For security purpose sometime we have to add mac address in CAM table manually. To add static MAC address in CAM table use following command

    Switch(config)#mac address-table static aaaa.aaaa.aaaa vlan 1 interface fastethernet 0/1

    How to set duplex mode

    Switch automatically adjust duplex mode depending upon remote device. We could change this mode with any of other supported mode. For example to force switch to use full duplex mode use

    Switch(config)# #interface fastethernet 0/1

    Switch(config-if)#duplex full

    To use half duplex use

    Switch(config)# #interface fastethernet 0/1

    Switch(config-if)#duplex half

    How to show the version of IOS

    show version command provides general information about device including its model number, type of interfaces, its software version, configuration settings, location of IOS and configuration files, and available memories.

    Switch>show version

    How to show mac address table

    Switch stores MAC address of devices those are attached with its interfaces in CAM table. We can use show mac-address-table command to list all learned devices. Switch uses this table to make forward decision. See our previous article to learn more about switch functions.

    Switch>enable

    Switch#show mac-address-table

    How to show the running configuration

    Configuration parameter values are created, stored, updated and deleted from running configuration. Running configuration is stored in RAM. We can use show running-config command to view the running configuration.

    Switch>enable

    Switch#show running-config

    How to show startup config

    Any configuration stored in RAM is erased when devices is turned off. We can save running configuration in NVRAM. If we have saved running configuration in NVRAM, it would be automatically loaded back in RAM from NVRAM during the next boot. As switch load this configuration back in RAM in startup of device, at NVRAM it is known as startup-config.

    Switch>enable

    Switch#show startup-config

    How to show VLAN config

    Switch#show vlan

    How to show interface config

    show interface command displays information about interfaces. Without argument it would list all interfaces. To get information about specific interface we need to pass its interface number as an argument. For example to view details about FastEthernet 0/1, use show interface fastethernet 0/1.

    Switch#show interface

    Post a Comment

    Previous Post Next Post