9-8
Catalyst 2950 Desktop Switch Software Configuration Guide
78-14982-01
Chapter 9 Configuring the Switch Interfaces
Using the Inter fa ce Comma nd

Configur ing an d Using Inter f ace- Ra nge Ma cros

You can create an interface-range macro to automatically select a range of interfaces for configuration.
Before you can use the macro keyword in t h e i nterf ace ra nge macro glob al co nfigurat ion c omm and
string, you mu st use the d efine inte rface- ra nge gl obal co nfigurati on comm a nd to d efine the m a cro.
Beginning i n privileged EX EC mo de, foll ow these s teps to d efine an i nterfac e-ra nge ma cro:
Use the no define interface-range macro_name global configuration command to delete a macro.
When using the define interface-range global configuration command, note these guidelines:
Valid entries for interface-range:
vlan vlan-ID - vlan-ID, wher e VLAN ID is from 1 to 1005 wit h the SI installe d or 1 to 4094
with the EI installed
fastethernet slot/{first port} - {last port}, wh er e sl ot i s 0
gigabitethernet slot/{fi r s t po rt } - {last port }, where slot is 0
port-channel port-channel-number - port-channel-number, where port-channel-number is
from 1 to 6.
You must add a space between the interface numbers and the hyphen when entering an
interface-range. For example, fastether n et 0/1 - 5 is a v alid range ; fastet her net 0/1-5 is not a v a lid
range.
The VLAN interfaces must have been configured with the interface vlan command. The show
running-config priv ileged EXEC comm and ou tput sh ows the configure d VLAN in ter f ac es. VLAN
interfaces tha t do no t a ppea r by u sing the show running-config co mm and c a nno t be u sed a s
interface-ranges.
All interfaces in a range must be the same type; that is, all Fast Ethernet ports, all Gigabit Ethernet
ports, all EtherChannel ports, or all VLANs, but you can combine multiple interface types in a
macro.
Command Purpose
Step 1 configure terminal Enter globa l configurati on mode.
Step 2 define interface-range macro_name
interface-range Define the interface-range macro, and save it in NVRAM.
The macro_name is a 32-character maximum character string.
A macro can contain up to five comma-separated interface
ranges. You do not need to enter spaces before or after the comma.
Each interface-range must consist of the sa me port type .
Step 3 interface range macro macro_name Select the interface range to be configured by using the values saved
in the interface-range macro called macro_name.
You c a n n ow use the no rmal c on figurati on co mman ds t o appl y t he
configuration to all interfaces in the defined macro.
Step 4 end Return to privileged EXEC mode.
Step 5 show running-config | include define Show the defined interface-ra nge macr o configurat ion.
Step 6 copy running-config startup-config (Optiona l) Save your entries in the co nfigurati on file.