Do the following to add or remove VLANs on a Layer 2 interface in trunk mode. The configuration is also used to configure the VLANs to send and receive data packets.
Ensure that reserved VLANs are not used.
device# configure terminal
device(config)# interface ethernet 0/1
device(conf-if-eth-0/1)# switchport
device(conf-if-eth-0/1)# switchport trunk allowed vlan add 5
The example sets the mode of the Ethernet interface to trunk.
device# configure terminal device(config)# interface ethernet 0/1 device(conf-if-eth-0/1)# switchport mode trunk
The example sets the mode of a port-channel interface to trunk and allows all VLANs.
device# configure terminal device(config)# interface port-channel 35 device(config-Port-channel-35)# switchport trunk allowed vlan all