Selecting Ports to Configure

Before you can modify port settings, you must select one or more switch ports. Catalyst switches running the Catalyst operating system (CatOS) refer to these as ports, whereas switches running the Cisco IOS Software refer to them as interfaces. The BCMSN exam is based on IOS-based switches only.

To select a single switch port, enter the following command in global configuration mode:

Switch(config)# interface type module/number The port is identified by its Ethernet type (fastethernet, gigabitethernet, tengigabitethernet, or vlan), the physical module or "blade" where it is located, and the port number within the module. Some switches, such as the Catalyst 2950 and 3560, don't have multiple modules. For those models, ports have a module number of 0 (zero). As an example, the FastEthernet 0/14 interface is selected for configuration using the following command:

Switch(config)# interface fastethernet 0/14

The Catalyst 3750 is also a fixed-configuration switch, but it can be stacked with other switches in the 3750 family. Interfaces are referenced by module and port number, where the module number represents the switch position in the stack. For example, port 24 on the switch at position 2 in the stack would be referenced as FastEthernet 2/0/24.

Naturally, you can select and configure multiple interfaces in this fashion, one at a time. If you need to make many configuration changes for each interface, however, this can get very tedious. The Catalyst IOS Software also allows multiple interfaces to be selected in a single pass, through the interface range configuration command. After you select the range, any interface configuration commands entered are applied to each of the interfaces in the range.

To select several arbitrary ports for a common configuration setting, you can identify them as a "range" entered as a list. All port numbers and the commas that separate them must be separated with spaces. Use the following command in global configuration mode:

Switch(config)# interface range type module/number [, type module/number ...]

For example, to select interfaces FastEthernet 0/3, 0/7, 0/9, and 0/48 for configuration, you could use this command:

Switch(config)# interface range fastethernet 0/3 , fastethernet 0/7 , fastethernet 0/9 , fastethernet 0/48

You also can select a continuous range of ports, from a beginning interface to an ending interface. Enter the interface type and module, followed by the beginning and ending port number separated by a dash with spaces. Use this command in global configuration mode:

Switch(config)# interface range type module/first-number - last-number

For example, you could select all 48 FastEthernet interfaces on module 1 with the following command:

Switch(config)# interface range fastethernet 1/0 - 48

Finally, you sometimes need to make configuration changes to several groups or ranges of ports at the same time. You can define a macro that contains a list of interfaces or ranges of interfaces or both. Then, you can invoke the interface-range macro just before configuring the port settings. This applies the port settings to each interface that is identified by the macro. The steps for defining and applying this macro are as follows:

Step 1 Define the macro name and specify as many lists and ranges of interfaces as needed. The command syntax is open ended but follows the list and range syntax of the interface range commands defined previously:

Switch(config)# define interface-range macro-name type module/number [, type module/ number ...] [type module/first-number - last-number] [...]

Step 2 Invoke the macro called macro-name just as you would with a regular interface, just before entering any interface-configuration commands:

Switch(config)# interface range macro macro-name

As an example, suppose that you need to configure GigabitEthernet 2/1, 2/3 through 2/5, 3/1, 3/10, and 3/32 through 3/48 with a set of identical interface configurations. You could use the following commands to define and apply a macro, respectively:

Switch(config)# define interface-range MyGroup gig 2/1 , gig 2/3 - 2/5 , gig 3/1 , gig

3/10, gig 3/32 - 3/48 Switch(config)# interface range macro MyGroup

Remember to surround any commas and hyphens with spaces when you enter interface range commands.

Was this article helpful?

+1 0

Post a comment