An STP example within GNS3

Configuring a Spanning Tree in GNS3:
————————————

I found that configuring the SPT  was always a bit vague due to the fact that
dynamips / dynagen emulate Cisco IOS Routers, not switches. I didn’t find a simple
example that tells me how to configure the STP using GNS3, so here goes;

1. Take eg an 3745 IOS Router image within GNS3 and add the esx16 card to this router.
Ports for the ESX16 card start with fa1/0. Perform this for 3 routers and connect their links from the esx16 cards manually within GNS3.

Create a “loop” by connecting the 3 switch – cards in a triangle.

(R1 <-> R2 <-> R3 <-> R1)

2. Create VLANs the “old” way on all three switches:
# vlan database
vlan 3
apply
vlan 2
apply
exit

Check:
# show vlan-switch

3. Make sure you set the ports manually to 100mb fd and configure them
for trunking:

conf t
int range fas 1/0 – 3
switchport trunk encapsulation dot1q
switchport mode trunk
speed 100
duplex full
no shut
end
wr
4. Check the status of the trunks within the triangle for all 3 switches
and the spanning tree.

R2# sh cdp neighbors
Capability Codes: R – Router, T – Trans Bridge, B – Source Route Bridge
S – Switch, H – Host, I – IGMP, r – Repeater

Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
R3               Fas 1/1            120        R S I      3745      Fas 1/1
R1               Fas 1/2            158        R S I      3745      Fas 1/2

R2# sh int trunk

Port      Mode         Encapsulation  Status        Native vlan
Fa1/1     on           802.1q         trunking      1
Fa1/2     on           802.1q         trunking      1

Port      Vlans allowed on trunk
Fa1/1     1-1005
Fa1/2     1-1005

R2#show spanning-tree vlan 2

VLAN2 is executing the ieee compatible Spanning Tree protocol
Bridge Identifier has priority 8192, address c401.021f.0001
Configured hello time 2, max age 20, forward delay 15
Current root has priority 8192, address c400.021f.0001
Root port is 43 (FastEthernet1/2), cost of root path is 19

In the above example the STP has been influenced by adjusting the BID
priority:
R1(config)# spanning-tree vlan 2 root primary

…Have fun…

This entry was posted in Cisco Networking. Bookmark the permalink.