I see many questions here on Experts Exchange regarding switch port configurations and trunks. This article is meant for beginners in the subject to help to get basic knowledge about Virtual Local Area Network (
VLAN) and port-configurations in Cisco Catalyst switches.
An Ethernet-frame (packet) can be either tagged or untagged. The default is untagged. When a frame is tagged, an extra
802.1q header is placed first in each frame, containing a VLAN id, a number normally between 1 and 2004. Each VLAN is a separate broadcast domain and should use different IP network addressing. As you probably know, a switch cannot pass traffic between different VLANs.
A switch port can be configured either as an access port or as a trunk. An access port sends and receives traffic to/from one single VLAN, untagged. This is the normal thing for connecting PCs and other non trunk-aware equipment into a switch. The default configuration for a switch port is to be configured as an access port in VLAN 1. It looks like this:
Do always first look in the port configuration if it is configured as an access port or a trunk port so that you know which of the other commands in the commands that are in use.
In case of a trunk port frames on all VLANs are sent as tagged, with the VLAN id attached to the frame. One exception for this is the "native VLAN". By default VLAN 1 is the native VLAN and is sent untagged. This can be changed with the "switch port trunk native vlan x" command. Obviously, though, there can only be one native VLAN configured on each port.