I have enabled spanning-tree bpduguard on the Cisco 2960 but it seems like the unmanaged switch does not have spanning tree protocol. Any other configuration to prevent loop?
Network Engineering Stack Exchange is a question and answer site for network engineers. It only takes a minute to sign up.Sign up to join this community
Spanning-tree is the protocol designed to detect and prevent loops. bpduguard is intended for access ports -- ports connected to end users/machines (a single node.) A port configured for bpduguard gets disabled upon receiving a bpdu -- any bpdu. As such, enabling this feature on a port headed to a simple switch (aka "hub") is asking for trouble, the instant anyone connected to that "hub" sends a bpdu, the 2960 will disable the port leading to it -- cutting off the "hub" and everything connected to it.
The best option is to simply let spanning-tree on the 2960 work like normal. If you want the port to pass traffic immediately on link -- thus bypassing the normal stp discovery phase -- enable portfast. But otherwise, leave bpduguard off.
To start, take note that BPDU Guard (and BPDU Filter) are only in effect on ports that also have portfast enabled if enabled globally. If portfast is not enabled, BPDU Guard will have no effect unless applied directly to the port.
In my experience, non-managed switches come in two flavors with regards to BPDUs.
In the first case, BPDU guard will disable the port the instant it sees a spanning-tree BPDU, even if that BPDU isn't its own (thus a loop.) As drawn, BPDU guard will disable both ports since the 2960 will send a BPDU out both ports which will be reflected by the unmanaged switch into the opposite port.
In the second case, if the switch is not participating in STP itself, this will result in a L2 loop. Depending on your environment, there are a number of ways to mitigate a loop in this situation. Feel free to mix and match as you like.
There are other loop protection methods as well, such as loop guard, but these are the ones that I can think of that could help in the situation you describe.