Loop network. Is it possible?

Hello,

I wanted to ask is there is possible to make something like loop network? I mean like connecting switches to mikrotik and make them return to it.
And if somewhere between switches would be cutted cable it won’t stop switches from getting internet connection. I made a diagram about what I’m trying to say. I hope you’ll understand.
mikrotik_schema.jpg

Make sure your switches talk RSTP and also set your local bridge mode to RSTP.
Then you’re absolutely fine.
Look here. And read the linked Wikipedia articlae about STP.
-Chris

Thank you for your answer :slight_smile: It worked :slight_smile: But I have another question. Is it possible to configure mikrotik to send an email when there is loop broken? I mean if somebody cuts the cable than mikrotik would send email about this situation.

I’m sure there’s a way to monitor the state of the ethernet ports of that bridge if they’re forwarding or in backup state, maybe you should go for a script here.
The other way I could think of is a MAC-ping, pinging the MAC address of ether3, originating from ether2. When it fails, there’s a cable problem.
This should be pretty easy to implement in a script to add to the scheduler and let it run every five minutes or something…

-Chris

Could you give me an example of how can I do it? :slight_smile:

I’d do it like this:
:local count 5
:local arpping [/ping count=$count interface=ether2]

if ($arpping < $count) do={
/tool e-mail send to= subject=“Loop cabling fault” body=“Ping unsuccessful.\r\nOnly $arpping of $count packets came through.\r\nCheck Cabling.”
:log warning “Cable fault detected”
}Alter the count variable to any value you like.
Add this to your scripts repository and then add a scheduler item to run this script as often as you consider it necessary.
…and have /tool e-mail configured properly :wink:
This is just written down from scratch and not tested, but it should work.

Good luck,
-Chris

I Tried it and it worked! Thank you very much :slight_smile: But I have one more question :smiley: What should I do to make mikrotik send an email only 1 time per day but the loop cabling would be tested every minute? Because I made this script to run every minute and tried to unplug cable. It started spamming :smiley:

Glad to hear it works.
I see your problem.

So we need to know whether you’ve been notified.
Again, just written from scratch and not tested, but this should be the way:
:global notified
:local count 5
:local arpping [/ping count=$count interface=ether2]

if ($arpping < $count) do={
if (!$notified) do={
/tool e-mail send to= subject=“Loop cabling fault” body=“Ping unsuccessful.\r\nOnly $arpping of $count packets came through.\r\nCheck Cabling.”
:set notified true
:log warning “Cable fault detected”}:

} else={:set notified false}Edit: With this version you’ll be notified once per cabling fault, not once per day.
So as soon as a fault is detected you will receive a notification.
-Chris

This one doesn’t work for me. :slight_smile:
Maybe it would be better to create 2 scripts?
1: Every 5min checks the loop and if there is a problem it creates a scheduler for another script and when it’s fixed again it deletes that schedule.
2: E-mail sending script about the problem (I’s unnecessary to send the count of failed pings). 1 script creates scheduler for 2 script making him to activate every 24hour.

I hope you’ll understand what I’m trying to say :slight_smile: I would like to know if it’s possible to do :slight_smile: