Pages

Monday, March 8, 2010

Spanning tree, PVST lab - GNS3


as usual, i'm using cisco 3740 with additional slot NM-16ESW.
for the 1st stage, we only use one link for every connection between every switch (i'll refer the router as the switch for the rest of the tutorial)


configure on D1, port fast 1/1 and 1/7
 no shutdown
 switchport trunk encap dot1q
 switchport mode trunk


on D2, no span tree yet on D2 because all port still down
 D2(config)#do sh span br
 No spanning tree instances exist.


configure the same we did on D2 for port 1/1 and 1/3
immediately after port change to trunk mode, you'll notice that it is in the listenin(LIS) mode
this is when they running the algorithm to find a loop
later the status will change to (learn)LRN then (forwarding)FWD
 D2(config-if)#do sh sp br
  ...




  Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID
  -------------------- ------- ---- ----- --- ----- -------------------- -------
  FastEthernet1/1      128.42   128    19 LIS     0 32768 c404.0f45.0000 128.42

apply the same configuration for the A2 and A1
 on A2, fast 1/5 and 1/3
 on A1, fast 1/5 and 1/7 (once this int is up, then looping will happen)

there will be no blocked port until you configure the fast 1/7, where the looping start to exist
right after fast 1/7 up, spanning tree will find and choose which port need to be blocked

now show the spanning tree on each switch
D1#show spanning-tree br

VLAN1
  Spanning tree enabled protocol ieee
  Root ID    Priority    32768
             Address     c404.0f45.0000
             This bridge is the root //this switch was elected as root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32768
             Address     c404.0f45.0000
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 0

Interface                                   Designated
Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/1      128.42   128    19 FWD     0 32768 c404.0f45.0000 128.42
FastEthernet1/7      128.48   128    19 FWD     0 32768 c404.0f45.0000 128.48


D2#show span br

VLAN1
  Spanning tree enabled protocol ieee
  Root ID    Priority    32768
             Address     c404.0f45.0000
             Cost        19
             Port        42 (FastEthernet1/1)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32768
             Address     c405.0f45.0000
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 0

Interface                                   Designated
Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/1      128.42   128    19 FWD     0 32768 c404.0f45.0000 128.42
FastEthernet1/3      128.44   128    19 FWD    19 32768 c405.0f45.0000 128.44


A2#sh span br

VLAN1
  Spanning tree enabled protocol ieee
  Root ID    Priority    32768
             Address     c404.0f45.0000
             Cost        38
             Port        44 (FastEthernet1/3)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32768
             Address     c407.0f45.0000
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 0

Interface                                   Designated
Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/3      128.44   128    19 FWD    19 32768 c405.0f45.0000 128.44
FastEthernet1/5      128.46   128    19 BLK    19 32768 c406.0f45.0000 128.46 //blocked port


A1#show spanning-tree br

VLAN1
  Spanning tree enabled protocol ieee
  Root ID    Priority    32768
             Address     c404.0f45.0000
             Cost        19
             Port        48 (FastEthernet1/7)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32768
             Address     c406.0f45.0000
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 0

Interface                                   Designated
Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/5      128.46   128    19 FWD    19 32768 c406.0f45.0000 128.46
FastEthernet1/7      128.48   128    19 FWD     0 32768 c404.0f45.0000 128.48

by default, switch with the lowest MAC address will be chosen as the root, to change this, try apply spanning-tree vlan 1 root primary on D2

D2(config)#spanning-tree vlan 1 root primary
 VLAN 1 bridge priority set to 8192
 VLAN 1 bridge max aging time unchanged at 20
 VLAN 1 bridge hello time unchanged at 2
 VLAN 1 bridge forward delay unchanged at 15

now check again, D2 should be the root now.

D2#show spanning-tree bri

VLAN1
  Spanning tree enabled protocol ieee
  Root ID    Priority    8192
             Address     c405.0f45.0000
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec ....

if you have multiple VLAN, you can chose which switch to be the root by applying the same command, just change the VLAN number

let's try this out, first, configure VTP for easy management on VLAN

D1(vlan)#vtp domain LAB
Domain name already set to LAB .
D1(vlan)#vtp server
Setting device to VTP SERVER mode

do the same for all the other 3 switches, just the change to CLIENT mode
then, create 1 VLAN on VTP sever (D1)

D1(vlan)#vlan 100 name seratus
VLAN 100 added:
    Name: seratus

make sure all other switches have the same vlan database

A1#show vlan-switch

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa1/0, Fa1/1, Fa1/2, Fa1/3
                                                Fa1/4, Fa1/6, Fa1/8, Fa1/9
                                                Fa1/10, Fa1/11, Fa1/12, Fa1/13
                                                Fa1/14, Fa1/15
100  seratus                          active
1002 fddi-default                     active
1003 token-ring-default               active
1004 fddinet-default                  active
1005 trnet-default                    active

by default calculation, D1 will be the root switch

D1#show spanning-tree br

....
VLAN100
  Spanning tree enabled protocol ieee
  Root ID    Priority    32768
             Address     c404.0f45.0001
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32768
             Address     c404.0f45.0001
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 0

Interface                                   Designated
Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/1      128.42   128    19 FWD     0 32768 c404.0f45.0001 128.42
FastEthernet1/7      128.48   128    19 FWD     0 32768 c404.0f45.0001 128.48

Simply repeat the step above to change the root for specific switch ;)

now bring up all the other port as trunk so each switch have 2 link between them, then you should see more clearly which port being blocked due to redundancy

ah, it is almost 5AM, i'm so lazy to paste all result here, furthermore i got Livepool game to watch later, so i'll just print screen all the result here









7 comments:

  1. I am unable to add Redundant links how your done this plzz let me know

    ReplyDelete
  2. i want to know one thing GNS3 not support switching so use router with 16 NM module ok my question is how it create MAC address for each router and SVI interfaces means in switch there is a base MAC address on which STP election happen but on router with 16 NM module how it create mac address.if u see above all interfaces have same MAC address these mac address are diffrent when u put show interface {interface number} output

    ReplyDelete
  3. I have the same lab listed above, with additional dual links for a full mesh. On some of hte non-bridge ports, they are transitioning from listening to blocking, to listening again....etc. I'm wondering if this is a GNS3 issue and not so much STP on the lab.

    ReplyDelete
  4. i am running nw-16esw and i have no spanning-tree, when i type show spanning-tree brief "No spanning tree instances exist." can you please help me.

    ReplyDelete
  5. I am also having same issue " No Spanning tree instance exist " , even though I created 4 VLANS & when i do show vlan-switch, It shows me all the VLANs exist. But when i do " show span-tree vlan 10" , it gives message " spanning tree instance for vlan 10 does not exist " ...

    ReplyDelete
  6. set on trunk ports
    duplex full
    speed 100

    ReplyDelete
  7. Good article, but the title is not what you are explaining. PVST+ is not supported in GNS3. you are using here the STP ;)

    ReplyDelete