Cisco Interface Range Configuration
Description:
During configuration of a new user access switch or other device with a switchport module, it can be beneficial to range all of the ports with a default configuration to ensure uniformity and save time. The following example enters a range configuration for FastEthernet ports 1-48. You may need to modify FastEthernet to your own port type such as GigabitEthernet, and you also may need to modify the port numbers if you have a different amount or are saving some for trunk links.
[divider]
[tabs]
[tab title=”View Configuration”]
View the configuration:
interface range FastEthernet1 - 48
description ACCESS-PORT
switchport mode access
! Change the following vlans to match your network.
switchport access vlan 5
switchport voice vlan 10
! Remove the following 2 lines for any trunk ports.
spanning-tree portfast
spanning-tree bpuguard
! The following lines are strictly for security purposes and can be removed if desired.
no cdp enable
switchport port-security
switchport port-security mac-address sticky
switchport port-security maximum 2
! Remove the following to keep the ports closed initially.
no shutdown
end
[/tab]
[tab title=”Edit Configuration”]
Edit and Use:
[/tab]
[tab title=”Show Commands”]
- show int status
- show int status err-disabled
- show vlan brief (confirm what laye 2 vlans are created)
- show port-security int f0/4 (show information about a specific port)
[/tab]
[/tabs]