2.3 VLANS

VLAN Trunks

A VLAN trunk is a Layer 2 link between two switches that carries traffic for all VLANs (unless the allowed VLAN list is restricted manually or dynamically).


VLAN Trunk Configuration

Enter interface configuration for the port to be assigned on the Trunk
S1(config)# interface [interface-id]
Set the port to Trunk mode
S1(config-if)# switchport mode trunk
Set the native VLAN to something different than VLAN1
Switch(config-if)# switchport trunk native vlan [vlan-id]
Specify the VLANs to be allowed on the Trunk link
Switch(config-if)# switchport trunk allowed vlan [vlan-list]
Creating and Binding a VLAN Trunk Configuration Example
S1> enable
S1# Configure Terminal
S1(config)# interface fa0/1
S1(config-if)# switchport mode trunk
S1(config-if)# switchport mode trunk native vlan 100
S1(config-if)# switchport trunk allowed vlan 10,20,30,40,50,99,100
S1(config-if)# exit 
S1#

[NOTE] This configuration automatically uses 802.1Q encapsulation on trunk links.

Other switches may require manual configuration of the encapsulation.

Make sure to always configure both ends of a trunk link with the same native VLAN. If not the same on both ends, Cisco IOS Software reports errors

Resetting a Trunk to its Default State

Enter interface configuration for the port to be assigned on the Trunk
S1(config)# interface [interface-id]
Reset the list of allowed VLANS
S1(config-if)# no switchport trunk allowed vlan 
Reset the Native VLAN
S1(config-if)# no switchport trunk native vlan
Assigning an access port to both a Data and a Voice VLAN on a Switch Complete Configuration Example
S1> enable
S1# Configure Terminal
S1(config)# interface fa0/1
S1(config-if)# no switchport trunk allowed vlan 
S1(config-if)# no switchport trunk native vlan
S1(config-if)# exit
S1(config)#

[NOTE] When a trunk is reset to its default state, such trunk allows all VLANS and uses VLAN 1 as the native VLAN by default