Configuring VTP/VLAN/Trunk

Figure 4-8 illustrates multiple switches across the campus network. IEEE 802.1Q is used for trunking method. VLANs 2 and 3 are configured as well. VTP is used to propagate the VLAN information to the rest of the switches.

Figure 4-8. Configure Switch1 for VTP/VLAN/Trunk


The first thing to do is define the VTP domain, which allows VTP to manage switches that are under its domain. This command is programmed on all four switches:

set vtp domain cisco

VTP domain names and passwords are case sensitive. A VTP domain name is only required for server/client mode. By default, Cisco switches will operate in server mode. For redundancy purposes, the recommendation is to have multiple VTP servers in the switch network. Therefore, only Switch2 and Switch3 will be configured for client mode. Switch1 and Switch4 will operate in server mode so that they may provide redundancy. Use the following command to change Switch2 and Switch3 to client mode:

set vtp mode client

If a VTP domain name is not configured for server/client mode, or if the switch is not programmed to be in transparent mode, any VLANs created will be in inactive state.

The next step is to create VLANs 2 and 3. The set vlan command is used to create VLAN 3 on Switch1:

set vlan 3

Host1 is connected to port 10/3 and is configured to be a member of VLAN 3:

set vlan 3 10/3

By default, all ports are configured with VLAN 1. Hence, any trunks created will have their native VLAN as VLAN 1. Port 1/2 of Switch1 will be used to form a trunk with Switch2 so that Switch1 can pass VTP information to Switch2. The following command will force the native VLAN for trunk 1/2 to be VLAN 2:

set vlan 2 1/2

Typically, it is recommended to assign native VLANs rather than using VLAN 1. The "Understanding VLAN 1" section of this chapter provides greater insight as to why this is necessary.

The port is configured to be an IEEE 802.1Q trunk port with the next command. Dot1q is the equivalent of IEEE 802.1Q on Cisco switches:

set trunk 1/2 dot1q

Recall from earlier discussions of trunking that trunking mode must also be configured. The recommended method is to set trunking mode to desirable:

set trunk 1/2 desirable

Port 1/2 will attempt to actively form a trunk with its directly connected link because it has the desirable parameter configured. Port 10/27 will similarly be configured to form a trunk to Switch4.