interface range [type] [range]
Configures multiple interfaces of the same type simultaneously using a range or comma-separated list, enabling bulk configuration changes like VLAN assignment or port security.
interface range [type] [range]When to Use This Command
- Assigning all FastEthernet ports 0/1-24 to VLAN 10 on a switch
- Enabling spanning-tree PortFast on a range of access ports
- Shutting down a group of unused interfaces to save power
- Applying QoS policies to a set of GigabitEthernet interfaces
Command Examples
Configure a range of FastEthernet interfaces
interface range FastEthernet0/1-24Switch(config)# interface range FastEthernet0/1-24 Switch(config-if-range)# switchport mode access Switch(config-if-range)# switchport access vlan 10 Switch(config-if-range)# spanning-tree portfast Switch(config-if-range)# no shutdown
The command enters interface range configuration mode for FastEthernet ports 0/1 through 0/24. Subsequent commands apply to all 24 interfaces. 'switchport mode access' sets them as access ports, 'switchport access vlan 10' assigns VLAN 10, 'spanning-tree portfast' enables PortFast to speed up convergence, and 'no shutdown' ensures they are administratively up.
Configure non-contiguous interfaces using comma
interface range GigabitEthernet0/1, GigabitEthernet0/3, GigabitEthernet0/5Switch(config)# interface range GigabitEthernet0/1, GigabitEthernet0/3, GigabitEthernet0/5 Switch(config-if-range)# description Uplink-to-Core Switch(config-if-range)# no shutdown
This selects three specific interfaces (0/1, 0/3, 0/5) using commas. The 'description' command adds a common description to all three, and 'no shutdown' brings them up. Note that spaces after commas are optional but improve readability.
Understanding the Output
The 'interface range' command itself produces no output beyond the prompt change to '(config-if-range)#'. All subsequent commands are applied to every interface in the range. Use 'show running-config interface [type] [number]' to verify changes on individual interfaces. Look for consistent configuration across the range; common mistakes include forgetting to exit the range mode before applying commands to a different interface set.
CCNA Exam Tips
CCNA exam tip 1: Remember that the range syntax uses a hyphen for contiguous ports (e.g., Fa0/1-24) and commas for non-contiguous (e.g., Gi0/1, Gi0/3). No spaces around the hyphen.
CCNA exam tip 2: You cannot mix interface types in a single range command (e.g., FastEthernet and GigabitEthernet together).
CCNA exam tip 3: The exam may test that 'interface range' is a global config command, not interface config. You must be in global config mode first.
CCNA exam tip 4: After applying commands in range mode, use 'do show run | section interface' to verify the configuration on multiple interfaces quickly.
Common Mistakes
Mistake 1: Using a space around the hyphen (e.g., Fa0/1 - 24) — this is invalid syntax and will be rejected.
Mistake 2: Trying to apply 'interface range' from interface config mode instead of global config — results in '% Invalid input detected'.
Mistake 3: Forgetting that 'no shutdown' is needed after configuring a range; interfaces may remain administratively down.
Related Commands
interface [type] [number]
Enters interface configuration mode for a specific interface (e.g., GigabitEthernet0/1) to configure Layer 2 or Layer 3 parameters.
show running-config
Displays the current active configuration in DRAM, showing all non-default settings.
spanning-tree portfast
Enables PortFast on an interface to immediately transition from blocking to forwarding state, bypassing STP listening and learning phases, used on access ports connected to end devices to speed up convergence.
switchport access vlan [vlan-id]
Assigns a specific VLAN to an access port, placing the port in that VLAN for untagged traffic.
Practice for the CCNA 200-301
Test your knowledge with hundreds of CCNA practice questions covering all exam domains.
Practice CCNA Questions