cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
533
Views
0
Helpful
6
Replies

Switch to switch loop issue

13jobsp90
Level 1
Level 1

If I connect a cable between 2 ports on the same switch loop will come, if so how to avoid the loop even if it is done by mistake?Any particular commands to avoid this issue for future?

6 Replies 6

Dustin Anderson
VIP Alumni
VIP Alumni

most switches use spanning tree protocol to detect and stop loops. But at the expense of ~30 seconds for the link up. The command spanning-tree portfast can be used to basically bypass the detection, but it can then cause loops.

 

These are the global commands we set on access switches and if someone plugs in a switch or loops a wire it will shut down the port. This keeps you from needing to add on all ports, and if you do set a trunk or uplink can disable portfast on that one.

spanning-tree portfast default
spanning-tree portfast bpduguard default
spanning-tree loopguard default

ammahend
VIP Alumni
VIP Alumni

Spanning tree will take care of it, but you can take additional measure like configure BPDU Guard on access ports, configure broadcast storm control etc.

-hope this helps-

only under the interface config 

spanning tree bpduguard enable 

MHM

So what is the difference between these 3 commands 

spanning-tree portfast bpduguard default

spanning-tree loopguard default

spanning tree bpduguard enable

these config in global and make all port of SW portfast protect with portfast and this not correct 
the port connect SW to SW need to be NOT portfast and NOT bpduguard 

MHM

Joseph W. Doherty
Hall of Fame
Hall of Fame

@13jobsp90 wrote:

If I connect a cable between 2 ports on the same switch loop will come, if so how to avoid the loop even if it is done by mistake?Any particular commands to avoid this issue for future?


That's the purpose of STP, i.e. to block L2 loops.

However, to avoid edge ports waiting for STP to unblock them, the portfast option is used, but this does expose the switch to a L2 loop forming and rendering the L2 domain unusable.  (I believe portfast allowing a loop is more of a problem for STP vs. rapid-STP, but don't quote me.  [Oh, and rapid-STP is "better" than non-rapid, so highly recommend non-rapid not be used.])  There are some other STP options to try to mitigate the L2 forming on a port, as mentioned in some of the other replies.