You are on page 1of 4

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. The steps to configure a VLAN are: 1. 2. 3. 4. Enable VTP (optional) Enable Trunking (optional) Create VLANs Assign VLANs to ports

Verifying VLANs
      

Verifying the VLAN Configuration Verifying VLAN Membership Prevent VLANs from Crossing a Trunk Link Prevent Individual VLANs from Crossing a Trunk Link Verifying Trunk Links Verifying VTP Information Enabling VTP Pruning

Enable VTP

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.
Switch1#configure terminal Enter configuration commands, one per line. End with CNTL/Z Switch1(config)#vtp server Switch1(config)#vtp domain ciscotest Switch1(config)#vtp password ccna

Enable Trunking

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:
Switch1#configure terminal Switch1(config)#interface f 0/26 Switch1(config-if)#trunk on trunk

Command Options Function

Option

on Puts the port into permanent trunking mode and negotiates to convert the link into a trunk link. . use the show vlan command. Puts the port into permanent trunking mode but prevents the port from generating DTP frames. The port becomes a trunk port if the neighboring port is set to on or desirable mode. or auto mode. You must configure the neighboring port manually as a trunk port to establish a trunk link. Makes the port actively attempt to convert the link to a trunk link. enter global configuration mode and use the vlan command with the VLAN identifier (1-1005) and its name. The port becomes a nontrunk port even if the neighboring port does not agree to the change. Makes the port willing to convert the link to a trunk link. The port becomes a trunk port even if the neighboring port does not agree to the change. A port can only belong to one VLAN at a time and by default. off desirable auto negotiate Create VLANs To create a VLAN. enter interface configuration mode for the port and use the vlan-membership command. The port becomes a trunk port if the neighboring port is set to on. Puts the port into permanent nontrunking mode and negotiates to convert the link into a nontrunk link. all ports are members of VLAN 1. you can statically assign which ports will be members of the VLAN. To assign a VLAN to a port. Switch1#configure terminal Switch1(config)#interface e0/4 Switch1(config-if)#vlan-membership static 5 Switch1(config)#interface e0/5 Switch1(config-if)#vlan-membership static 5 Switch1(config)#interface e0/6 Switch1(config-if)#vlan-membership static 6 Verifying the VLAN Configuration To view the VLANs configured on the switch. desirable. Switch1#configure terminal Switch1(config)#vlan 5 name accounting Switch1(config)#vlan 6 name management Assign VLANs to Ports Now that the VLAN has been created. This is the default mode.

Use the following command if you don't want a trunk to carry VLAN information: Switch1(config)#int f0/26 Switch1(config-if)#clear trunk Prevent Individual VLANs from Crossing a Trunk Link You can clear individual VLANs from crossing a trunk link by using the following command: . AUI. 5 6 management Enabled 6 Optionally you can view an individual VLAN to see how it's configured by using the show vlan [#] command. A. Switch1#show vlan 5 VLAN Name Status Ports ------------------------------------5 accounting Enabled 2 ------------------------------------VLAN Type SAID MTU Parent RingNo BridgeNo Stp Trans1 Trans2 --------------------------------------------------------------------5 Ethernet 100005 1500 0 1 1 Unkn 0 0 Verifying VLAN Membership To view which ports are assigned to a VLAN. use the following command: Switch1#show vlan-membership Port VLAN Membership 1 1 Static 2 1 Static 3 1 Static 4 5 Static 5 5 Static 6 6 Static 7 1 Static 8 1 Static [Output Cut] Prevent VLANs from Crossing a Trunk All VLANs are configured on a trunked link unless you clear it manually. B 5 accounting Enabled 4.Switch1#show vlan VLAN Name Status Ports -------------------------------------------------1 default Enabled 1-3. 7-24.

86 at 7-25-01 01:22:24 Enabling VTP Pruning If you enable VTP pruning on a VTP server. Switch1#show trunk a DISL state: Auto.1. Trunking: On. you can view the configuration with the following command: Switch1#show vtp VTP Version : 2 Configuration Revision : 2 Maximum VLANs supported locally : 1005 Number of existing VLANs : 2 VTP Operating Mode : Server VTP Password : ccna VTP Domain Name : ciscotest VTP Pruning Mode : Disabled VTP V2 Mode : Disabled VTP Traps Generation : Enabled MD5 digest : 0xB9 0xC7 0x8D 0xB3 0xD4 0xBA 0x94 0x03 Configuration last modified by 192. Enable VTP pruning with the following command: Switch1(config)#vtp pruning enable Disable VTP pruning with: Switch1(config)#vtp pruning disable . you will enable it for the entire domain. The a is for port f0/26 while b represents f0/27. 6-1004 Verifying VTP Information After VTP has been enabled and configured.168. Encapsulation type:ISL Switch1#show trunk allowed-vlans 1-4.Switch1(config)#int f0/26 Switch1(config-if)#no trunk-vlan 5 Verifying Trunk Link To verify a trunk port use the show trunk [a|b] command.

 $9. .431 1 .9.431 39071. ...00 . $9.3 202-078589.

 $9. .. $9.3 202-078589.9.431 1 .431 39071. .00 ..

.9. '071390'431:7.090'8.422.3/  .431:70/439089. .3 202-078589..943  %4.431 1 . :809084.3. $9.

9.-0/    &   .9:8!4798   .039'8174274883. $9.84.422.9:8!4798   /01.3  '.54798. $9.431:70/-:839084.   :95:9:9( !70.3/   $9.'9480049 8. $9..792.3.70.:93.9.-0/ 5943.9. $9.3....422.431 391 . $9.9. $9.-0/  2.8830/94.4:3933.0.84.-0/    '%50$%&!./:.3 202-0785 !479'02-0785 $9.4:3933. $9..33/.431:70/43.%7:3  '8.38   907309   &33   '0713'02-0785  %4. &80901443 .0.943 $9.20$9.38%7. .84.4:.' :80901443.020393.97:394.7039#347/04$95%7.0.97:30/3:30884:.3:.9.70..3/ $9.20$9.3/14:/43 9.39.9... $9.3  '..9.3 (..9.77'31472.422.

97:33-:83901443./:.797:3 !70.431 1 .'8174274883..73/.3.422.0393/.74883.0.'81742. $9./:.%7:33  4:.3/ . .0.

$9.431 391 . .

814754791 .422.3 '0713%7:33  %4.-(. .431 1 3497:3 .071.97:35479:80908497:3..3/ %0. $9.

0- 70570803981 .

-0/ /089          431:7.07 '%!!.422.-0 8.431:70/ 4:.-0 '%!57:339901443.-0  .3.8924/10/-   .431 .  $9.95 '%!'07843 431:7..431:7.20.-0/.943#0.9433.84.3/ $9.40/ .9    3.580307..3.-0'%!57:3343.49089 '%!!7:334/08.-0/ '%!'4/08.431 . $89.422.8497:3.  :2-07410893'8 '%! 507.9557:3303.8.90:94 %7:33 3 3.-091479003970/42.38      '0713'%!31472.934/0$07. '%!42.3 3..07 4:03.-0'%!57:339 $9.2:2'88:554790/4.943  1907'%!.58:.9439901443 .-0/ '%!%7.8-00303.3/.9557:33/8. .090.943..3.-3'%!!7:33  14:03..8847/.943950$  $9.8497:3.3/ $9.'%!807.843 . .