You are on page 1of 9

How to Configure VLAN, STP, DTP Step

by Step Guide?
In this tutorial we will demonstrate that how can you
 Configure Access or Trunk links
 Create VLAN
 Assign VLAN membership
 Configure Intra VLAN routing
 Configure VTP Server
 Make VTP Clients
 Show STP Static
 Configure DTP port
To complete these labs either creates a topology as shown in figure
or downloads this file and loads it in packet tracer

Set hostname to S1 and create VTP domain name example and set password to vinita (Remember password is case sensitive). You have given three pc for sales and three pc in management.com have two department sales and management. For backup purpose you have interconnected switch with one extra connection. Double click on Switch1 and select CLI. VLAN 10 for sales and VLAN20 for management. You have one router for intera VLAN communications. You created two VLAN. End with CNTL/Z. one per line. Switch(config)#hostname S1 .Task You are the administrator at router-switch. Switch 1 Switch>enable Switch#configure terminal Enter configuration commands. Let's start configuration first assign IP address to all pc's To assign IP address double click on pc and select ip configurations from desktop tab and give ip address as shown in table given above VLAN Trunking Protocol Configure VTP Server We will first create a VTP Server so it can automatically propagate VLAN information to other switch.

S1(config)#vtp domain example Changing VTP domain name from NULL to example S1(config)#vtp password vinita Setting device VLAN database password to vinita Configure VTP clients Once you have created a VTP domain. Switch 2 Switch>enable Switch#configure terminal Enter configuration commands.S1(config)#vtp mode server Device mode already VTP SERVER. End with CNTL/Z. Configure remaining Switch to Client mode. Switch(config)#hostname S3 S3(config)#vtp mode client Setting device to VTP CLIENT mode. S3(config)#vtp domain example Changing VTP domain name from NULL to example S3(config)#vtp password vinita Setting device VLAN database password to vinita S3(config)# Dynamic Trunking Protocol Configure DTP port All Switch ports remain by default in access mode. S2(config)#vtp domain example Changing VTP domain name from NULL to example S2(config)#vtp password vinita Setting device VLAN database password to vinita S2(config)# Switch 3 Switch>enable Switch#configure terminal Enter configuration commands. End with CNTL/Z. Switch(config)#hostname S2 S2(config)#vtp mode client Setting device to VTP CLIENT mode. one per line. one per line. Change mode to trunk on all the port those are used to interconnect the switches Switch 1 S1(config)#interface fastEthernet 0/24 S1(config-if)#switchport mode trunk . Access port can not transfer the trunk frame.

changed state to up S2(config-if)#exit S2(config)#interface gigabitEthernet 1/2 S2(config-if)#switchport mode trunk S2(config-if)#exit S2(config)#interface fastEthernet 0/23 S2(config-if)#switchport mode trunk %LINEPROTO-5-UPDOWN: Line protocol FastEthernet0/23. changed state to up S1(config-if)#exit S1(config)# Switch 2 S2(config)#interface gigabitEthernet 1/1 S2(config-if)#switchport mode trunk %LINEPROTO-5-UPDOWN: Line protocol GigabitEthernet1/1. changed state to down %LINEPROTO-5-UPDOWN: Line protocol FastEthernet0/23. changed state to down %LINEPROTO-5-UPDOWN: Line protocol GigabitEthernet1/1. changed state to down %LINEPROTO-5-UPDOWN: Line protocol GigabitEthernet1/2. changed state to down %LINEPROTO-5-UPDOWN: Line protocol FastEthernet0/24. changed state to up S1(config-if)#exit S1(config)#interface gigabitEthernet 1/1 S1(config-if)#switchport mode trunk S1(config-if)#exit S1(config)#interface gigabitEthernet 1/2 S1(config-if)#switchport mode trunk %LINEPROTO-5-UPDOWN: Line protocol GigabitEthernet1/2.%LINEPROTO-5-UPDOWN: Line protocol FastEthernet0/24. changed state to up S2(config-if)#exit S2(config)#interface fastEthernet 0/24 on Interface on Interface on Interface on Interface on Interface on Interface on Interface on Interface .

We need only to associate VLAN with port.S2(config-if)#switchport mode trunk S2(config-if)#exit Switch 3 S3(config)#interface fastEthernet 0/24 S3(config-if)#switchport mode trunk S3(config-if)#exit S3(config)#interface gigabitEthernet 1/1 S3(config-if)#switchport mode trunk S3(config-if)#exit Virtual LAN (VLAN) Create VLAN After VTP server configuration it’s time to organize VLAN. Switch 1 S1(config)#vlan 10 S1(config-vlan)#exit S1(config)#vlan 20 S1(config-vlan)#exit S1(config)# As we have already configure VTP server in our network so we don't need to create VLAN on S2 or S3. We need only to create VLAN on VTP server and reset will be done by VTP Server automatically. Assign VLAN membership Switch 1 S1(config)#interface fastEthernet 0/1 S1(config-if)#switchport access vlan 10 S1(config-if)#interface fastEthernet 0/2 S1(config-if)#switchport access vlan 20 Switch 2 S2(config)#interface fastEthernet 0/1 S2(config-if)#switchport access vlan 10 S2(config-if)#interface fastEthernet 0/2 S2(config-if)#switchport access vlan 20 Switch 3 S3(config)#interface fastEthernet 0/1 S3(config-if)#switchport access vlan 10 .

0.0.--.2 P2p Fa0/23 Desg FWD 19 128.0.3 and 10. To test connectivity do ping form 10.24 P2p Gi1/1 Desg FWD 4 128.0.82E1 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 20 Interface Role Sts Cost Prio.174D.23 P2p Fa0/24 Altn BLK 19 128.--------.7794 Cost 4 Port 26(GigabitEthernet1/2) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32769 (priority 32768 sys-id-ext 1) Address 00D0.0.1 P2p Fa0/2 Desg FWD 19 128.FF08. F0/23 and F0/24 of S2 and F0/24 of S3 to avoid loop at layer to two.26 P2p [Output is omitted] S2# You can test STP protocols status on S1 and S3 also with show spanning-tree active command Router on Stick At this point of configuration you have two successfully running VLAN but they will not connect each other.S3(config-if)#interface fastEthernet 0/2 S3(config-if)#switchport access vlan 20 Now we have two working vlan.0. To make intra VLAN .2 to 10.---.Nbr Type ---------------. Verify those ports blocked due to STP functions Verify STP ports Switch 2 S2#show spanning-tree active VLAN0001 Spanning tree enabled protocol ieee Root ID Priority 32769 Address 0002.25 P2p Gi1/2 Root FWD 4 128. if you get successfully replay then you have successfully created VLAN and VTP server.-------.--------------------------Fa0/1 Desg FWD 19 128.4. Spanning-Tree Protocol In this configuration STP will block these ports F0/24 of S1 .

Switch(configvlan)#exit Applies changes. Router(config)#interface fastEthernet 0/0 Router(config-if)#no ip address Router(config-if)#no shutdown Router(config-if)#exit Router(config)#interface fastEthernet 0/0. If you have error download this configured topology and cross check that where you have committed mistake. and returns to global configuration mode.0. increases the revision number by 1.0. Switch(config)#inter Moves to interface configuration mode face fastethernet 0/1 Switch(configSets the port to access mode if)#switchport mode access .0. Configured VLAN VTP STP topology VLAN VTP Server STP DTP command reference sheet Switch(config)#vlan Creates VLAN 10 and enters VLAN configuration mode 10 for further definitions.0.1 255. Configure intra VLAN Router Router>enable Router#configure terminal Enter configuration commands.0.10 Router(config-subif)#encapsulation dot1Q 10 Router(config-subif)#ip address 10.20 Router(config-subif)#encapsulation dot1Q 20 Router(config-subif)#ip address 20. one per line. To do this double click on router and select CLI.1 255.0 Router(config-subif)#exit To test connectivity between different vlan do ping form any pc to all reaming pc. Switch(configvlan)#name Sales Assigns a name to the VLAN.communications we need to configure router . it should be ping successfully.0 Router(config-subif)#exit Router(config)#interface fastEthernet 0/0.0. The length of the name can be from 1 to 32 characters.0.0. End with CNTL/Z.

Make sure you read the output from the switch.Switch(configif)#switchport access vlan 10 Assigns this port to VLAN 10 Switch#show vlan Displays VLAN information Switch#show brief vlan Displays VLAN information in brief Switch#show vlan id Displays information about VLAN 10 only 10 Switch#show name sales vlan Displays information about VLAN named sales only Switch#show interfaces vlan x Displays interface characteristics for the specified VLAN Switch#delete flash:vlan.dat. trunk .dat Delete filename [vlan.dat? [confirm] Switch# Removes the entire VLAN database from flash. Switch#copy running-config startupconfig Saves the configuration in NVRAM Switch(config-if) Puts the interface into permanent trunking mode and #switchport mode negotiates to convert the link into a trunk link. face fastethernet 0/5 Switch(config-if)#no Removes port from VLAN 5 and reassigns it to VLAN 1— switchport access the default VLAN. If you need to cancel. You can potentially erase the entire contents of the flash with this command if the syntax is not correct.dat]? Delete flash:vlan. press ctrl+c to escape back to privileged mode: Switch(config)#inter Moves to interface configuration mode. vlan 5 Switch(configif)#exit Moves to global configuration mode. Make sure there is no space between the colon (:) and the characters vlan. Switch(config)#no vlan 5 Removes VLAN 5 from the VLAN database.

Switch(config)#vtp pruning Enables VTP pruning Switch#show status vtp Displays general information about VTP configuration Switch#show counters vtp Displays the VTP counters for the switch More Related Topics: Video to Show Private VLANs & Configure PVLANs on A Cisco Switch How to Configure Spanning Tree Protocol (STP) on Catalyst Switches? How the Root Bridge and Ports are Chosen? Root Port Selection on a Switch STP (Spanning Tree Protocol) Path Selection . name Switch(config)#vtp Configures a VTP password password password .from 1 to 32 characters long.Switch(config)#vtp mode server Changes the switch to VTP server mode. Switch(config)#vtp mode transparent Changes the switch to VTP transparent mode. Switch(config)#vtp Configures the VTP domain name. Switch(config)#no vtp mode Returns the switch to the default VTP server mode. The name can be domain domain. Switch(config)#vtp mode client Changes the switch to VTP client mode.