www.rodneybeede.com "I would love to change the world, but they won't give me the source code" - unknown
 Navigation

Quick Reference for Cisco Catalyst switch configuration - Last Modified 2012-03-07 16:29 UTC - Created 2011-07-13 21:32 UTC

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

Quick Tips

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.