Guest

Cisco IOS Software Releases 12.1 T

Interface Range Specification

Table Of Contents

Interface Range Specification

Feature Overview

Benefits

Restrictions

Supported Platforms

Supported Standards, MIBs, and RFCs

Configuration Tasks

Defining a Range Macro (Optional)

Configuring a Range of Interfaces (Required)

Verifying Configuration of a Range of Interfaces

Configuration Examples

Range Macro Definition Example

Single Range Configuration Example

Multiple Range Configuration Example

Command Reference

define interface-range

interface range


Interface Range Specification


This feature module describes the Interface Range Specification feature.

This document includes the following sections:

Feature Overview

Supported Platforms

Supported Standards, MIBs, and RFCs

Configuration Tasks

Configuration Examples

Command Reference

Feature Overview

The Interface Range Specification feature allows specification of a range of interfaces to which subsequent commands are applied and supports definition of macros that contain an interface range. The Interface Range Specification feature is implemented with the range keyword, which is used with the interface command. In the interface configuration mode with the range keyword, all entered commands are applied to all interfaces within the range until you exit interface configuration mode.

Benefits

The Interface Range Specification feature makes configuration easier because:

Identical commands can be entered once for a range of interfaces, rather than being entered separately for each interface.

Interface ranges can be saved as macros.

Restrictions

Each command you enter while you are in interface configuration mode with the range keyword is executed as it is entered. The commands are not batched together for execution after you exit interface mode. If you exit interface configuration mode while the commands are being executed, some commands may not be executed on some interfaces in the range. Wait until the command prompt reappears before exiting interface configuration mode.

The interface range command works only with VLAN interfaces that have been created with the interface vlan command (the show running-configuration command displays the VLAN interfaces). VLAN interfaces not displayed by the show running-configuration command cannot be used with the interface range command.

Supported Platforms

The Interface Range Specification feature runs on all platforms that support Cisco IOS Release 12.0(7)XE, Release 12.1 E, and Release 12.1(5)T.

Supported Standards, MIBs, and RFCs

None.

Configuration Tasks

See the following sections for configuration tasks for the Interface Range Specification feature. Each task in the list indicates if the task is optional or required.

Defining a Range Macro (Optional)

Configuring a Range of Interfaces (Required)

Defining a Range Macro (Optional)

To define an interface range macro, perform this task:

Command
Purpose

Router(config)# define interface-range macro_name {vlan vlan_ID - vlan_ID} | {{ethernet | fastethernet | gigabitethernet} slot/interface - interface} [, {{ethernet | fastethernet | gigabitethernet} slot/interface - interface}]

Define the interface-range macro and save it in NVRAM.


Configuring a Range of Interfaces (Required)

To configure a range of interfaces, perform this task:

Command
Purpose

Router(config)# interface range {macro macro_name}


Router(config)# interface range {vlan vlan_ID - vlan_ID} [, {vlan vlan_ID - vlan_ID}...]


Router(config)# interface range {{ethernet | fastethernet | gigabitethernet} slot/interface - interface} [, {{ethernet | fastethernet | gigabitethernet} slot/interface - interface}...]

Select the range of interfaces to be configured.

The space before the dash is required. For example, the command interface range fastethernet 1 - 5 is valid; the command interface range fastethernet 1-5 is not valid.

You can enter one macro or up to five comma-separated ranges.

Comma-separated ranges can include both VLANs and physical interfaces.

You are not required to enter spaces before or after the comma.


Verifying Configuration of a Range of Interfaces

Enter the show running-configuration command to verify interface configuration.

Configuration Examples

This section provides the following configuration examples:

Range Macro Definition Example

Single Range Configuration Example

Multiple Range Configuration Example

Range Macro Definition Example

This example shows how to define an interface-range macro named enet_list to select Fast Ethernet interfaces 5/1 through 5/4:

Router(config)# define interface-range enet_list fastethernet 5/1 - 4 
Router(config)# 

Single Range Configuration Example

This example shows how to reenable all Fast Ethernet interfaces 5/1 to 5/5:

Router(config)# interface range fastethernet 5/1 - 5 
Router(config-if)# no shutdown 
Router(config-if)#
*Oct  6 08:24:35: %LINK-3-UPDOWN: Interface FastEthernet5/1, changed state to up
*Oct  6 08:24:35: %LINK-3-UPDOWN: Interface FastEthernet5/2, changed state to up
*Oct  6 08:24:35: %LINK-3-UPDOWN: Interface FastEthernet5/3, changed state to up
*Oct  6 08:24:35: %LINK-3-UPDOWN: Interface FastEthernet5/4, changed state to up
*Oct  6 08:24:35: %LINK-3-UPDOWN: Interface FastEthernet5/5, changed state to up
*Oct  6 08:24:36: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet5/
5, changed state to up
*Oct  6 08:24:36: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet5/
3, changed state to up
*Oct  6 08:24:36: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet5/
4, changed state to up
Router(config-if)#

Multiple Range Configuration Example

This example shows how to use a comma to add different interface type strings to the range to reenable all Fast Ethernet interfaces in the range 5/1 to 5/5 and both Gigabit Ethernet interfaces 1/1 and 1/2:

Router(config-if)# interface range fastethernet 5/1 - 5, gigabitethernet 1/1 - 2 
Router(config-if)# no shutdown 
Router(config-if)#
*Oct  6 08:29:28: %LINK-3-UPDOWN: Interface FastEthernet5/1, changed state to up
*Oct  6 08:29:28: %LINK-3-UPDOWN: Interface FastEthernet5/2, changed state to up
*Oct  6 08:29:28: %LINK-3-UPDOWN: Interface FastEthernet5/3, changed state to up
*Oct  6 08:29:28: %LINK-3-UPDOWN: Interface FastEthernet5/4, changed state to up
*Oct  6 08:29:28: %LINK-3-UPDOWN: Interface FastEthernet5/5, changed state to up
*Oct  6 08:29:28: %LINK-3-UPDOWN: Interface GigabitEthernet1/1, changed state to
 up
*Oct  6 08:29:28: %LINK-3-UPDOWN: Interface GigabitEthernet1/2, changed state to
 up
*Oct  6 08:29:29: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet5/
5, changed state to up
*Oct  6 08:29:29: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet5/
3, changed state to up
*Oct  6 08:29:29: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet5/
4, changed state to up
Router(config-if)#

Command Reference

This section documents the new commands that comprise the Interface Range Specification feature.

define interface-range

interface range

define interface-range

Use the define interface-range command to create an interface-range macro.

define interface-range macro-name interface-range

Syntax Description

macro-name

Name of the interface-range macro; up to 32 characters.

interface-range

Interface range; for a list of valid values for interface ranges, see the "Usage Guidelines" section.


Defaults

This command has no default setting.

Command Modes

Global configuration mode.

Command History

Release
Modification

12.0(7)XE

This command was introduced.

12.1(5)T

Support for this command was extended to the T train.


Usage Guidelines

The macro name is a 32-character maximum character string.

A macro can contain up to five ranges. An interface range cannot span slots.

When entering the interface-range, these formats can be used:

card-type{slot}/{first-interface} - {last-interface}

card-type {slot}/{first-interface} - {last-interface}

Valid values for card-type are:

Ethernet

FastEthernet

GigabitEthernet

Vlan vlan

Examples

This example shows how to create a multiple-interface macro:

Router(config)# define interface-range macro1 ethernet 1/2 - 5, fastethernet 5/5 - 10
Router(config)#

Related Commands

interface range

interface range

Use the interface range command to execute a command on multiple interfaces at the same time.

interface range {interface-range | macro name}

Syntax Description

interface-range

interface range; for a list of valid values for interface-range, see the "Usage Guidelines" section for additional information.

macro name

Keyword and variable to specify the name of a macro.


Defaults

This command has no default setting.

Command Modes

Global or interface configuration mode.

Command History

Release
Modification

12.0(7)XE

This command was introduced.

12.1(5)T

Support for this command was extended to the T train.


Usage Guidelines

You cannot use the interface range command to create switch virtual interfaces (SVIs). You must create SVIs with individual interface VLAN commands. You can use the interface range command on existing VLAN SVIs. To display VLAN SVIs, enter the show running config command. VLANs not displayed cannot be used in the interface range command.

The commands entered under the interface range command are applied to all existing VLAN SVIs.

Before you can use a macro, you must define it with the define interface-range command.

All configuration changes made to a range of interfaces are saved to NVRAM, but the range itself does not get saved to NVRAM. Use the define interface-range command to create and save a range.

You can enter the range in two ways:

Specifying up to five interface ranges

Specifying a previously defined macro

You can either specify the interfaces or the name of a range macro. A range must consist of the same interface type, and the interfaces within a range cannot span slots.

You can define up to five interface ranges on a single command, with each range separated by a comma.

When you define a range, you must enter a white space between the first interface and the hyphen (-):

interface range gigabitethernet 7/1 -7, gigabitethernet9/5 -408.

When you define a VLAN range, valid values are from 1 to 1005. The last VLAN number cannot exceed 1005.

When entering the interface-range, these formats can be used:

card-type{slot}/{first-interface} - {last-interface}

card-type {slot}/{first-interface} - {last-interface}

Valid values for card-type are:

Ethernet

FastEthernet

GigabitEthernet

Vlan vlan

You cannot specify both a macro and an interface range in the same command. After creating a macro, the CLI does not allow you to enter additional ranges. Likewise, if you have already entered an interface range, the CLI does not allow you to enter a macro.

A single interface can also be specified in interface-range (this would make the command similar to the interface interface-number command).

Examples

This example shows how to use the interface range command to interface to two interface ranges:

Router(config)# interface range fastethernet 5/18 - 20, ethernet 3/1 - 24
Router(config-if)#

This command shows how to execute a range macro:

Router(config)# interface range macro macro1
Router(config-if)#

Related Commands

define interface-range