Cisco VLAN Range

 

Release

Modification

12.0(7)XE

The interface range command was introduced.

12.1(5)T

The interface range command was integrated into Cisco IOS Release 12.1(5)T.

12.2(2)DD

The interface range command was expanded to enable configuration of subinterfaces.

C

onfiguring a Range of VLAN Subinterfaces

 
 

Command

Purpose

Step 1

Router(config)# interface range {{ethernet | fastethernet | gigabitethernet | atmslot/interface.subinterface – {{ethernet | fastethernet | gigabitethernet | atm}slot/interface.subinterface}

Selects the range of subinterfaces to be configured.

Note 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.

Step 2

Router(config-int-range)# encapsulation dot1Q vlan-id

Applies a unique VLAN ID to each subinterface within the range.

vlan-id—Virtual LAN identifier. The allowed range is from 1 to 4095.

The VLAN ID specified by the vlan-id argument is applied to the first subinterface in the range. Each subsequent interface is assigned a VLAN ID which is the specified vlan-id plus the subinterface number minus the first subinterface number (VLAN ID + subinterface number – first subinterface number).

Single Range Configuration Example

The following example configures the Fast Ethernet subinterfaces within the range 5/1.1 and 5/1.4 and applies the following VLAN IDs to those subinterfaces:

Fast Ethernet5/1.1 = VLAN ID 301 (vlan-id)

Fast Ethernet5/1.2 = VLAN ID 302 (vlan-id=301 + 2 – 1=302)

Fast Ethernet5/1.3 = VLAN ID 303 (vlan-id=301 + 3 – 1=303)

Fast Ethernet5/1.4 = VLAN ID 304 (vlan-id=301 + 4 – 1=304)

Router(config)# interface range fastethernet5/1.1 - fastethernet5/1.4 

Router(config-if)# encapsulation dot1Q 301

Router(config-if)# no shutdown 

Router(config-if)#