Sie sind auf Seite 1von 12

Lab ID: 9.9K317A076.SNI2.

Spanning Tree I
Objective
Learn to configure and observe Spanning Tree Protocol (STP). Configure the appropriate settings on
Router1, Switch1, Switch2, Switch3, PC1, and PC2.

Lab Topology
The topology diagram below represents the NetMap in the Simulator.

Command Summary
Command Description
configure terminal enters global configuration mode from privileged EXEC mode
enable enters privileged EXEC mode
encapsulation dot1q vlan-id sets the encapsulation method of the interface for 802.1Q
virtual LAN (VLAN) trunking; also specifies the VLAN ID for
which the frames should be tagged
end ends and exits configuration mode
hostname host-name sets the device name

1 Boson NetSim Lab Manual


Command Description
ip address ip-address subnet-mask assigns an IP address to an interface
ipconfig /all is used in NetSim to display the IP addresses and Media
Access Control (MAC) address on a PC workstation
interface range fastethernet slot/ configures a range of interfaces
starting-port - ending-port
interface type number changes from global configuration mode to interface
configuration mode
no shutdown enables an interface
ping ip-address sends an Internet Control Message Protocol (ICMP) echo
request to the specified address
show running-config displays the active configuration file
show spanning-tree vlan vlan-id shows whether spanning tree is running for a VLAN
spanning-tree vlan vlan-id priority sets the spanning tree priority for use in the bridge ID
priority
switchport access vlan vlan-id assigns the default VLAN for a port
switchport mode {access | dynamic configures the VLAN membership mode of a port
{auto | desirable} | trunk}
switchport trunk encapsulation sets the trunk encapsulation format to 802.1Q
dot1q
vlan vlan-id creates a VLAN

The IP addresses and subnet masks used in this lab are shown in the tables below:

IP Addresses
Device Interface IP Address Subnet Mask
Router1 FastEthernet 0/0 192.168.100.1 255.255.255.0

Device IP Address Subnet Mask Default Gateway


PC1 192.168.100.101 255.255.255.0 192.168.100.1
PC2 192.168.100.102 255.255.255.0 192.168.100.1

Lab Tasks
Task 1: Configure VLANs
This task involves configuring switches so that PC1 and PC2 are in VLAN 3.
1. Verify that the current IP configurations on PC1 and PC2 match the IP configurations listed in the IP
Addresses table.

2. Verify the connectivity by pinging from PC1 to PC2 (192.168.100.102). The ping should succeed.

3. Configure Switch1 with the appropriate host name.

2 Boson NetSim Lab Manual


4. On Switch1, configure FastEthernet ports 0/1, 0/2, and 0/3 as trunk ports and create VLAN 3.

5. Configure Switch2 with the appropriate host name, create VLAN 3, and add FastEthernet port 0/4 to
VLAN 3.

6. On Switch2, configure FastEthernet ports 0/1 and 0/2 as trunk ports.

7. Configure Switch3 with the appropriate host name, create VLAN 3, and add FastEthernet port 0/4 to
VLAN 3.

8. On Switch3, configure FastEthernet ports 0/1 and 0/3 as trunk ports.

9. Verify the configuration by pinging from PC1 to PC2 (192.168.100.102). The ping should succeed.

Task 2: Configure the Router


This task involves configuring the router for basic network connectivity with the PCs.
1. On Router1, configure the appropriate host name.

2. On Router1, configure the FastEthernet 0/0 interface with the appropriate IP address and subnet
mask; refer to the IP Addresses table. Configure the interface with 802.1Q encapsulation for VLAN
3. Enable the interface.

3. Verify the configuration by pinging from Router1 to PC1 (192.168.100.101) and PC2
(192.168.100.102). Both pings should succeed.

Task 3: Observe Spanning Tree


1. On Switch3, set the priority for VLAN 3 to 0 to ensure that it is the root bridge. Wait for approximately
60 seconds for the network to update.

2. Issue the show spanning-tree vlan 3 command on Switch1, Switch2, and Switch3. Use the output
to answer the following questions:

3. What is the MAC address of the root bridge for VLAN 3? _____________________________

4. What spanning tree protocol is being used on the switches? __________________________

5. Which switch is the root bridge? ________________________________________________

6. What is the priority of the root bridge? ____________________________________________

7. What port on what device is in the blocking state? __________________________________

Once you have completed this lab, be sure to check your work by using the grading function.
You can do so by clicking the Grade Lab icon ( ) in the toolbar or by pressing Ctrl+G.

3 Boson NetSim Lab Manual


Lab Solutions
Task 1: Configure VLANs
1. Issue the ipconfig /all command to verify that the current IP configurations on PC1 and PC2 are
correct. Below is sample output for PC1:

C:> ipconfig /all

<output omitted>

Boson BOSS 5.0 IP Configuration


Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 192.168.100.101
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.100.1
Description . . . . . . . . . . . : Realtek RTL8139/810X Family PCI Fast Ethernet NIC
Physical Address. . . . . . . . . : 000C.6975.2957
DHCP Enabled. . . . . . . . . . . : No
Link-local IPv6 Address . . . . . : FE80::20C:69FF:FE75:2957%1
DHCPv6 IAID . . . . . . . . . . . : 53308893527
DHCPv6 Client DUID. . . . . . . . : 00-30-30-30-43-36-39-37-35-32-39-35-37

DNS Servers . . . . . . . . . . . :

2. A ping from PC1 to PC2 (192.168.100.102) should succeed.

C:>ping 192.168.100.102

3. On Switch1, issue the following command to configure the appropriate host name:

Switch(config)#hostname Switch1

4. On Switch1, issue the following commands to configure FastEthernet ports 0/1, 0/2, and 0/3 as trunk
ports and to create VLAN 3:

Switch1(config)#interface range fastethernet 0/1 - 3


Switch1(config-if-range)#switchport trunk encapsulation dot1q
Switch1(config-if-range)#switchport mode trunk
Switch1(config-if-range)#exit
Switch1(config)#vlan 3
VLAN 3 added:
Name:VLAN0003

4 Boson NetSim Lab Manual


5. On Switch2, issue the following commands to configure the appropriate host name, to create VLAN
3, and to add FastEthernet port 0/4 to VLAN 3:

Switch(config)#hostname Switch2
Switch2(config)#vlan 3
Switch2(config-vlan)#exit
Switch2(config)#interface fastethernet 0/4
Switch2(config-if)#switchport mode access
Switch2(config-if)#switchport access vlan 3

6. On Switch2, issue the following commands to configure FastEthernet ports 0/1 and 0/2 as trunk
ports:

Switch2(config-if)#interface range fastethernet 0/1 - 2


Switch2(config-if-range)#switchport trunk encapsulation dot1q
Switch2(config-if-range)#switchport mode trunk

7. On Switch3, issue the following commands to configure the appropriate host name, to create VLAN
3, and to add FastEthernet port 0/4 to VLAN 3:

Switch(config)#hostname Switch3
Switch3(config)#vlan 3
Switch3(config-vlan)#exit
Switch3(config)#interface fastethernet 0/4
Switch3(config-if)#switchport mode access
Switch3(config-if)#switchport access vlan 3

8. On Switch3, issue the following commands to configure FastEthernet ports 0/1 and 0/3 as trunk
ports:

Switch3(config-if)#interface fastethernet 0/1


Switch3(config-if)#switchport trunk encapsulation dot1q
Switch3(config-if)#switchport mode trunk
Switch3(config-if)#interface fastethernet 0/3
Switch3(config-if)#switchport trunk encapsulation dot1q
Switch3(config-if)#switchport mode trunk

9. A ping from PC1 to PC2 (192.168.100.102) should succeed.

C:>ping 192.168.100.102

Task 2: Configure the Router


1. On Router1, issue the following command to configure the appropriate host name:

Router(config)#hostname Router1

5 Boson NetSim Lab Manual


2. On Router1, issue the following commands to configure the FastEthernet 0/0 interface with the
appropriate IP address and subnet mask, to configure the interface with 802.1Q encapsulation for
VLAN 3, and to enable the interface:

Router1(config)#interface fastethernet 0/0


Router1(config-if)#ip address 192.168.100.1 255.255.255.0
Router1(config-if)#encapsulation dot1q 3
Router1(config-if)#no shutdown

3. After the network converges, pings from Router1 to PC1 (192.168.100.101) and PC2
(192.168.100.102) should succeed.

Router1#ping 192.168.100.101
Router1#ping 192.168.100.102

Task 3: Observe Spanning Tree


1. On Switch3, issue the following command to ensure that it is the root bridge:

Switch3(config)#spanning-tree vlan 3 priority 0

You can manually configure the bridge priority on switches by issuing the spanning-tree vlan-id
priority value command, where value is a number from 0 through 65535; the default priority is
32768. By issuing the spanning-tree vlan 3 priority 0 command, you can ensure that the switch
you select is the root bridge even if another device is added to the network with a default bridge
priority value and a lower MAC address. In most cases, the device with the lowest priority value
setting will be the root bridge. The only variation occurs when two devices have the same priority
value setting; in this case, the device with the lowest MAC address will be the root bridge. The
combination of the priority value setting and the MAC address is used to determine which device has
the highest bridge priority.

2. The solutions for the following steps are based on the following output:

Switch1#show spanning-tree vlan 3


VLAN0003
Spanning tree enabled protocol pvst
Root ID Priority 0
Address 000C.1380.3538
Cost 19
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32771


Address 000C.1289.3959
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 15

Interface Role Sts Cost Prio.Nbr Type


------------------- ---- --- --------- -------- -----------------------------
Fa0/1 Desg FWD 19 128.1 P2p
Fa0/2 Desg FWD 38 128.2 P2p
Fa0/3 Root FWD 19 128.3 P2p

(continued on next page)

6 Boson NetSim Lab Manual


(continued from previous page)

Switch2#show spanning-tree vlan 3


VLAN0003
Spanning tree enabled protocol pvst
Root ID Priority 0
Address 000C.1380.3538
Cost 19
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32771


Address 000C.1461.3123
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 15

Interface Role Sts Cost Prio.Nbr Type


------------------- ---- --- --------- -------- -----------------------------
Fa0/1 Root FWD 19 128.1 P2p
Fa0/2 Desg BLK 38 128.2 P2p
Fa0/4 Desg FWD 19 128.4 P2p

Switch3#show spanning-tree vlan 3


VLAN0003
Spanning tree enabled protocol pvst
Root ID Priority 0
Address 000C.1380.3538
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 0
Address 000C.1380.3538
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 15

Interface Role Sts Cost Prio.Nbr Type


------------------- ---- --- --------- -------- -----------------------------
Fa0/1 Desg FWD 0 128.1 P2p
Fa0/3 Desg FWD 0 128.3 P2p
Fa0/4 Desg FWD 0 128.4 P2p

7 Boson NetSim Lab Manual


a. The sample output from all the switches displays 000C.1380.3538 as the MAC address of
the root bridge for VLAN 3. The root bridge is the switch with the lowest bridge ID. The
bridge ID is composed of a 2-byte bridge priority and a 6-byte MAC address. The bridge priority
is considered first in the determination of the lowest bridge ID. When two or more switches
have the lowest priority value, the switch with the lowest MAC address becomes the root
bridge.

When a switch is powered on, it sends out bridge protocol data units (BPDUs) that contain the
switch’s bridge ID. As soon as a switch receives a BPDU with a lower bridge ID than the bridge
ID of the current root bridge, the switch will consider that BPDU to be superior, replace the root
bridge ID with the bridge ID from the BPDU, and recalculate the root port and port costs. This
can have an undesired effect on how packets are sent through a switched network. Therefore,
to ensure that a particular switch remains the root bridge, you must ensure that any other
switch you connect to the network has a higher priority value than the one you select.

b. The sample output from all the switches shows that the switches are running Per VLAN
Spanning-Tree (PVST) protocol. STP is used to determine the path that frames will take when
multiple paths are available. You can determine the protocol from the following line of the
sample output:

Spanning tree enabled protocol pvst

c. Switch3 is the root bridge. One way to determine which device is the root bridge is to look for
a line of output that contains the following text: This bridge is the root. In this scenario,
the output from Switch3 contains this line of text; therefore, Switch3 is the root bridge.

Another way to determine which device is the root bridge is to compare the root ID address
and the bridge ID address. The root ID address, which is the MAC address of the root bridge, is
the same for all three switches; in this scenario, the root ID address is 000C.1380.3538. The
bridge ID address is the MAC address of the local device. The output from Switch3 shows that
the MAC address of the root ID and bridge ID are the same; therefore, Switch3 is the root
bridge.

d. In the sample output, the root bridge has a priority of 0, as indicated in the following line from
the sample output:

Root ID Priority 0

e. FastEthernet 0/2 on Switch2 is in the blocking state, as indicated by the following line from the
sample output:

Interface Role Sts Cost Prio.Nbr Type


------------------ ---- --- --------- -------- ----------------------------
Fa0/1 Root FWD 19 128.1 P2p
Fa0/2 Desg BLK 38 128.2 P2p
Fa0/4 Desg FWD 19 128.4 P2p

8 Boson NetSim Lab Manual


Sample Configuration Scripts
Router1
Router1#show running-config
Building configuration...
Current configuration : 725 bytes
!
Version 15.b
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname Router1
!
ip subnet-zero
!
ip cef
no ip domain-lookup
!
interface Serial0
no ip address
no ip directed-broadcast
shutdown
!
interface Serial1
no ip address
no ip directed-broadcast
shutdown
!
interface FastEthernet0/0
encapsulation dot1q 3
ip address 192.168.100.1 255.255.255.0
no ip directed-broadcast
!
interface FastEthernet0/1
no ip address
no ip directed-broadcast
shutdown
!
ip classless
no ip http server
!
line con 0
line aux 0
line vty 0 4
login
!
no scheduler allocate
end

9 Boson NetSim Lab Manual


Switch1 Switch1 (continued)
Switch1#show running-config interface FastEthernet0/9
Building configuration... !
Current configuration : 939 bytes interface FastEthernet0/10
! !
Version 15.b interface FastEthernet0/11
service timestamps debug uptime !
service timestamps log uptime interface FastEthernet0/12
no service password-encryption !
! interface Vlan 1
hostname Switch1 no ip address
! no ip route-cache
ip subnet-zero !
! vlan 3 name VLAN0003
ip cef !
no ip domain-lookup ip classless
spanning-tree mode pvst no ip http server
spanning-tree extend system-id !
! line con 0
interface FastEthernet0/1 line aux 0
switchport mode trunk line vty 0 15
! login
interface FastEthernet0/2 !
switchport mode trunk no scheduler allocate
! end
interface FastEthernet0/3
switchport mode trunk
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!

10 Boson NetSim Lab Manual


Switch2 Switch2 (continued)
Switch2#show running-config interface FastEthernet0/8
Building configuration... !
Current configuration : 967 bytes interface FastEthernet0/9
! !
Version 15.b interface FastEthernet0/10
service timestamps debug uptime !
service timestamps log uptime interface FastEthernet0/11
no service password-encryption !
! interface FastEthernet0/12
hostname Switch2 !
! interface Vlan 1
ip subnet-zero no ip address
! no ip route-cache
ip cef !
no ip domain-lookup vlan 3 name VLAN0003
spanning-tree mode pvst !
spanning-tree extend system-id ip classless
! no ip http server
interface FastEthernet0/1 !
switchport mode trunk line con 0
! line aux 0
interface FastEthernet0/2 line vty 0 15
switchport mode trunk login
! !
interface FastEthernet0/3 no scheduler allocate
! end
interface FastEthernet0/4
switchport mode access
switchport access vlan 3
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!

11 Boson NetSim Lab Manual


Switch3 Switch3 (continued)
Switch3#show running-config interface FastEthernet0/8
Building configuration... !
Current configuration : 1000 bytes interface FastEthernet0/9
! !
Version 15.b interface FastEthernet0/10
service timestamps debug uptime !
service timestamps log uptime interface FastEthernet0/11
no service password-encryption !
! interface FastEthernet0/12
hostname Switch3 !
! interface Vlan 1
ip subnet-zero no ip address
! no ip route-cache
ip cef !
no ip domain-lookup vlan 3 name VLAN0003
spanning-tree mode pvst !
spanning-tree vlan 3 priority 0 ip classless
spanning-tree extend system-id no ip http server
! !
interface FastEthernet0/1 line con 0
switchport mode trunk line aux 0
! line vty 0 15
interface FastEthernet0/2 login
! !
interface FastEthernet0/3 no scheduler allocate
switchport mode trunk end
!
interface FastEthernet0/4
switchport mode access
switchport access vlan 3
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!

Copyright © 1996–2017 Boson Software, LLC. All rights reserved. NetSim software and documentation are protected by copyright law.

12 Boson NetSim Lab Manual

Das könnte Ihnen auch gefallen