Configuring VLANs 589
interface is automatically removed from its previous VLAN membership. You
can configure each interface separately, or you can configure a range of
interfaces with the same settings.
Configuring a Port in Trunk Mode
Beginning in Privileged EXEC mode, use the following commands to
configure an interface as a layer 2 trunking interface, which connects two
switches. Trunk mode ports support traffic tagged with different VLAN IDs.
Untagged received traffic is switched in the native VLAN.
Command Purpose
configure Enter global configuration mode.
interface
interface
Enter interface configuration mode for the specified
interface. The
interface
variable includes the interface type
and number, for example tengigabitethernet 1/0/3.
You can also specify a range of interfaces with the interface
range command, for example, interface range
tengigabitethernet 1/0/8-12 configures interfaces 8, 9, 10,
11, and 12.
switchport mode access Configure the interface as an untagged layer 2 VLAN
interface.
switchport access vlan
vlan-id
Configure the interface as a member of the specified
VLAN.
vlan-id
— A valid VLAN ID of the VLAN to which the port
is configured. (Range: 1–4093)
CTRL + Z Exit to Privileged EXEC mode.
show interfaces
switchport
interface
Display information about the VLAN settings configured
for the specified interface.
Command Purpose
configure Enter global configuration mode.