Cisco "interface range" Command Explained
interface range — lets you configure many ports at once — one command block applied to a whole range instead of port-by-port repetition. Runs in global configuration mode.
Syntax and common variants
| Variant | Purpose |
|---|---|
interface range fa0/1 - 24 | All 24 ports at once |
interface range gi0/1 - 4 , gi0/10 | Ranges plus individual ports |
interface range vlan 10 - 12 | Ranges of SVIs work too |
Reading the output
| Output / element | Meaning |
|---|---|
config-if-range prompt | Everything you type now applies to all selected ports |
(example) | switchport access vlan 10 across fa0/1-24 in one shot |
When to use it
The batch-work tool: putting 24 ports in a VLAN, enabling portfast on all access ports, shutting a block of unused ports for security. Five minutes of typing becomes one command — and consistency across ports prevents “that one port” mysteries. Browse more in the command reference or practise in the free labs.
Frequently asked questions
Can I mix different ranges in one command?
Yes — separate with commas: interface range fa0/1 - 8 , fa0/20 - 24, spaces around the hyphen included.
Does it work for everything?
Most interface-level commands apply; per-port unique settings (like distinct IPs) obviously can't be ranged.
Is there a way to save a frequently-used range?
Yes — define macro with interface range macro
Related articles
Want hands-on training?
Learn this on real Cisco lab devices with placement support at Attila Technologies, Ahmedabad.