Cisco Switchport & Trunk Config Generator

Generate Cisco IOS and IOS XE switchport configuration for access ports, standalone trunks, Port-channel interfaces, and EtherChannel members, with interface range grouping and copy or download output.

Built by a network engineerCalculations run locally in your browserNo signup requiredNetwork information is not transmitted to our servers

Platform and options

VLANs from other tools

Loaded VLANs appear as suggestions in the VLAN fields below. Typing any VLAN ID still works.

No VLANs loaded. Use Send to Switchport Generator in the Multi-VLAN Planner or the Cisco VLAN & SVI Generator to load them here, or type VLAN IDs by hand.

Interfaces

Add one entry per interface. Member interfaces join a Port-channel, so set the Port-channel itself as its own entry.

Interface 1

Full name, such as GigabitEthernet1/0/10.

Optional.

Optional.

Turn these on only when a host or phone is the only device expected on this port.

Only where the port supports it.

Only where the port supports it.

1 of 48 interfaces

Existing configuration (optional)

Paste the output of a show command for the interfaces you are changing. The text is only read as plain text. It is never run.

0 of 16,384 characters

Configuration output

Fix the errors above to generate configuration. Each interface needs a valid name and role-specific settings.

Access ports and trunks

An access port carries one VLAN, which is what a PC, printer, or IP phone expects. A trunk carries several VLANs at once, tagged so the far end knows which VLAN each frame belongs to. Switch-to-switch and switch-to-router links are normally trunks. Hosts are normally access ports.

Native and voice VLANs

The native VLAN on a trunk carries untagged frames. Both ends of the trunk must agree on it, or traffic can leak between VLANs. A voice VLAN on an access port lets a phone tag its voice traffic while the attached PC stays on the access VLAN. The voice VLAN must differ from the access VLAN, and the generator blocks identical values.

PortFast and BPDU Guard

  • PortFast lets a port skip spanning-tree listening and learning, so a host connects without a delay. Use it only on ports where a single end device connects.
  • BPDU Guard shuts a PortFast port down if a switch is plugged into it. This protects the network from an accidental loop, and it pairs well with PortFast on host ports.
  • Never enable PortFast on a switch-to-switch uplink.

Allowed VLAN lists are replaced, not added to

switchport trunk allowed vlan sets the complete list of VLANs a trunk carries. Entering 10,20 removes VLAN 30 from the trunk if it was previously allowed. Compare the list with the current trunk before applying it. The generator warns whenever a trunk command is produced for this reason.

Port-channels and EtherChannel members

An EtherChannel bundles several physical links into one logical link. The logical interface, called Port-channel, holds the VLAN settings. Each physical member joins it with a channel-group command and takes its VLAN settings from the Port-channel. Set native and allowed VLANs on the Port-channel entry, not on its members.

LACP (802.3ad) negotiates the bundle. Active mode starts negotiation, and passive mode only responds. Both ends of a bundle must match in speed, duplex, and VLAN settings, or the bundle will not form cleanly.

Interface ranges

Ports with identical settings and consecutive numbers can be grouped into a single interface range block. Grouping is limited to access and trunk ports. Port-channels and members are always written individually, so a channel change never applies to a whole range by accident. Ports with differing descriptions or settings are not grouped.

Working on live links

  • Changing a trunk's allowed VLANs or joining a link to a channel group can interrupt live traffic.
  • Apply uplink and Port-channel changes in a planned window, one link at a time where the design allows.
  • Keep the current configuration of each interface so you can roll back.
  • Check that the VLANs exist on the switch (see the VLAN and SVI generator) before allowing them on a trunk.

Before you apply the configuration

  • Confirm the interface names match your switch model, including slot and module numbers.
  • Confirm the platform supports each speed, duplex, and channel setting you chose.
  • Use the existing configuration panel to spot interfaces already in a channel group.
  • Check the channel group number is free or already defined as the same Port-channel.

Common mistakes

  • Setting VLANs on members: the Port-channel controls them, so configure the logical interface.
  • Forgetting the allowed list is a replacement: a short list silently removes VLANs from a trunk.
  • PortFast on uplinks: a switch-facing port with PortFast can create a loop before spanning tree converges.
  • Mismatched LACP modes: two passive ends never form a bundle.

Technical references

  • IEEE 802.1Q — VLAN tagging for bridged and virtual bridged LANs (trunk encapsulation).
  • IEEE 802.1AX — Link Aggregation (EtherChannel with LACP).
  • Cisco IOS and IOS XE command reference: search Cisco documentation for switchport trunk allowed vlan, channel-group, and interface range for the software release on your device.

Related tools

Frequently Asked Questions

Does this tool connect to my switch or apply the configuration?

No. The generator only builds text in your browser. It does not connect to any device, store credentials, or deploy anything. You review the output and apply it yourself through your normal change process.

Can I paste my current configuration to check for conflicts?

Yes. Paste the interface sections for the ports you are changing. The generator reads them as plain text only and never runs them. It flags interfaces that already belong to a channel group, and it warns about lines it cannot read rather than guessing.

What is the difference between a Port-channel and an EtherChannel member?

A Port-channel is the logical interface that holds VLAN settings for a bundle of links. An EtherChannel member is a physical interface that joins the bundle through a channel-group command. Set VLANs on the Port-channel, and set only the channel group and LACP mode on each member.

Why does the allowed VLAN list warn me so often?

On a Cisco trunk, the allowed VLAN command replaces the entire list. Any VLAN left out stops crossing the trunk as soon as the command is applied. Compare the list with the trunk's current state before you change it on a live link.

Can I put every port into one interface range?

Only access and trunk ports with identical settings and consecutive numbers are grouped. Port-channels and EtherChannel members are always written individually so a channel change cannot apply to a range by accident. Turn range grouping off to get one block per interface.

Technically Reviewed By

Senior Enterprise Network Engineer — 25+ years of IT and network infrastructure experience, including enterprise Cisco switching, routing, wireless, firewalls, VPN, network access control, SD-WAN, and large-scale network operations.

Calculations are performed using standards-based formulas and verified against known reference values. All computation runs client-side in your browser.

Related Resources