Configure multiple interfaces simultaneously using the interface range command to save time and ensure consistent settings.
Step 1: Enter interface range mode
Select a continuous range of interfaces to configure together.
1
2
3
4
|
SW1>enable
SW1#configure terminal
SW1(config)#interface range gigabitEthernet 0/1-24
SW1(config-if-range)#
|
Step 2: Configure basic access port settings
Apply common access port configurations to all interfaces in the range.
1
2
3
4
5
6
7
|
SW1(config-if-range)#switchport mode access
SW1(config-if-range)#switchport access vlan 10
SW1(config-if-range)#switchport port-security
SW1(config-if-range)#switchport port-security maximum 2
SW1(config-if-range)#switchport port-security violation restrict
SW1(config-if-range)#spanning-tree portfast
SW1(config-if-range)#spanning-tree bpduguard enable
|
Step 3: Configure non-continuous ranges
Use comma-separated values to configure specific interfaces that aren’t in sequence.
1
2
3
4
5
|
SW1(config)#interface range gi0/1-5, gi0/10-15, gi0/20
SW1(config-if-range)#description User Access Ports
SW1(config-if-range)#switchport access vlan 20
SW1(config-if-range)#no shutdown
SW1(config-if-range)#exit
|
Step 4: Configure trunk ports range
Set up multiple uplink interfaces as trunk ports.
1
2
3
4
5
6
7
|
SW1(config)#interface range gi0/47-48
SW1(config-if-range)#description Uplink Trunks
SW1(config-if-range)#switchport mode trunk
SW1(config-if-range)#switchport trunk allowed vlan 10,20,30,40
SW1(config-if-range)#switchport trunk native vlan 99
SW1(config-if-range)#no shutdown
SW1(config-if-range)#end
|
Step 5: Verify the configuration
1
2
3
|
SW1#show running-config | section interface GigabitEthernet0/1
SW1#show interfaces status
SW1#show vlan brief
|
Key Points:
- Range mode applies commands to ALL interfaces in the specified range
- Use
interface range for FastEthernet (fa), GigabitEthernet (gi), or TenGigabitEthernet (te)
- Commands entered in range mode cannot be undone individually - affects entire range
- Always verify configuration before applying to production interfaces