Friday, November 16, 2007

Cisco CAT: Speed Up Your Cisco Layer 2 Switch Configs

Speed Up Your Cisco Layer 2 Switch Configs

Everyone needs shortcuts, especially when there is a lot of work to do. Setting up your access-layer switches doesn't have to take more than a few commands to make the switch do just what you want it to do without sacrificing functionality or security. In an enterprise campus, there can be literally hundreds of access-layer switches functioning at layer 2 with VLANS and trunking and so on...so here are some shortcuts to speed up the time you take at each switch, and speed up the switch at the same time:

Scenario: Each access switch has already been set up with two trunk ports and one VLAN (we'll use VLAN 10 in our example for this specific switch). We need to assign all of the 10/100/1000 ports 1 - 48 to this VLAN and optimize the switch functionality at the same time with rapid spanning tree, optimal memory buffers and BPDU Guard or Filter for protection...so here goes:

AccessSW1(config)# spanning-tree mode rapid-pvst (enables rapid spanning tree, 802.1w)
AccessSW1(config)# spanning-tree portfast default (will enable portfast on all access ports only, trunks are unaffected)
AccessSW1(config)# spanning-tree bpduguard default (enables bpduguard as the default for all portfast ports)
AccessSW1(config)# sdm prefer vlan (optimizes memory buffers for layer 2 switching only)
AccessSW1(config)# interface range g01 - 48 (enters interface config mode on all 48 ports simultaneously)
AccessSW1(config-if-range)# switchport host (automatically sets the port as an access port, disables Etherchannel channeling and enables portfast, pretty cool shortcut command here...)
AccessSW1(config-if-range)# switchport access vlan 10 (assigns the 48 ports to the VLAN)

Of course this could easily be put into a text file and pasted into each switch as well. Save your configuration and you are all done. Simple shortcuts to save lots of time. :-)