Configuring VLANs

Before you begin creating VLANs, you should determine whether the switch will participate in a VTP domain that will synchronize VLAN configuration with the rest of the network. You must also enable a trunk connection if you want to use VLANs across multiple switches.

When adding a new switch to an existing domain, it is a good idea to add it in VTP client mode. This will prevent the switch from propagating any incorrect VLAN information to other switches. In this example we will setup a new VTP domain and place the switch into server mode. The password puts VTP into secure mode. Every switch in the management domain must have a password assigned to it for the management domain to function properly in secure mode.

The next step is to create a trunk connection with the other switches that will be sharing VLAN information. To enable trunking on a port, enter interface configuration mode for the desired port, and then use the trunk command with the appropriate option:

Now that the VLAN has been created, you can statically assign which ports will be members of the VLAN. A port can only belong to one VLAN at a time and by default, all ports are members of VLAN 1. To assign a VLAN to a port, enter interface configuration mode for the port and use the vlan-membership command.