Anyway, this is a quick and dirty one that I cannot remember to save my life. In this instance I wanted to configure a few ports on a 2950 that I plan to use to replace my 2960, as my 2960 is destined for bigger and better things given its layer 3 capabilities.
Note the spaces between the first port in the range, the dash, and the last port in the range.
s-2950-1.localdomain(config)#interface range fastEthernet 0/9 – 16
s-2950-1.loc(config-if-range)#description vlan 1 ports
s-2950-1.loc(config-if-range)#switchport mode access
s-2950-1.loc(config-if-range)#switchport access vlan 1
s-2950-1.loc(config-if-range)#spanning-tree portfast%Warning: portfast should only be enabled on ports connected to a single
host. Connecting hubs, concentrators, switches, bridges, etc… to this
interface when portfast is enabled, can cause temporary bridging loops.
Use with CAUTION%Portfast will be configured in 8 interfaces due to the range command
but will only have effect when the interfaces are in a non-trunking mode.s-2950-1.loc(config-if-range)#spanning-tree bpduguard enable
s-2950-1.loc(config-if-range)#end
s-2950-1.localdomain#copy run start
Related articles