05-11-2007 02:16 AM - edited 03-05-2019 04:00 PM
hi all
For example I want configure vlan 16 to 5-ports at a time in cisco 2950 if its possible give proper command.
Solved! Go to Solution.
05-11-2007 02:43 AM
Hi ,
interface range
To execute commands on multiple subinterfaces at the same time, use the interface range command in global configuration mode.
interface range {{ethernet | fastethernet | gigabitethernet | atm | vlan vlan} slot/interface.subinterface - {ethernet | fastethernet | gigabitethernet | atm | vlan vlan} slot/interface.subinterface | macro macro-name}
Subinterface Groups
Subinterfaces specified by the interface range command are grouped into a configurable subinterface group. Subinterfaces that are specified by the interface range command and that have not been previously created are created by the interface range command.
The no interface range command is not supported. You must delete individual subinterfaces to delete a range.
Configuration Changes
All configuration changes made to a range of subinterfaces 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 specify either 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 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.
The spaces around the dash in the interface range command syntax are required. For example, the command interface range fastethernet 1 - fastethernet 5 is valid; the command interface range fastethernet 1-fastethernet 5 is not valid.
05-11-2007 02:26 AM
Hi Friend,
You can use range command
config t
interface range fa0/1 - 5
switchport mode access
switchport access vlan 16
Remember the space between the ports 1 "space" - "space" 5
HTH
Ankur
*Pls rate all helpfull post
05-11-2007 02:37 AM
hi ankur
thank u 4 ur response, but i have small confusion with command that is "interface range fa0/1 - 5" or interface range f0/1 - 5"
05-11-2007 02:41 AM
Hi Friend,
Both will work fine.
HTH
Ankur
*Pls rate all helpfull post
05-11-2007 02:43 AM
Hi ,
interface range
To execute commands on multiple subinterfaces at the same time, use the interface range command in global configuration mode.
interface range {{ethernet | fastethernet | gigabitethernet | atm | vlan vlan} slot/interface.subinterface - {ethernet | fastethernet | gigabitethernet | atm | vlan vlan} slot/interface.subinterface | macro macro-name}
Subinterface Groups
Subinterfaces specified by the interface range command are grouped into a configurable subinterface group. Subinterfaces that are specified by the interface range command and that have not been previously created are created by the interface range command.
The no interface range command is not supported. You must delete individual subinterfaces to delete a range.
Configuration Changes
All configuration changes made to a range of subinterfaces 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 specify either 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 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.
The spaces around the dash in the interface range command syntax are required. For example, the command interface range fastethernet 1 - fastethernet 5 is valid; the command interface range fastethernet 1-fastethernet 5 is not valid.
05-11-2007 02:44 AM
VLAN Ranges
When you define a VLAN range, valid values are from 1 to 4095. The last VLAN number cannot exceed 4095.
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.
Examples
The following example shows how to use the interface range command to configure a subinterface range:
Router(config)# interface range ethernet1/0.11 - ethernet1/0.60
Router(config-int-range)#
The following example configures the Fast Ethernet subinterfaces within the range from 5/1.1 to 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)#
*Oct 6 08:24:35: %LINK-3-UPDOWN: Interface FastEthernet5/1.1, changed state to up
*Oct 6 08:24:35: %LINK-3-UPDOWN: Interface FastEthernet5/1.2, changed state to up
*Oct 6 08:24:35: %LINK-3-UPDOWN: Interface FastEthernet5/1.3, changed state to up
*Oct 6 08:24:35: %LINK-3-UPDOWN: Interface FastEthernet5/1.4, changed state to up
*Oct 6 08:24:36: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet5/1.1,
changed state to up
*Oct 6 08:24:36: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet5/1.2,
changed state to up
*Oct 6 08:24:36: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet5/1.3,
changed state to up
*Oct 6 08:24:36: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet5/1.4,
changed state to up
Hope it helps you...
Thanks,
Satish
05-11-2007 03:10 AM
hi satish,
Thank u 4 ur good guide, I got so much knowledge and my doubt also been cleared.
Thanks again.
Regards,
naidu.
05-11-2007 09:45 PM
Hi satish,
It's Ok and I got so much knowledge by your explanation but when I want assign single vlan to multiple interfaces at a time.
For example vlan 105 I want assign to interface 24, 33, 36, 42, 44, 47 at a time then how what is the right command shall we use plz.
05-12-2007 12:22 AM
Hi,
You won't be able to use the range command, you'll have to do it separately per each interface, as they are discontigous.
conf t
interface fa0/x
switchport mode access
switchport access vlan y
HTH, please do rate all helpful replies,
Mohammed Mahmoud.
05-12-2007 07:02 AM
Hi Mahmoud,
It's possible even if the interface list is discontigous.
Switch(config)#int range gig1/0/1,gig1/0/5, gig1/0/10
Switch(config-if-range)#switchport mode access
Switch(config-if-range)#switchport access vlan 105
That's the beauty of Cisco IOS, you get most of the things what you want.
Regards,
Ankur
*Pls rate all helpfull post
05-12-2007 07:22 AM
Hi Ankur,
Nice, deserves the 5 :)
Cisco IOS is indeed a beauty.
BR,
Mohammed Mahmoud.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide