BPDU Guard & BPDU Filter (STP Toolkit)
Synchronized Transcript
117 cues indexed • Click dialogue or words to jumpHello and welcome to Jeremy's IT Lab. In this video, we are continuing with the STP toolkit section of our CCNA course. We're going to focus on BPDU guard and BPDU filter, two features that are often used in combination with PortFast, which we covered in the previous video.
These features determine how a port reacts when receiving BPDUs and in the case of BPDU filter, whether the port sends BPDUs, helping to protect and manage your network's STP topology.
Let's get started. Here's what we'll cover. We are continuing with the STP toolkit. The previous video covered PortFast, a feature that you should enable on switch ports connected to end hosts, allowing them to communicate over the network right away after connecting.
In this video, we'll cover two more. BPDU guard, which automatically disables a port if it receives a BPDU, and BPDU filter, which stops a port from sending BPDUs or processing received BPDUs.
BPDUs. As I said before, these features are often used in combination with PortFast on ports connected to end hosts. Cisco also expects you to know root guard and loop guard for the CCNA and we'll cover them in the next video.
Before introducing BPDU guard and filter, let's see how a PortFast enabled port handles STP BPDUs. PortFast makes a port start in the forwarding state when it is connected, but it doesn't disable STP on the port.
So, this switch's G0/1 port has PortFast activated and it sends BPDUs every 2 seconds like a regular STP port. The PC, which doesn't run STP, ignores the BPDUs, but G0/1 keeps sending them.
I used show spanning-tree interface G0/1 detail, the same command I showed a few times in the previous video. As highlighted, PortFast is enabled on G01, G01, and it has sent 77 BPDU's so far, but received zero from the PC.
Because end hosts don't run STP and send BPDU's, a PortFast enabled port shouldn't receive BPDU's. But here's the question.
What if it does? Maybe a user brings their own switch to work and connects it to the network. What happens then? Let's see. Instead of a PC, switch one's G01 is now connected to another switch, switch two.
switch two. As you know, when a switch comes online, it assumes it is the root bridge and sends its own BPDU's. So, what does switch one do upon receiving a BPDU from switch two?
If a PortFast enabled port receives an STP BPDU, it will revert to acting like a regular STP port without PortFast. Let's say switch one's priority is 32768, 32768, and switch two's is 4096.
Because switch two has a lower priority, and therefore a lower bridge ID, switch two becomes the root bridge, and switch one G01 becomes a root port.
So, what's the problem here? Let's rewind a bit. Here's a simple LAN of three switches. Switch one is the root bridge with all designated ports.
Switch two and switch three each have one root port leading towards switch one, and the link between switch two and switch three is blocked. Bob from accounting is a user in the office.
office. Now, usually users don't connect directly to a switch. Instead, there is a wall jack near the user, such as on the wall of their office, if they have their own office.
The switch connects to the wall jack, and the user's device does, too. This is a pretty standard setup. But let's say Bob is tired of walking to the printer, and decides to bring his own printer to work.
And maybe the Wi-Fi is slow, so he wants to connect his laptop to the wired network instead of Wi-Fi. But the wall jack in his office only has one port.
So, what does he do? Instead of following procedure and creating a support ticket with the IT department, Bob takes things into his own hands.
own hands. He brings an old switch he had at home to work and connects it to the network. Then, he connects his devices to his switch and they can all access the LAN.
Problem solved, right? Well, maybe Bob's problem has been solved, but his switch and switch three start exchanging spanning tree BPDU's and this could impact the network.
For example, what if Bob's switch becomes the root bridge? If Bob's switch has a lower STP bridge ID and becomes the root bridge, that can affect the rest of the STP topology.
Now, each switch's root port points towards Bob's switch and the switch one switch two link is blocked. This is a problem. We don't want a user's switch affecting the STP topology.
topology. For example, maybe switch one was the root bridge because it's connected to the LAN's router. By making switch one the root bridge, we ensure that each other switch has an efficient path to reach switch one and therefore the router.
But now, switch two's most efficient path is blocked and frames from hosts connected to switch two have to take the less efficient path through switch three instead.
This isn't a disaster, but in any case, we don't want unauthorized user devices negatively impacting the network. network. Let's summarize and then see how BPDU guard solves this problem.
PortFast should only be enabled on ports connected to non-switched devices, like end hosts or routers. And these devices don't send BPDU's.
However, a PortFast enabled port still sends BPDU's and will operate like a regular STP port if it receives BPDU's from a neighbor.
So, if an end user carelessly connects a switch to a port meant for end hosts, like Bob from accounting, it could affect the STP topology. Shame on you, Bob.
Do better. But fortunately, BPDU guard acts as a safeguard against such a situation. Let's see how BPDU guard works.
BPDU guard protects the network from unauthorized switches being connected to ports intended for end hosts, such as switch 3's G01 port in this example.
BPDU guard can be configured separately from port fast, but both features are usually used together because they both enhance STP's functionality on ports intended for end hosts.
So, what exactly does BPDU guard do? A BPDU guard enabled port continues to send BPDUs, but if it receives a BPDU, it enters the error disabled state.
So, if Bob connects his switch to the wall jack and it sends a BPDU to switch 3, 3, switch 3 will error disable its G01 port. port.
In effect, this disables the port. It can no longer send or receive data or BPDUs. BPDUs. This prevents Bob's switch from affecting the STP topology, and Bob's going to be thinking the internet doesn't work and come complaining to the IT department.
Mission accomplished. Let's see how to configure BPDU guard. Like port fast, it can be configured in two ways. First, it can be configured per port in interface config mode.
The command to do that is spanning-tree BPDU guard enable. And here's the output of show spanning-tree interface detail for G01.
As I've highlighted, BPDU guard is enabled. enabled. Okay, so you can configure BPDU guard on each individual port, or you can enable it by default from global config mode.
The command to do that is spanning-tree port fast BPDU guard default. And note that in modern Cisco IOS, you can optionally add the edge keyword when configuring it.
configuring it. Either way, the device will automatically add the keyword to the configuration, like we covered in the port fast video. Here's that same show command showing that BPDU guard is enabled by default.
Now, when you enable port fast by default, it's activated on all access ports, but BPDU guard works a bit differently. differently. When you enable BPDU guard by default, it is activated on all port fast enabled ports, not necessarily all access ports.
Remember that difference. Points like this can definitely be tested on the CCNA exam. But, just like port fast, after enabling BPDU guard by default, you can then disable it on specific ports if you want.
The command is spanning-tree BPDU guard disable in interface config mode. Okay, that's how you configure BPDU guard.
guard. Use whichever method suits you, but make sure you don't enable it on a port that is supposed to be connected to another switch, as that will disable the port.
Continuing on from the topic of disabling the port, let's look at how that works. Switch 3's BPDU guard enabled port has received a BPDU from Bob's switch, so it is error disabled.
In Switch 3's CLI, you'll see this message appear. Received BPDU on port Gigabit Ethernet 01 with BPDU guard enabled, disabling port.
port. And another similar message, BPDU guard error detected on G01, putting G01 in error disabled state. And then these two messages saying the interface status has changed to down and down.
down. In the output of show interfaces G01, you can see that the interface has been error disabled. error disabled. Error disable is a Cisco switch feature that disables a port under certain conditions, such as a BPDU guard violation.
violation. If a BPDU guard enabled port receives a BPDU, that's a violation and the port is disabled. disabled. You will learn a few other examples for the CCNA exam, such as power policing violations, port security violations, and DAI, dynamic ARP inspection violations.
But, those are topics for later in the course. Let's see BPDU guard in action on a Cisco switch. Cisco switch.
I've configured PortFast and BPDU guard on port one on the left of the top switch. switch. Below it is another Cisco switch, so let's connect them. Notice that the link light turns solid amber right after connecting it.
That means the port has been err-disabled due to BPDU guard. It can't send or receive data. Even if I disconnect the cable, the solid amber link light remains on.
Normally, the link light turns off when you disconnect the cable, but in this case, it stays on to indicate that the port is err-disabled. As we just saw, disconnecting the cable from the switch doesn't solve an err-disabled port.
So, let's see how to re-enable it so the port can be used again. First of all, to re-enable an err-disabled port, you should first solve the underlying issue.
This is key because if you re-enable the port without fixing the issue, it will just be err-disabled again. In this example, if I re-enable switch three's G0/1 port, it will just receive another BPDU from Bob's switch and be disabled again right away.
So, let's disconnect Bob's switch from the wall jack. And then, reconnect Bob's PC. Now, let's see how to re-enable the err-disabled port.
There are two ways to re-enable a port that has been err-disabled. The first is manual, using the shutdown and no shutdown commands to reset the disabled port.
port. The second is automatic, using a feature called err-disabled recovery. Let's see how that works. Air disable recovery is a feature that automatically re-enables air disabled ports after a certain period of time.
To view the status of air disable recovery on the switch, use show air disable recovery. Here's the output. At the top, there's a list of air disable reasons and their status.
The list is quite long, so I've omitted most of it, but as I've highlighted, BPDU guard is second on the list. And as it says, air disable recovery is disabled by default.
So, that means that air disabled ports won't automatically recover by default. You have to enable air disable recovery if you want it. As I've highlighted in pink, the default recovery timer is 300 seconds or 5 minutes.
minutes. This means that air disabled ports will be automatically re-enabled after 5 minutes if you enable air disabled recovery. recovery. You can modify this interval if you want with air disable recovery interval and then the interval in seconds.
But even if you modify the interval, you still need to enable air disable recovery for it to work. So, let's do that. that. Use air disable recovery cause and then the cause to enable it for ports disabled by the specific cause.
The cause is the feature that disabled the ports. For this video, we're talking about BPDU guard, but as I said before, we'll cover a few other causes later in the course.
the course. For example, if you look at the top of the air disable reason list in the output above, the top one is ARP inspection, referring to DAI, dynamic ARP inspection, another CCNA topic.
To enable it for a BPDU guard, use air disable recovery cause BPDU guard as I did here. did here. This time, show air disable recovery shows that it is enabled for BPDU guard.
And G01 is listed at the bottom of the output, meaning that it will be automatically re-enabled after 296 seconds. seconds. When this timer counts down to zero, the interface will be re-enabled.
One final point. Even if you use air disable recovery to automatically re-enable disabled ports, you still have to solve the underlying problem, like I said before.
said before. In our scenario, if Bob's switch is still connected to G01 right after air disable recovery re-enables the port, it will just be disabled again after receiving a BPDU.
Okay, we've covered BPDU guard. Now, let's move on to BPDU filter. Before we look at how it works, let's see the problem it solves. A switch port connected to an end host continues sending BPDUs every 2 seconds.
And it does this regardless of whether port fast and BPDU guard are enabled. So, even though Bob's PC doesn't run spanning tree and simply ignores any BPDUs, switch three keeps sending BPDUs to Bob's PC once every 2 seconds.
If the port doesn't connect to a switch, sending BPDUs is both unnecessary and also undesirable for a couple of reasons. reasons. First is that sending BPDUs uses some bandwidth and processing power on the switch, although it's minimal.
Not a big deal, but still unnecessary. Second is that BPDUs contain information about the LAN's STP topology. And if maximum security is a concern, you should avoid sending this info to user devices.
devices. BPDU filter solves this by preventing a port from sending BPDUs. Let's explore how BPDU filter works. As I just mentioned, it stops a port from sending BPDUs.
So, if you enable it on switch three G01, it won't send any more BPDUs to Bob's PC. Bob's PC. But, unlike BPDU guard, BPDU filter doesn't disable the port if it receives a BPDU.
a BPDU. How the switch reacts when it receives a BPDU depends on how you configure BPDU filter. So, let's see how to do that. BPDU filter can be enabled in two ways, just like PortFast and BPDU guard.
It can be configured per port in interface config mode or by default in global config mode. config mode. However, unlike PortFast and BPDU guard, BPDU filter functions differently depending on how you configure it.
To configure it on a specific port, use spanning-tree BPDU filter enable in interface config mode. With BPDU filter enabled, the port will not send BPDUs.
On top of that, the port will ignore any BPDUs it receives. Basically, this disables STP on the port. And for that reason, you should use it with caution in bold red letters.
PortFast enabled on the wrong port can cause temporary layer two loops. But BPDU filter enabled on the wrong port can cause permanent layer two loops and is a great way to cause a broadcast storm and bring down the network.
STP is a key protocol for preventing loops, so disabling it on a port can be very risky. very risky. A better choice is to enable BPDU filter by default in global config mode.
The command is spanning-tree portfast BPDU filter default. filter default. And again, you can optionally use the edge keyword after portfast.
Just like when enabling BPDU guard by default, BPDU filter will be activated on all PortFast enabled ports. And then you can use spanning-tree BPDU filter disable to disable it on specific ports if necessary.
When BPDU filter is activated on a port by default, the port will not send BPDUs, just like above. But here's the difference. If the port receives a BPDU, PortFast and BPDU filter are disabled and it operates as a normal STP port.
This is the best of both worlds. Under normal circumstances, the port doesn't send BPDU's, but if it receives BPDU's, it is able to react appropriately.
It doesn't just ignore them. Before we finish up, let me give you my recommendation and one final note about BPDU guard and BPDU filter.
You can enable port fast and BPDU guard however you prefer, either per port or by default. It doesn't affect how they operate. operate. However you configure them, just make sure you enable them on the correct interfaces.
interfaces. But I recommend that you only enable BPDU filter by default in global config mode. Unless you have a very good reason to enable it per port. Disabling STP on a port is risky business.
business. Okay, one final note about BPDU guard and BPDU filter. They can be enabled on the same port at the same time, but the end result depends on how you configured BPDU filter.
filter. If BPDU filter is enabled in global config mode, so it's enabled by default, and the port receives a BPDU, BPDU filter will be disabled and BPDU guard will be triggered, meaning it will air disable the interface.
But what about if BPDU filter is enabled in interface config mode, enabled per port, and the port receives a BPDU? In that case, the BPDU will be ignored and BPDU guard will not be triggered.
Basically, BPDU guard doesn't have any effect in this case. So once again, I think it's better to activate BPDU filter in global config mode rather than interface config mode.
Okay, here's a one slide summary of this video. video. Port fast should only be enabled on ports connected to non-switched devices that don't send BPDU's.
Usually, you enable it on all ports connected to end hosts like PCs and maybe routers. maybe routers. The port still sends BPDU's and will operate like a regular STP port if it receives BPDUs from a neighbor.
This means that if an end user carelessly connects a switch to a port meant for end hosts, like Bob from accounting did in our example, it could affect the STP topology.
To prevent this, you should use BPDU guard. guard. BPDU guard protects the network from unauthorized switches being connected to ports intended for end hosts.
If a port with BPDU guard receives a BPDU, the port enters the err-disabled state. It can no longer send data. You can enable BPDU guard per port with spanning-tree BPDU guard enable, or by default with spanning-tree portfast BPDU guard default.
The default option enables it on all portfast enabled ports. You can then use spanning-tree BPDU guard disable to disable it on specific ports if necessary.
Now, if a port has been err-disabled by BPDU guard, how can you re-enable it? There are two ways to do so. Manual with shutdown and no shutdown, or automatic with err-disable recovery, which automatically re-enables the port after a certain period of
time, 5 minutes by default. To enable err-disable recovery for BPDU guard, use err-disable recovery cause BPDU guard.
BPDU guard. But whether you want to re-enable ports manually or with err-disable recovery, make sure you fix the underlying problem that caused the port to be err-disabled.
Otherwise, it will just be disabled again. again. Okay, finally we covered BPDU filter, which prevents a port from sending BPDUs. BPDUs.
But unlike BPDU guard, it doesn't disable the port if it receives a BPDU. How the port reacts upon receiving a BPDU depends on how you configured BPDU filter.
filter. Like BPDU guard, there are two ways to configure it. You can enable it per port with spanning tree BPDU filter enable. In this case, the port will ignore any BPDU it receives.
So, use it with caution. caution. This basically disables STP on the port. So, if you enable it on a port connected to another switch, it could cause a loop.
loop. You can also enable BPDU filter by default with spanning tree port fast BPDU filter default, which enables it on all port fast enabled ports.
In this case, if the port receives a BPDU, port fast and BPDU filter are disabled, and the port operates as a normal STP port.
And you can use spanning tree BPDU filter disable to disable it on specific ports if necessary. Okay, that's all for this video on BPDU guard and filter.
I hope it was helpful. Thanks for watching. Before finishing this video, let me thank my JCNP level channel members who support me through YouTube channel membership.
membership. To become a member, please click the join button under the video. Thanks to Yonathan Macara, Vilva Jayakum, George, Naseer Choudhary, Gustavo Macedo, Marcel Lord, Dragos Hirnea, Zakeeb Shah, Mar Salman, Vitel's 194, Marco Jackson, Bold1C1U, Gerald William, Fristads1207, Hector
Hernandez, Arpad Kunivez, 5 Feet, Owad Daniel Brown, Jose Alvarez, Hussein Yabus, Samuel Tavares, Kevin Hayes, Roger Bratseth, Brian Grant, Georgi Yamajev, Cats for Life, Alison Pereira, Froid69, Mad Mark 50484, Alexandru Stratan,
Thiago Bicalho, DMJ2, Lucian Stoichitoiu, Kurt Nell, Steve Cox, Jasper Yim, Pedro Hartmann, Tricky Micky 123456, Ivan O'Capuano, Jefferson Steelflex, Toxic, Wilmer Romero, Sinan Sarisinar, Daniel Andrade, Dragos George, Jairo Francisco,
Filip Jovanovic, Trevor Goldman, Sunny Idegwu, Jeffrey C, Adif Care, Demitra Lease, Michal Chapski, Hemanth Jabopuri, Dariush D, Faris Alzahrani, Juan Morales, Gonzalo Nicolas, Doomed Soul, Christine Schubert, Julio Maya, Egrasso, Komlan Kpemey,
Hasham Roduf, Anand Abyankar, Idacola, Ismail Salami, Clyde McCorobindo, Orlando Flores, Adrian Martinez, GG7, Rohan Surti, Tobe Hedin, Arturo Remejo, Vic Brandon Byers, MDS Electron Arzequia, Raymond Kirby, G Gant, Henrietta
Sauer, Yousef Tasatan, Pablo Goto, Omar Abdelfattah, and Yukshika. Yukshika. Sorry if I pronounced your name incorrectly, but thank you so much for your support.
Thanks to you and my other supporters, I am able to make these videos and release them for free on YouTube. So, I really appreciate the support. Another great way to support the channel is to like the video, leave a comment, subscribe, and most importantly, share this video with others.
others. So, if this video was helpful, I'd appreciate it if you did any of those. Thanks for watching.