VTP and STP Configuration

VTP&STP Setup

VTP and STP configuration

Configuration Command Line :

Switch-1:
Configure VTP Server:
Switch#
Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname S1
S1(config)#vtp mode server
Device mode already VTP SERVER.
S1(config)#vtp domain lab
Changing VTP domain name from NULL to lab
S1(config)#vtp password cisco
Setting device VLAN database password to cisco
S1(config)#

Configure DTP port:
S1(config)#int fa0/24
S1(config-if)#switchport mode trunk

S1(config-if)#exit
S1(config)#int g0/2
S1(config-if)#switchport mode trunk
S1(config-if)#exit
S1(config)#int g0/1
S1(config-if)#switchport mode trunk
S1(config-if)#exit
S1(config)#
Create VLAN:
S1>
S1>en
S1#config t
Enter configuration commands, one per line. End with CNTL/Z.
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 associate VLAN with port.

Assign VLAN membership:

S1(config)#int fa0/1
S1(config-if)#switchport access vlan 10
S1(config-if)#int fa0/2
S1(config-if)#switchport access vlan 20
S1(config-if)#
S1(config-if)#exit
S1(config)#
Switch -2:
Configure VTP clients:

Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname S2
S2(config)#vtp mode client
Setting device to VTP CLIENT mode.
S2(config)#vtp domain lab
Changing VTP domain name from NULL to lab
S2(config)#vtp password cisco
Setting device VLAN database password to cisco
S2(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 associate VLAN with port.

Assign VLAN membership:

S2#config t
Enter configuration commands, one per line. End with CNTL/Z.
S2(config)#int fa0/1
S2(config-if)#switchport access vlan 10
S2(config-if)#int fa0/2
S2(config-if)#switchport access vlan 20
S2(config-if)#exit
S2(config)#

Configure DTP port:
S2>
S2>en
S2#config t
Enter configuration commands, one per line. End with CNTL/Z.
S2(config)#int g0/2
S2(config-if)#switchport mode trunk
S2(config-if)#int g0/1
S2(config-if)#switchport mode trunk
S2(config-if)#exit
S2(config)#int fa0/23
S2(config-if)#switchport mode trunk
S2(config)#int fa0/24
S2(config-if)#switchport mode trunk
S2(config-if)#
S2(config-if)#exit
S2(config)#
Create VLAN:

Switch – 3:
Configure VTP clients:

Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname S3
S3(config)#vtp mode client
Setting device to VTP CLIENT mode.
S3(config)#vtp domain lab
Changing VTP domain name from NULL to lab
S3(config)#vtp password cisco
Setting device VLAN database password to cisco
S3(config)#

Configure DTP port:
S3>en
S3#config t
Enter configuration commands, one per line. End with CNTL/Z.
S3(config)#int g0/1
S3(config-if)#switchport mode trunk
S3(config-if)#

S3(config)#int fa0/24
S3(config-if)#switchport mode trunk
S3(config-if)#exit
S3(config)#

Create VLAN:
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 associate VLAN with port.

Assign VLAN membership:
S3(config)#int fa0/1
S3(config-if)#switchport access vlan 10
S3(config-if)#int fa0/2
S3(config-if)#switchport access vlan 20
S3(config-if)#exit
S3(config)#

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.

Verify STP ports
Switch 2:

S2#show spanning-tree active
VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 32769
Address 0002.174D.7794
Cost 4
Port 26(GigabitEthernet0/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.FF08.82E1
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20

Interface Role Sts Cost Prio.Nbr Type
—————- —- — ——— ——– ——————————–
Fa0/23 Desg FWD 19 128.23 P2p
Fa0/24 Altn BLK 19 128.24 P2p
Gi0/1 Desg FWD 4 128.25 P2p
Gi0/2 Root FWD 4 128.26 P2p

VLAN0010
Spanning tree enabled protocol ieee
Root ID Priority 32778
Address 0002.174D.7794
Cost 4
Port 26(GigabitEthernet0/2)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32778 (priority 32768 sys-id-ext 10)
–More–

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.

Configure intra VLAN:
Router:

Router>en
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int fa0/0
Router(config-if)#no ip address
Router(config-if)#no shutdown

Router(config)#int fa0/0.10
Router(config-subif)#encapsulation dot1q 10
Router(config-subif)#ip address 10.0.0.1 255.0.0.0
Router(config-subif)#exit
Router(config)#
Router(config)#int fa0/0.20
Router(config-subif)#

Router(config-subif)#encap
Router(config-subif)#encapsulation dot1q 20
Router(config-subif)#ip address 20.0.0.1 255.0.0.0
Router(config-subif)#exit
Router(config)#

To test connectivity between different vlan do ping form any pc to all reaming pc. it should be ping successfully.

VLAN VTP Server STP DTP command reference sheet:

Switch(config)#vlan 10 Creates VLAN 10 and enters VLAN configuration mode for further definitions.
Switch(config-vlan)#name Sales Assigns a name to the VLAN. The length of the name can be from 1 to 32 characters.
Switch(config-vlan)#exit Applies changes, increases the revision number by 1, and returns to global configuration mode.
Switch(config)#interface fastethernet 0/1 Moves to interface configuration mode
Switch(config-if)#switchport mode access Sets the port to access mode
Switch(config-if)#switchport access vlan 10 Assigns this port to VLAN 10
Switch#show vlan Displays VLAN information
Switch#show vlan brief Displays VLAN information in brief
Switch#show vlan id 10 Displays information about VLAN 10 only
Switch#show vlan name sales Displays information about VLAN named sales only
Switch#show interfaces vlan x Displays interface characteristics for the specified VLAN
Switch#delete flash:vlan.dat
Delete filename [vlan.dat]?
Delete flash:vlan.dat? [confirm]
Switch#
Removes the entire VLAN database from flash.
Make sure there is no space between the colon (:) and the characters vlan.dat. You can potentially erase the entire contents of the flash with this command if the syntax is not correct. Make sure you read the output from the switch. If you need to cancel, press ctrl+cto escape back to privileged mode:
Switch(config)#interface fastethernet 0/5 Moves to interface configuration mode.
Switch(config-if)#no switchport access vlan 5 Removes port from VLAN 5 and reassigns it to VLAN 1—the default VLAN.
Switch(config-if)#exit Moves to global configuration mode.
Switch(config)#no vlan 5 Removes VLAN 5 from the VLAN database.
Switch#copy running-config startupconfig Saves the configuration in NVRAM
Switch(config-if) #switchport mode trunk Puts the interface into permanent trunking mode and negotiates to convert the link into a trunk link.
Switch(config)#vtp mode server Changes the switch to VTP server mode.
Switch(config)#vtp mode client Changes the switch to VTP client mode.
Switch(config)#vtp mode transparent Changes the switch to VTP transparent mode.
Switch(config)#no vtp mode Returns the switch to the default VTP server mode.
Switch(config)#vtp domain domain-name Configures the VTP domain name. The name can be from 1 to 32 characters long.
Switch(config)#vtp password password Configures a VTP password

.

Switch(config)#vtp pruning Enables VTP pruning
Switch#show vtp status Displays general information about VTP configuration
Switch#show vtp counters Displays the VTP counters for the switch

Thank you

Momataj Momo

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s