How To Configure VLAN, STP, DTP Step by Step Guide?
How To Configure VLAN, STP, DTP Step by Step Guide?
Guide?
In this tutorial we will demonstrate that how can you
You are the administrator at router-switch.com have two department sales and management. You have
given three pc for sales and three pc in management. You created two VLAN. VLAN 10 for sales and
VLAN20 for management. For backup purpose you have interconnected switch with one extra connection.
You have one router for intera VLAN communications.
We will first create a VTP Server so it can automatically propagate VLAN information to other switch. Double
click on Switch1 and select CLI. Set hostname to S1 and create VTP domain name example and set
password to vinita (Remember password is case sensitive).
Switch 1
Switch>enable
Switch#configure terminal
Once you have created a VTP domain. Configure remaining Switch to Client mode.
Switch 2
Switch>enable
Switch#configure terminal
Switch(config)#hostname S2
S2(config)#
Switch 3
Switch>enable
Switch#configure terminal
Switch(config)#hostname S3
All Switch ports remain by default in access mode. Access port can not transfer the trunk frame. Change
mode to trunk on all the port those are used to interconnect the switches
Switch 1
changed state to up
S1(config-if)#exit
S1(config-if)#exit
changed state to up
S1(config-if)#exit
S1(config)#
Switch 2
changed state to up
S2(config-if)#exit
S2(config)#interface gigabitEthernet 1/2
S2(config-if)#exit
changed state to up
S2(config-if)#exit
S2(config-if)#exit
Switch 3
S3(config-if)#exit
S3(config-if)#exit
Create VLAN
After VTP server configuration it’s time to organize VLAN. We need only to create VLAN on VTP server and
reset will be done by VTP Server automatically.
Switch 1
S1(config)#vlan 10
S1(config-vlan)#exit
S1(config)#vlan 20
S1(config-vlan)#exit
S1(config)#
As we have already configured VTP server in our network so we don’t need to create VLAN on S2 or S3.
We need only to associate VLAN with port.
Switch 2
Switch 3
Now we have two working vlan. To test connectivity do ping form 10.0.0.2 to 10.0.0.3 and 10.0.0.4. if you get
successfully replay then you have successfully created VLAN and VTP server.
Spanning-Tree Protocol
In this configuration STP will block these ports F0/24 of S1 , F0/23 and F0/24 of S2 and F0/24 of S3 to avoid
loop at layer to two. Verify those ports blocked due to STP functions
Switch 2
VLAN0001
Cost 4
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Interface Role Sts Cost Prio.Nbr Type
[Output is omitted]
S2#
Router on Stick
At this point of configuration you have two successfully running VLAN but they will not connect each other. To
make intra VLAN communications we need to configure router . To do this double click on router and select
CLI.
Router
Router>enable
Router#configure terminal
Router(config-if)#no ip address
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config-subif)#encapsulation dot1Q 10
Router(config-subif)#exit
Router(config-subif)#exit
To test connectivity between different vlan do ping form any pc to all reaming pc. it should be ping
successfully. If you have error download this configured topology and cross check that where you have
committed mistake.