interface range
Allows an administrator to group multiple physical or logical interfaces together and apply configuration commands to all of them simultaneously. This is an essential tool for rapid switch provisioning and adhering to bulk security policies.
Quick Reference
Switch(config)#Switch(config-if-range)#-) for blocks. Comma (,) for lists.define interface-range [name]Syntax & Parameters
| Formatting Rules | Description & Examples |
|---|---|
| Hyphenated Blocks | Used to select a contiguous block of ports. int range g0/1 - 24 |
| Comma Separated Lists | Used to select non-contiguous ports or mix entirely different interface types. You must specify the interface type again after the comma. int range fa0/1 - 12, gi0/1 - 2 |
CLI Deployment Scenarios
Scenario 1: Mass Edge Port Provisioning
You are configuring a new 48-port access switch. Ports 1 through 40 are going to be standard user wall jacks assigned to the Data VLAN (10).
Scenario 2: The Network Security Lockdown
A standard CCNA security best practice is to proactively shut down all unused ports on a switch to prevent unauthorized physical access.
CCNA Exam Gotchas
The Invalid Input Hyphen Trap
In many older versions of Cisco IOS (and specifically in the Packet Tracer simulator used for CCNA prep), you must put a space before and after the hyphen.
Typing int range g0/1-24 will fail with an "Invalid input" marker at the hyphen.
You must type int range g0/1 - 24.
The Comma Reset Error
When using a comma to separate lists, you cannot just list numbers. If you type int range g0/1 - 5, 10 - 15 the switch will reject it because it doesn't know what type of port "10" is. You must re-declare the interface type after every comma: int range g0/1 - 5, g0/10 - 15.