Configuring a VLAN in trunk mode

Ensure that reserved VLANs are not used.

  1. Enter the configure terminal command to access global configuration mode.
    device# configure terminal 
  2. Enter the interface ethernet command to specify an Ethernet interface.
    device(config)# interface ethernet 0/1
    
  3. Enter the switchport command to set the interface as switchport.
    device(conf-if-eth-0/1)# switchport
    
  4. Enter the switchport trunk allowed vlan command to set the mode of the interface to trunk and add a VLAN.
    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