1 00:00:00,000 --> 00:00:08,000 So once again on switch 1, sh spanning-tree VLAN 1 2 00:00:08,000 --> 00:00:11,000 shows us that these ports are blocking 3 00:00:11,000 --> 00:00:14,000 1, 2 and 3 are blocking for VLAN 1 4 00:00:14,000 --> 00:00:19,000 same for VLAN 10, 1, 2 and 3 are blocking. 5 00:00:19,000 --> 00:00:22,000 So what we will do now is go to global config mode 6 00:00:22,000 --> 00:00:24,000 and type spanning-tree 7 00:00:24,000 --> 00:00:29,000 because this is per-VLAN Spanning Tree I can do this on a per-VLAN basis. 8 00:00:29,000 --> 00:00:31,000 So I’m gonna specify VLAN 10 9 00:00:31,000 --> 00:00:36,000 and I’m gonna change the priority of the switch to 0. 10 00:00:36,000 --> 00:00:41,000 So previously notice in the bridge ID 11 00:00:41,000 --> 00:00:45,000 the switch priority was 32778 12 00:00:45,000 --> 00:00:48,000 in other words the default priority + the VLAN number of 10. 13 00:00:48,000 --> 00:00:51,000 do sh spanning-tree VLAN 10 14 00:00:51,000 --> 00:00:56,000 now shows me that the priority of the switch is 10 15 00:00:56,000 --> 00:01:02,000 in other words priority 0 + VLAN number gives me a priority of 10 16 00:01:02,000 --> 00:01:05,000 and this switch is now the root of VLAN 10. 17 00:01:05,000 --> 00:01:09,000 The ports are going through different states at the moment 18 00:01:09,000 --> 00:01:14,000 so we're at learning state and now the ports are forwarding 19 00:01:14,000 --> 00:01:19,000 now we need to do a lot of Spanning Tree optimization here 20 00:01:19,000 --> 00:01:24,000 the first thing we’ve done is made this switch the root for VLAN 10 21 00:01:24,000 --> 00:01:29,000 but we also want to change the port type to allow Rapid Spanning Tree 22 00:01:29,000 --> 00:01:32,000 to converge a lot quicker than it's converging at the moment. 23 00:01:32,000 --> 00:01:36,000 We want to make this point-to-point links in Spanning Tree 24 00:01:36,000 --> 00:01:38,000 and we'll get to that in a moment 25 00:01:38,000 --> 00:01:44,000 but for now, what we’ve done is made this switch the root for VLAN 10 26 00:01:44,000 --> 00:01:47,000 and let’s do the same for VLAN 1 27 00:01:47,000 --> 00:01:50,000 so sh spanning-tree vlan 1 28 00:01:50,000 --> 00:01:55,000 we can see that these ports are currently blocking 29 00:01:55,000 --> 00:01:59,000 but after a period of time, they should go to learning and there you go 30 00:01:59,000 --> 00:02:03,000 so they go to blocking, listening and then learning 31 00:02:03,000 --> 00:02:05,000 and now they go to forwarding 32 00:02:05,000 --> 00:02:08,000 so the ports are now forwarding on the switch 33 00:02:08,000 --> 00:02:11,000 so this is better than what we had previously. 34 00:02:11,000 --> 00:02:18,000 The switch priority is 1 because we set the priority to 0 + the VLAN number of 1 35 00:02:18,000 --> 00:02:20,000 this switch is the root switch. 36 00:02:20,000 --> 00:02:25,000 So we’ve made this switch the root for VLAN 1 and VLAN 10 37 00:02:25,000 --> 00:02:29,000 we want to make the switch 2 the root now for VLAN 20. 38 00:02:29,000 --> 00:02:39,000 So on switch 2, conf t spanning-tree vlan 20 priority 0 39 00:02:39,000 --> 00:02:44,000 sh spanning-tree vlan 20 40 00:02:44,000 --> 00:02:49,000 switch priority is now 20 in other words 0 + the VLAN number 41 00:02:49,000 --> 00:02:53,000 switch is the root, the switch is forwarding in all ports 42 00:02:53,000 --> 00:02:56,000 the switch was the root previously for VLAN 20 43 00:02:56,000 --> 00:02:59,000 so hence the port stayed as forwarding 44 00:02:59,000 --> 00:03:04,000 because the switch was the root but notice now for VLAN 1 45 00:03:04,000 --> 00:03:12,000 the switch is forwarding on all ports but blocking on gigabit 0/1. 46 00:03:12,000 --> 00:03:17,000 Back on switch 1, let’s look at the Spanning Tree for VLAN 20 47 00:03:17,000 --> 00:03:24,000 this is still not good because the switch is still blocking port 3, 2 and 1. 48 00:03:24,000 --> 00:03:26,000 so to optimize this 49 00:03:26,000 --> 00:03:31,000 we want to make this switch the backup root switch for VLAN 20 50 00:03:31,000 --> 00:03:36,000 and to do that we're going to type spanning-tree vlan 20 priority 51 00:03:36,000 --> 00:03:41,000 and I can't enter a priority of 1 because it must be in multiple of 4096 52 00:03:41,000 --> 00:03:46,000 so the next lowest priority that I can use is 4096. 53 00:03:46,000 --> 00:03:52,000 So do sh spanning-tree vlan 20 now 54 00:03:52,000 --> 00:03:58,000 shows me that this ports 2 and 3 are designated ports 55 00:03:58,000 --> 00:04:02,000 where’s previously they were alternate ports. 56 00:04:02,000 --> 00:04:06,000 After period of time, we should see the ports go forwarding 57 00:04:06,000 --> 00:04:10,000 so they're currently learning, still learning while we waiting for that 58 00:04:10,000 --> 00:04:14,000 notice gigabit 0/1 is still an alternate port 59 00:04:14,000 --> 00:04:19,000 and is blocking because we have 2 ports to the same root switch. 60 00:04:19,000 --> 00:04:25,000 But now notice 0/0 is forwarding its root port 61 00:04:25,000 --> 00:04:29,000 these 2 ports are forwarding, so 2 and 3 are forwarding 62 00:04:29,000 --> 00:04:31,000 as they are now designated ports. 63 00:04:31,000 --> 00:04:34,000 This is better than what we had before. 64 00:04:34,000 --> 00:04:38,000 so sh run | include span 65 00:04:38,000 --> 00:04:41,000 this command were enabled by default 66 00:04:41,000 --> 00:04:47,000 but what we’ve done now is make the switch the root bridge for VLANs 1 and 10 67 00:04:47,000 --> 00:04:50,000 and the backup root for VLAN 20 68 00:04:50,000 --> 00:04:58,000 on switch 2 we need to make this switch the backup root bridge for VLAN 10 69 00:04:58,000 --> 00:05:06,000 and VLAN 1, so set the priority for VLAN 10 to 4096 70 00:05:06,000 --> 00:05:08,000 and do the same for VLAN 1 71 00:05:08,000 --> 00:05:12,000 sh run | include spanning-tree 72 00:05:12,000 --> 00:05:16,000 so this 2 once again with default commands 73 00:05:16,000 --> 00:05:22,000 we’ve made switch 2 the backup root switch for VLANs 1 and 110 74 00:05:22,000 --> 00:05:25,000 and the root for VLAN 20. 75 00:05:25,000 --> 00:05:30,000 So in our topology, this switch is the root for VLANs 1 and 10 76 00:05:30,000 --> 00:05:32,000 and this switch is the root for VLAN 20 77 00:05:32,000 --> 00:05:34,000 they are both back up roots for each other 78 00:05:34,000 --> 00:05:41,000 in other words, these ports are forwarding on both the switches. 79 00:05:41,000 --> 00:05:45,000 The only port that’s blocking is this port on both the core switches 80 00:05:45,000 --> 00:05:50,000 and we're going to improve that in a moment by running EtherChannel 81 00:05:50,000 --> 00:05:54,000 but once again sh spanning-tree vlan 10 82 00:05:54,000 --> 00:05:56,000 for VLAN 10 all ports are forwarding 83 00:05:56,000 --> 00:05:59,000 for VLAN 20 all ports are forwarding 84 00:05:59,000 --> 00:06:03,000 except for this link between the 2 core switches. 85 00:06:03,000 --> 00:06:09,000 And for VLAN 1 all ports are forwarding because this is the root bridge. 86 00:06:09,000 --> 00:06:12,000 Something similar can be seen on switch 2 87 00:06:12,000 --> 00:06:15,000 sh spanning-tree vlan 10 88 00:06:15,000 --> 00:06:18,000 alternate port is this one here 89 00:06:18,000 --> 00:06:22,000 0/1 same can be seen for VLAN 1 90 00:06:22,000 --> 00:06:25,000 this port is the alternate port. 91 00:06:25,000 --> 00:06:29,000 But for VLAN 20, all ports are forwarding. 92 00:06:29,000 --> 00:06:32,000 So we’ve improved the Spanning Tree 93 00:06:32,000 --> 00:06:35,000 by making this switch the root for some VLANs 94 00:06:35,000 --> 00:06:37,000 and this switch the root for other VLANs 95 00:06:37,000 --> 00:06:39,000 Let’s have a look at the access switches. 96 00:06:39,000 --> 00:06:47,000 On access switch 3, show run | include span 97 00:06:47,000 --> 00:06:51,000 the default Spanning Tree configuration has been done 98 00:06:51,000 --> 00:06:53,000 we haven't done anything additionally here. 99 00:06:53,000 --> 00:06:56,000 So let’s have look at VLAN 10 100 00:06:56,000 --> 00:07:02,000 the root port for VLAN 10 is this port gigabit 0/0 101 00:07:02,000 --> 00:07:06,000 the alternate port which is blocking is 0/1 102 00:07:06,000 --> 00:07:11,000 but for VLAN 20 notice that’s been flip around 103 00:07:11,000 --> 00:07:14,000 this is the root port for VLAN 20 104 00:07:14,000 --> 00:07:17,000 and this is the alternate port for VLAN 20 105 00:07:17,000 --> 00:07:22,000 so blocking for VLAN 20, this port is blocking for VLAN 10. 106 00:07:22,000 --> 00:07:27,000 So if you have IP phones and PCs connected this switch 107 00:07:27,000 --> 00:07:30,000 the result is that VLAN 10 traffic 108 00:07:30,000 --> 00:07:33,000 let’s assume that your PCs will use this uplink 109 00:07:33,000 --> 00:07:38,000 and VLAN 20 which is your phones would use this uplink 110 00:07:38,000 --> 00:07:40,000 the same is going to be true for this switch. 111 00:07:40,000 --> 00:07:43,000 VLAN 20 traffic is going to use this uplink 112 00:07:43,000 --> 00:07:46,000 and VLAN 10 traffic is going to use this uplink. 113 00:07:46,000 --> 00:07:53,000 So switch 4 sh spanning-tree vlan 10 114 00:07:53,000 --> 00:08:03,000 root port is gigabit 0/1, 20, root port is gigabit 0/0 115 00:08:03,000 --> 00:08:08,000 so we have once again been able to implement load sharing of traffic 116 00:08:08,000 --> 00:08:12,000 in the uplinks on this switch as well as this switch. 117 00:08:12,000 --> 00:08:16,000 So Spanning Tree is a lot better now than what it was previously. 118 00:08:16,000 --> 00:08:18,000 So what’s the recommendation? 119 00:08:18,000 --> 00:08:25,000 make sure that you configure your core switches as the root switches 120 00:08:25,000 --> 00:08:32,000 now we can use a command such as sh spanning-tree root on switch 1 121 00:08:32,000 --> 00:08:35,000 to see which ports are root ports. 122 00:08:35,000 --> 00:08:40,000 now there are no root ports on the switch for VLANs 1 and 10 123 00:08:40,000 --> 00:08:42,000 because the switch is the root switch 124 00:08:42,000 --> 00:08:47,000 but notice for VLAN 20 the root port is gigabit 0/0 125 00:08:47,000 --> 00:08:52,000 and the cost to get to the root is 4, this gigabit link has a cost of 4. 126 00:08:52,000 --> 00:08:58,000 On switch 2 sh spanning-tree root 127 00:08:58,000 --> 00:09:05,000 notice for VLAN 1 and 10 its root port is 0/0 with the cost of 4 128 00:09:05,000 --> 00:09:09,000 there is no root port for VLAN 20 129 00:09:09,000 --> 00:09:12,000 the root cost is 0 because the switch is the root switch. 130 00:09:12,000 --> 00:09:16,000 something similar could be seen on our access switches 131 00:09:16,000 --> 00:09:20,000 so sh spanning-tree root on switch 3 132 00:09:20,000 --> 00:09:27,000 the switch over here has gigabit 0/0 as the root port for VLAN 1 and VLAN 10 133 00:09:27,000 --> 00:09:32,000 gigabit 0/1, this port is the root port for VLAN 20 134 00:09:32,000 --> 00:09:37,000 and lastly, on switch 4 something similar can be seen sh span root 135 00:09:37,000 --> 00:09:43,000 root ports for 1 and 10 are gigabit 0/1 over here 136 00:09:43,000 --> 00:09:46,000 root port for VLAN 20 is this port. 137 00:09:46,000 --> 00:09:52,000 We’ve optimized Spanning Tree now a lot better that it was a moment to go. 138 00:09:52,000 --> 00:09:56,000 However, we still have a blocking port here 139 00:09:56,000 --> 00:10:01,000 so we want to optimize that by creating a link aggregation of these 2 ports 140 00:10:01,000 --> 00:10:06,000 and will do that in the next video.