Quick Reference for Cisco Catalyst switch configuration

Last Modified: Wed, 07 Mar 2012 16:29:42 +0000 ; Created: Wed, 13 Jul 2011 21:32:15 +0000

Below have been tested on Cisco Catalyst 2900XL (IOS version 12.0(5)WC17) and 3750 (IOS version 12.2(55)SE3).

Quick Tips

  • Type in exit multiple times if needed to get back to the welcome screen.
  • enable and config terminal are common needed starts
  • dir flash:
  • Console serial settings: 9600, 8, No parity, 1 Stop bit, No flow (Applying Correct Terminal Emulator Settings for Console Connections)
  • PuTTY is good for the serial console, but lacks XMODEM for flash recovery. Try Tera Term instead.
  • Most confirm dialogs don't want you to type in 'y' or 'n', just press enter.
  • show vlan also gets you a list of vlan configurations (except trunk mode)
  • show interface GigabitEthernet 1/0/1 switchport - Display configuration (including if trunking) for a particular interface
  • show interface status - Show current status of each interface along with vlan or trunk mode
  • show interfaces trunk - Show which interfaces are in trunk mode. Note that if the interface is in a notconnect state it won't show up as being in trunk mode but instead in vlan 1.

Reset to defaults (leaves vlan config alone)

enable
write erase
(press enter to confirm)
reload
(press enter to confirm)

Reset VLAN settings

enable
delete flash:vlan.dat
(press enter to confirm)
(press enter again to confirm)
reload
(press enter to confirm)
If after the reload your vlan.dat shows back up your IOS version does VLANs differently (auto-creation of VLAN for interface assignment). Repeat the steps again, but before doing "reload" issue the command write erase to reset everything. This behavior occurs in Cisco IOS version 12.0(5)WC17 for my 2900XL. Another option is to delete each vlan manually by hand or if you have a newer IOS use "no vlan range #-#".

Create VLAN

enable
vlan database
vlan 10 name vlan10	(name vlan10 is optional)
exit

Some versions of IOS mark this method as deprecated. This is another way

enable
configure terminal
vlan ###  (### is the vlan number you want)
name VLAN####  (name for the vlan)
state active
exit
exit
show vlan
write
exit

Assign single port to VLAN

enable
configure terminal
interface FastEthernet 0/1	(where /# is port number, also GigabitEthernet)
switchport access vlan 10
exit
exit
write memory

Assign multiple ports to VLAN at once (3750 only or IOS 12.1+)

enable
configure terminal
interface range GigabitEthernet 1/0/1-24
switchport access vlan 10
exit
exit
write memory

Setup port to trunk with 802.1q

enable
configure terminal
interface GigabitEthernet 1/0/1
switchport trunk encapsulation dot1q
switchport mode trunk
no shutdown
exit
exit
write memory
reload

Note that the switch may not automatically carry tagged traffic for a VLAN unless you define the VLAN first. You don't have to set a particular port to the VLAN, it just has to exist. See Create VLAN.