00:00:00 - Now that we've talked about the concepts behind spanning tree
00:00:03 - protocol, let's get it set up. We're gonna take a look first off
00:00:07 - at our new network diagram. We're going to enhance what our network
00:00:10 - diagram looks like, add some redundant connections, then we will
00:00:13 - look at the, in the current spanning tree protocol configuration,
00:00:17 - because it's already running on all CISCO devices. Let's see
00:00:20 - how it ran, by default. Then we'll tweak it, we'll tune it, we'll
00:00:24 - make it more efficient, and then we'll do some tests. I'm gonna do some ping
00:00:27 - tests and pull some links and see what happens, and how long
00:00:30 - spanning tree takes to fail over. Now before we get going
00:00:34 - into the material, I have to show you something. I have to show
00:00:38 - you this most amazing, coolest thing, I've ever owned in my life.
00:00:42 - You may have heard of the Apple iPhone, right. Well, I got
00:00:46 - one, and you gotta see it. You gotta see this picture I just took
00:00:50 - of it. It is the biggest waste of time I have ever had, but I love
00:00:53 - it and I can't stop using it. Look at what I'm doing. This is an Apple
00:00:56 - iPhone, right. It is SSH'ed into a CISCO firewall. Look
00:01:02 - I went into privilege mode enable. I typed in my password. I got into global
00:01:06 - config, from my phone.
00:01:08 - Isn't that awesome. I could fix a network issue from a red light
00:01:12 - on, on, on the road, or a green light for that matter. Why not?
00:01:16 - So, anyway, this, this thing is great. I'm telling you. There's, there's
00:01:19 - hundreds of programs for it, and you can get all kinds of, like,
00:01:23 - network sniffers for it.
00:01:25 - It's, it's amazing. I haven't figured out how to connect to consul table
00:01:28 - to it yet, but that's, that's, that's my latest cool thing. Okay.
00:01:32 - Let's talk about STP.
00:01:34 - So I've made some slight changes to this network diagram since the
00:01:38 - previous video. All I did for this configuring and testing spanning
00:01:43 - tree, is move the pc's back out of their vlan's. Now don't worry,
00:01:47 - that's a temporary thing. This is just gonna be the basic
00:01:50 - STP, before we get into all the enhancements, and to do that, everything
00:01:54 - is just put back into VLAN one. So you can see these two computers
00:01:58 - are out of their vlans. They're a sign. They're, they're a normal vlan 1
00:02:01 - IP addresses. They're able to ping each other again. These vlan's
00:02:04 - are still there. They're just, I guess you, we could put a
00:02:07 - little, not in use, because everything is currently joining
00:02:12 - vlan 1. Now, in order to set up redundancy, what I did was, connect
00:02:18 - a cross over cable between switch two and switch three, on
00:02:22 - fastEthernet0/24 on both of them. Now what that
00:02:26 - does, is create a redundant link, so if switch one goes down,
00:02:30 - switch two and switch three can still communicate, and the pc's can
00:02:33 - talk, they can still at least get across the WAN links, and so on.
00:02:35 - They'll just lose connectivity to whatever switch one was connected
00:02:38 - to, but when I introduce that link into the picture, we now
00:02:42 - have a loop in the network, so spanning tree needs to jump in
00:02:45 - and block one of these connections, but before we can determine
00:02:49 - which one it's gonna block, we have to Telnet in and do
00:02:53 - some show commands to find out who the root bridge is, so let's do
00:02:56 - that. I'm gonna take you to the,
00:03:01 - let's, let's just start on switch one, that's our core switch. So I'll
00:03:04 - take you to switch one and type in the show command. You can just
00:03:07 - type this in from any switch that's running spanning tree.
00:03:11 - Just type, show spanning tree. You can also type that from your Apple iPhone
00:03:15 - if you wanted to. Alright, I'll stop. You can see, I'm gonna stop the
00:03:19 - upper right there. You can see we have vlan 1 running right
00:03:22 - now, and it gives some information about spanning tree. It says,
00:03:25 - spanning tree is enabled protocol i triple e, meaning, its industry
00:03:28 - standard. Underneath here, you'll see it divided into two sections,
00:03:32 - Root ID and Bridge ID.
00:03:36 - This, right here, is the information about the root, meaning, the
00:03:41 - root switch currently has the priority 32769. It
00:03:47 - It currently has the mac address 008, you know, there's
00:03:50 - a mac address. It currently costs 19 to reach the root
00:03:53 - and I'm going out port FastEthernet0/11
00:03:59 - to get there. As a matter of fact, if you glance down under interfaces, you can see
00:04:03 - FastEthernet0/11 is designated as the root port. Okay.
00:04:08 - So all of this information right here, is information about
00:04:13 - the root bridge. This, is information about switch one, the switch
00:04:18 - that you're currently on. You can see the bridge ID is the
00:04:22 - mac address is this. The hello timing, and how often it is saying hello
00:04:26 - and, and checking the spanning tree topology. This is actually
00:04:29 - how often it's sending out BPD use, to say, hey, is there a loop in
00:04:33 - the network, once every two seconds, because to a switch, that's, that's
00:04:37 - not a problem. There's tons of bandwidth to use, so it's always
00:04:40 - checking to see if there's a new loop in the network. So this
00:04:43 - is the divide between the two. Now, you might remember,
00:04:46 - that I said the default priority on every switch is 32768.
00:04:50 - That was from the previous video when we talked about
00:04:53 - the concepts. Now CISCO switches run a special version of spanning
00:04:58 - tree we're going to talk about in the enhancements called per VLAN
00:05:01 - spanning tree. So what it actually does to enhance it, is that
00:05:06 - the vlan number. They call it a system ID extension to the
00:05:10 - priority, and so all the switches that are in vlan 1, have
00:05:13 - 32769 as their priority. If you were in vlan 10, you
00:05:17 - would have 32778, which would be the priority
00:05:22 - plus ten more. So it always adds the vlan number, but it's, it's
00:05:26 - the same thing. All the switches are tied on their priorities,
00:05:29 - so it's using the mac address to find out the, or to, to break
00:05:34 - the tie and, and determine the root bridge. So, while
00:05:38 - it's all fine and dandy that this has told us, hey, this is
00:05:41 - the root bridge, I mean, how do you know who has that mac address?
00:05:46 - Well it's time to trace some cables. You look at your network diagram and find
00:05:49 - find out on switch one, what does port 11 or FastEthernet0/11
00:05:53 - connect to.
00:05:56 - We jump back here, FastEthernet0/11 connects to switch two.
00:06:00 - So chances are, if you follow that link, you're gonna
00:06:05 - find the root bridge, and as a matter of fact, you can also notice,
00:06:08 - notice right here FastEthernet0/12 is blocked.
00:06:13 - So that gives us a big clue, choonk, choonk, that that link is
00:06:18 - disabled, because that is the least efficient connection. So
00:06:21 - the two active links right now, are these two, so you can kind of see
00:06:27 - and diagnose what spanning tree is doing. Now the problem is, the thirty
00:06:30 - our core. We want that to be our root. It's the bigger
00:06:33 - switch, but switch two became the root, just because it has
00:06:36 - an older mac address, an older manufacturing date, so that's the
00:06:40 - one that is currently active right now as the root bridge.
00:06:43 - So, well actually, let's jump on over to switch two, and just verify
00:06:48 - from there.
00:06:50 - I'm going to type in, show spanning tree
00:06:52 - Look at that. VLAN 1, Root ID, this is the root
00:06:56 - information, and it says right there, it's very blatant, this
00:07:01 - bridge is the root. You can look below and see that the mac
00:07:05 - address of the bridge ID, which is this switch, matches the
00:07:09 - mac address of the Root ID, because they're one and the same,
00:07:11 - same priority, same mac address. Notice every single port is considered
00:07:16 - designated, because the root bridge never blocks its ports.
00:07:20 - So as of right now,
00:07:23 - this switch, switch two, is our root, and that's why it makes
00:07:27 - sense that this link over here ended up being blocked. Now when
00:07:31 - comparing switch three and switch one, switch one must have
00:07:35 - an older mac address then switch three, because it blocked its
00:07:39 - side of the connection. Let me show you what I'm talking about. I'll jump over switch
00:07:42 - switch three and do a show spanning tree,
00:07:46 - and you can see, you know, from switch three's perspective, it's like, ay,
00:07:50 - everything's great. Root port, we've got designated ports all down here.
00:07:54 - This is what I was talking about in the previous video, that
00:07:56 - sometimes it's difficult to determine who's blocking their
00:07:59 - interface, because from switch three's end of the picture,
00:08:03 - it's saying, hey, I'm great, because only switch one has blocked
00:08:07 - its interface. Okay. So that's the idea. We verify that spanning
00:08:11 - tree is operating. It's not operating efficiency, because the wrong
00:08:15 - switch got elected as the root. So how do we change that?
00:08:19 - Let me show you the one major command of spanning tree. If
00:08:23 - you wanna run nothing but standard spanning tree, this is
00:08:26 - the only command that you'll need. However, in modern times,
00:08:30 - most people will apply some of the spanning tree enhancements, so
00:08:33 - we'll talk about in the next video, but this is it. We want
00:08:36 - switch one to be our root, right? So I'm gonna go up to switch one
00:08:42 - Let's do a show spanning tree there one more time, just to verify
00:08:47 - that as of right now, we have somebody else as the root, and
00:08:50 - we know that's, that is currently switch two, so I'm gonna go into global
00:08:54 - config mode and type in, spanning tree, followed by vlan 1, because
00:09:00 - we're modifying spanning tree for vlan 1. Everything in this network
00:09:03 - is running vlan 1 as of right now, so spanning tree vlan 1,
00:09:06 - I heard the question mark. The key that I'm looking for, well
00:09:10 - I can do it one of two ways. I can type in root space, and then
00:09:15 - choose my primary, primary or secondary. If I type in primary, it will
00:09:20 - lower my switch priority to the i triple e recommended value.
00:09:25 - The i triple e is the standards body who created spanning tree,
00:09:28 - They're gonna set it to a recommended value that they say
00:09:31 - should be the primary root. The secondary root could be a
00:09:35 - backup. For instance, if I had two core switches, or two major
00:09:39 - switches in my network that I wanted to be redundant for each
00:09:41 - other, I could set the secondary one as a backup for vlan 1.
00:09:47 - So, I'll show you the other method in just a second, but let's go
00:09:49 - back and do a show spanning tree and hit enter, and notice what happened
00:09:54 - The priority, not the mac address, the priority on my switch
00:09:59 - was decreased.
00:10:02 - It went down to 24577. Again there's
00:10:06 - that nice dart on the dart board, right, and just, that's
00:10:09 - a good recommendation. So that is below the 32769,
00:10:14 - that everything else is in the network. So immediately, this
00:10:17 - which now becomes the root. Notice, we have designated ports
00:10:21 - on every single one. All of them are forwarding, except for the one
00:10:25 - that was blocked. It's currently in a state of learning. If I
00:10:27 - hit the up arrow, again, now you can see it's forwarding. I'm actually gonna show
00:10:31 - you what all the states are in just a moment too.
00:10:34 - So, this is now the root, which means, the switch two over here,
00:10:40 - let's, let's adjust our diagram. This is now the root. Switch
00:10:44 - two must have been bumped down, so let's hop over to switch two, do a show
00:10:48 - spanning tree,
00:10:50 - and sure enough, you can see switch two is no longer the root.
00:10:54 - It's pointing to the root bridge, which has that better
00:10:57 - priority right there, which is currently switch one. Notice it
00:11:01 - It has one root port, two designated ports, so just guessing, well, very, very
00:11:07 - confident guessing, I can say that switch three must have
00:11:11 - blocked that interface, fastEthernet0/24
00:11:14 - on that side, because, since this one has all forwarding ports, there
00:11:18 - has to be a blocked port in the networks, so switch from switch
00:11:21 - must have been it, and you can see it right there, that
00:11:24 - fastEthernet0/24 is currently in a blocked
00:11:27 - state. So that is setting the, the root bridge to switch one,
00:11:32 - and that's what you want to do in any one of your networks.
00:11:35 - Spanning tree is so easy to forget about. You get involved in
00:11:39 - all kinds of, you know, complex configurations, and you're setting
00:11:42 - things up, and things aren't working, and you're working through the
00:11:45 - night on this brand new network, and you get everything set up and
00:11:48 - you're like, aah, I'm going home, and you forget all about spanning tree.
00:11:52 - It's one command, but if you forget it, the, the network will never
00:11:57 - really run as well as it could, because it's not gonna be
00:12:00 - set up using the most efficient root bridge possible, and they'll
00:12:04 - just be running slow, and sure, everybody's gonna get used
00:12:07 - to it, and they're gonna be like, well, I guess the network is just that slow,
00:12:11 - and, and life goes on, not realizing all along that you could have
00:12:15 - a much faster network if you would just have the root bridge set
00:12:18 - correctly.
00:12:19 - Now let me show you the other way to do it.
00:12:23 - That was using a handy keyword, which was the spanning tree vlan 1
00:12:28 - root primary. The other way that you can set the root bridge,
00:12:31 - is to type in spanning tree vlan 1, and set the priority.
00:12:35 - This will manually allow you to type in the priority of spanning
00:12:40 - tree, which this is the value,
00:12:43 - right here, that it came up for us with, when we went in and, and
00:12:49 - typed in the primary. So notice right here, it's saying you can
00:12:53 - use any value from zero, or zero is obviously the best, all the
00:12:57 - way up to 61440, but you have
00:13:00 - to use increments of 4096.
00:13:05 - I don't know. I know you're thinking why, why did they do it
00:13:09 - that way, just, because, because they did. So that is the, the
00:13:14 - range of the, the priorities that you can have, all in increments
00:13:18 - of 4096. So you could use 04096
00:13:21 - 8192, and, you know, just keep adding
00:13:25 - 4096 to find out all the different values.
00:13:28 - So if you wanted to, you could actually set it down to
00:13:31 - zero, to make sure that this one always becomes the root. By
00:13:35 - the way, that is a known hacking method. I should mention this.
00:13:40 - You can set up, you know, so let's say, let's say this guy in his
00:13:43 - cubicle's, a very angry person who wants to try and destroy his,
00:13:46 - destroy your network. He could plug a managed switch, meaning a high end
00:13:51 - switch into the network cubicle wall jack, and type in spanning
00:13:55 - tree vlan 1 priority zero, to where his switch becomes the
00:14:00 - root bridge, and then everybody points to that cubicle as the
00:14:03 - center of the network, and the whole thing just starts going
00:14:05 - really slow, because it's going through a cubicle wall jack to
00:14:09 - do most of its connectivity. So there are actually methods
00:14:13 - out there that you can put in. It's actually known as root guard,
00:14:16 - and, and BPDU Guard, and things like that. Those are security
00:14:20 - systems that you can turn on, that if somebody plugs in an unauthorized
00:14:23 - switch that tries to do that, it will shut their port right
00:14:27 - down. Ha, take that. Alright, so we've got the root bridge set up.
00:14:32 - Now I want to show you a fail over.
00:14:36 - Actually, let's jump back to the topology here. I'm gonna show you what I'm gonna do.
00:14:40 - As of right now, we know we've determined that switch one is
00:14:43 - the root bridge, because that's what we set it to. This port
00:14:47 - and this port are forwarding. This link is blocked. It's set as
00:14:50 - the backup connection, should any one of those links fail, that
00:14:53 - spanning tree is managing. So here's what I want to do. I want
00:14:57 - to initiate a ping, a continual ping from, let's see, I'm sitting
00:15:03 - on this pc right now, so I'll do a ping from this pc to this
00:15:07 - pc that's constantly going. Once that ping is going, I'm going
00:15:11 - to disable, we'll just say this link right here, shut it
00:15:15 - down, so that it, it is no longer operational. I wanna see how long
00:15:19 - spanning tree takes to detect that problem, and then activate
00:15:24 - this switch link. You're ready.
00:15:26 - to watch. Here we go.
00:15:28 - Let me bring up the command prompt first,
00:15:32 - and I'm gonna type in ping. Actually let me just verify which
00:15:36 - one I'm on, IP config.
00:15:39 - This is, let me just scroll go back up. The 192.168.1.50
00:15:43 - pc, which is the smiling pc down here, and shrink
00:15:47 - his window down,
00:15:49 - about that big, so we can have the config window at the same
00:15:51 - time. Now I'm gonna type in ping, 192.168.1.20 - t,
00:15:56 - which is a repetitive thing, meaning, it's
00:16:00 - gonna go nonstop. It's just gonna keep on pinging. Alright.
00:16:03 - So that's going where we're now actively pinging network station.
00:16:07 - Let me bring up, actually, slide it up here
00:16:11 - this, this configuration window, which is switch one. Now let's
00:16:15 - see if I can still see my network diagram.
00:16:18 - Switch one is, I'm going to shut down fastEthernet0/12,
00:16:21 - which will disable the active link that's
00:16:25 - currently working for spanning tree. I'm gonna keep these both
00:16:28 - in the window, right here, so let me go into interface that
00:16:32 - fastEthernet0/12 and do a shut down.
00:16:40 - Alright, it is shut down, the pings have now stopped. Notice, the,
00:16:44 - the connections timing out below. I'm going to, let me just hop
00:16:48 - on over to switch three. I'm gonna do a show spanning tree right now. Notice
00:16:54 - what, what, oops, notice what mode,
00:16:57 - I don't know if you caught that before. It was in, and look at this.
00:17:01 - We're down. The networks down right now. It was in listening
00:17:04 - mode on that back up port, then it went to learning mode, and
00:17:10 - look at that. Wham. We're now back on line. The, the switch is pinging.
00:17:15 - Now that was, I'm, I'm sure you know with my kind of banter, talking
00:17:20 - and so on, that was about 30 to 50 seconds of a network
00:17:25 - outage that occurred, just to allow spanning tree to fail over.
00:17:29 - Now that may sound like, okay, that's, no worries, life is good, but remember,
00:17:34 - our networks nowadays, are running connections like voice over
00:17:39 - IP. You have phones running on the network. You have active
00:17:43 - file transfers. You have replications. You have airline schedules.
00:17:46 - You have credit card transactions. You have stock quotes. All of this
00:17:50 - stuff is happening real-time, step step, step, step, step, flying
00:17:53 - across your network. If you have a network outage of two seconds,
00:17:57 - that's something more people are like, whoa, what just happened? Phone
00:18:00 - calls drop everywhere, stock quotes get kind of, you know, off
00:18:04 - in, in off shift. If you go for 30 to 50 seconds in, and let me,
00:18:08 - let me revise my excitedness here, 30 to 50 seconds
00:18:13 - in
00:18:14 - a production network, in a critical business network, you're gonna
00:18:19 - have a major crisis on your hands. What I just demonstrated,
00:18:23 - is, why spanning tree, as it stands right now, is not used very
00:18:28 - often in full enterprise networks. There's enhanced versions
00:18:32 - of it that we use. As a matter of fact, watch this. I'm going to go,
00:18:36 - let's see, back on to switch one,
00:18:39 - under fastEthernet0/12, and do a no shut down.
00:18:42 - Let's power that guy back on, yay, will fix everything, right. What
00:18:46 - it's going to do, as, as soon as all the links are detected and,
00:18:49 - and back on line. Notice, notice, you see my equal signs, they've stopped.
00:18:53 - The network has gone down again. I'm serious. I'm gonna do a show spanning tree,
00:18:59 - Look at this. FastEthernet0/12 has gone into it's
00:19:02 - nice little listening state there. Let's do a spanning tree. Now
00:19:05 - it's learning. Meanwhile, imagine people right now going ha, ha
00:19:09 - network down, phone calls dropping, customer dissatisfaction, airlines
00:19:12 - are out of wack, credit cards aren't being processed. See, I'm trying to,
00:19:16 - I'm trying to hype this up here.
00:19:18 - There's got, you know, there's, there's a major network, and finally, we're,
00:19:22 - we're still dying here. It looks like the port is forwarding, but
00:19:25 - something still hasn't come back online. This is actually
00:19:28 - known as a blocking timer. Eventually,
00:19:33 - give it 60 seconds, give it a minute and a half or so, eventually
00:19:37 - it will renegotiate, and the port will come back on line and
00:19:40 - go active. Spanning tree, the version that we just saw,
00:19:45 - was developed a long time ago. I mean, think when switches came
00:19:49 - out, that's when spanning tree came with it, because people wanted a
00:19:52 - redundant connection. So we're talking a, a technology, that a decade
00:19:56 - ago, it wasn't that big of a deal to have an outage of 30
00:19:59 - seconds. That's alright, but nowadays, we have to use enhanced
00:20:03 - versions. So there it is, basic spanning tree protocol, essentially
00:20:09 - a protocol that is necessary in our networks, but needs to
00:20:12 - be enhanced and upgraded, as we just saw. So, what we first off
00:20:16 - looked at, was enhancing our network diagram, by adding
00:20:20 - in a redundant link between the two switches, which spanning
00:20:24 - tree did its job. It identified it, and it blocked it. So we identified
00:20:29 - the current spanning tree configuration, which just the oldest
00:20:32 - switch that you have in your network, will be elected as the
00:20:34 - root bridge, and all the switches will find the best way to reach
00:20:38 - that root bridge, and then block all the redundant connections.
00:20:41 - So, what we need to do, is find the best switch in our network,
00:20:45 - even in the enhanced version. I, I don't mean to hype
00:20:48 - the enhanced version, like everything's better, everything's
00:20:50 - changed, although it is a lot better, but in the enhanced version,
00:20:54 - we still have to elect a root bridge. We still have to make
00:20:57 - sure that we have, you know, all the core technology of spanning tree
00:21:00 - even in, in the enhanced versions is the same. So we have to
00:21:04 - configure a root bridge and set that up as the core of our
00:21:06 - network, and all the switches will find the best way to the
00:21:10 - center and work from there.
00:21:13 - I hope this has been informative for you like to thank you for viewing.