RouteDuck

Switching and Cisco

Cisco Interface Configuration Generator

Paste interfaces and ranges, one block per line, and choose access or trunk settings. You get the configuration with full interface names and interface range commands.

A port or a range such as Gi1/0/1-24, with more after commas. Text after the interfaces becomes the description.
Port type
Empty leaves the VLAN as it is.
Empty for none.
Admin state

49 interfaces in 3 lines

Cisco IOS and IOS XE switches
interface range GigabitEthernet1/0/1 - 24
 description User ports
 switchport mode access
 switchport access vlan 10
 spanning-tree portfast
 spanning-tree bpduguard enable
!
interface range GigabitEthernet1/0/25 - 36 , GigabitEthernet2/0/25 - 36
 description Phones and desks, floor 2
 switchport mode access
 switchport access vlan 10
 spanning-tree portfast
 spanning-tree bpduguard enable
!
interface GigabitEthernet1/0/47
 description Reception printer
 switchport mode access
 switchport access vlan 10
 spanning-tree portfast
 spanning-tree bpduguard enable

Use PortFast only on ports that connect to end devices, never to another switch.

Enter the lines in global configuration mode. Interface names and numbering differ between switch models, so check them against show interfaces status first.

What you can paste

A port such as Gi1/0/5, a range such as Gi1/0/1-24, or several separated by commas. Abbreviations are expanded to the full type name. Anything after the interfaces on a line becomes the description for that block, so a list of ports and labels copied from a spreadsheet can be pasted as it is.

How interface range is written

A range is written with spaces around the hyphen and around each comma, the form every IOS version accepts. IOS takes up to five ranges in one interface range command, so a longer line is split into several blocks with the same settings.

What the settings do

An access port carries one VLAN, and optionally a voice VLAN for a phone. PortFast moves the port to forwarding at once and BPDU guard shuts it down if a switch is connected to it; both belong on ports for end devices only.

A trunk carries many VLANs. The allowed VLAN line this tool writes sets the whole list, which is right when the trunk is new. On switches that support both ISL and 802.1Q, the encapsulation has to be set before the port can be made a trunk; switches that support only 802.1Q reject that command.

Related tools