4.5 Trunking
4.5.2 Configuring a VLAN trunk
To create or configure a VLAN trunk on a Cisco IOS command-based switch, you must configure the port first as a trunk and then specify the trunk encapsulation. To do this, issue the commands:

Switch(config-if)#switchport mode trunk
Switch(config-if)#switchport trunk encapsulation ?
dot1q Interface uses only 802.1q trunking encapsulation when trunking
isl Interface uses only ISL trunking encapsulation when trunking

These commands are shown in Figure .

Before attempting to configure a VLAN trunk on a port, it is wise to determine what encapsulation the port can support. This can be done using the show port capabilities command on a set command-based switch, as shown in Figure . In this example, you can see that Port 2/1 will support only the IEEE 802.1Q encapsulation.

To create or configure a VLAN trunk on a set command-based switch, enter the set trunk command to configure the port on each end of the link as a trunk port and to specify the VLANs that will be transported on this trunk link. You can also use the set trunk command to change the mode of a trunk.

Switch> (enable) set trunk mod_num/port_num [on | off | desirable | auto | nonegotiate] vlan_range [isl | dot1q | dot10 | lane | negotiate]

Fast Ethernet and Gigabit Ethernet trunking modes are as follows:

  • On - This mode puts the port into permanent trunking. The port becomes a trunk port even if the neighboring port does not agree to the change. The on state does not allow for the negotiation of an encapsulation type. You must, therefore, specify the encapsulation in the configuration.
  • Off - This mode puts the port into permanent nontrunking mode and negotiates to convert the link into a nontrunk link. The port becomes a nontrunk port even if the neighboring port does not agree to the change.
  • Desirable - This mode makes the port actively attempt to convert the link to a trunk link. The port becomes a trunk port if the neighboring port is set to on, desirable, or auto mode.
  • Auto - This mode makes the port willing to convert the link to a trunk link. The port becomes a trunk port if the neighboring port is set to on or desirable mode. This is the default mode for Fast and Gigabit Ethernet ports. Notice that if the default setting is left on both sides of the trunk link, it will never become a trunk; neither side will be the first to ask to convert to a trunk.
  • Nonegotiate - This mode puts the port into permanent trunking mode but prevents the port from generating Dynamic Trunking Protocol (DTP) frames. You must configure the neighboring port manually as a trunk port to establish a trunk link.

The example in Figure configures Port 2/1 as a permanent trunk using the IEEE 802.1Q encapsulation.