Mikrotik switch SFP+ port issue on COLD restart

Hi All,

I have a crs226-24g-s2+rm running v6.42.11 (long-term), which has an odd issue with SFP+ port not coming back up after AC/DC loss.

This issue only happens if the switch loses AC/DC power and has an unexpected shutdown, a software reboot this does not happen.

Issue is the SFP+ will not come back up, shows under interfaces " no link, not running, slave"

To get the SFP+ to come back up, I need to

  • goto interfaces, uncheck “Enabled”, press Apply, wait 5 seconds
  • check off Enabled, and press Apply again

All resumes working, and life is good again until power is lost.

Is there anyway to script something to do this automatically upon boot everytime (shutdown sfpplus1, wait , restart it) ?

I am so desperate I would even settle for something as crude as
curl something http://switchipaddress/settings.cgi?sfpplus1=disabled?username=admin?password=idontevencare
curl something http://switchipaddress/settings.cgi?sfpplus1=enabled?username=admin?password=idontevencare
(can I toggle this via a script on a remote box, or even switch crontab /startup rc.local ? )

Also, this issue does not happen in my crs125-24g-1s-rm, the single SFP resumes automatically when power is cut and comes back.

SFP is a HUAWEI MA5671A which works perfect otherwise…

Edit: It only behaves like this using this SFP - other SFP are OK , and yes I understand this might be due to an incompatibility… but if I can work around this I am very happy!

Any ideas?

thanks
Jonathan

Why don’t you start with updating the ROS and see if the problem continues ?

… including routerboot.

Hey,

Good idea! - Upgraded firmware to v6.46.3 (stable), and routerboard to Current Firmware 6.46.3 …. and No change :frowning:

Is there anyway to just get to a shell, and ifconfig this sucker up and down and see if that works upon boot?

Any other ideas?

Jonathan

Trying to add a work around while getting this worked out…

added a start up script that seems to kinda work (3/5 tries) - I wonder if interface set sfp-sfpplus1 disabled= yes/no is equivalent to the GUI’s “Enabled” checkbox. No idea how to get to a shell prompt yet.

interface set sfp-sfpplus1 disabled=yes
delay 5
interface set sfp-sfpplus1 disabled=no



[admin@MikroTik] /system> script print
Flags: I - invalid
 0   ;;; reset sfp1 port to fix glitch with sfp
     name="startup-script" owner="admin" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon
     dont-require-permissions=no run-count=0 source=
       interface set sfp-sfpplus1 disabled=yes
       delay 5
       interface set sfp-sfpplus1 disabled=no
[admin@MikroTik] /system> schedule
[admin@MikroTik] /system scheduler>

.. -- go up to system
add -- Create a new item
comment -- Set comment for items
disable -- Disable items
edit --
enable -- Enable items
export -- Print or save an export script that can be used to restore configuration
find -- Find items by value
get -- Gets value of item's property
print -- Print values of item properties
remove -- Remove item
set -- Change item properties


[admin@MikroTik] /system scheduler> print
Flags: X - disabled
 #   NAME                  START-DATE  START-TIME                INTERVAL             ON-EVENT                 RUN-COUNT
 0   startup-script                    startup                   0s                   startup startup-script           0
[admin@MikroTik] /system scheduler> ..
[admin@MikroTik] /system> ..

I am not 100% certain if “ON-EVENT” should be the name of the script, or the keyword “startup” so I put both.

Jonathan

Any further update on this workaround, or ideally, identifying the problem on SFP port and resolving.

I find that the SFP port does not work - the remote device (modem) indicates it has negotiated at sub-100FX speed (something obviously wrong) and manual intervention is required to bring it back.

What is the MikroTik model ?
Ros version ?
SFP/SFP+ model ?

Having exactly the same issue on CRS326-24S+2Q+ (running different versions, currently 6.49) physically unplugging SFP module and reinserting also makes the link working again.

I’ve had an issue like this way back in the day on CCR’s back in the day and had to create a netwatch script that checks it peers ip address and disables and enables interfaces again.
Best course of action is to log a call with Mikrotik with the switches and affected SFP’s . Eventually my issue got fixed in a further downstream fw update.

Just saying that the SFP won’t work doesn’t really help…
Was it in the compatibility list of MikroTIK SFPs at the first place ?
Was it an SFP, SFP+ or QSFP module ?

I had the same issues with some SFP/SFP+ modules in the past…
SFP-Interfaces worked perfectly, but on some Reboot and/or Cold-Starts the Interface wouldn’t properly initiate.

We use a Scheduler on “startup” to,

  1. Wait 90 Sec.
  2. Check SFP/SFP+ Interface (If !running Step 3-6)
  3. Disable SFP/SFP+ Interface
  4. Wait 10 Sec.
  5. Enable SFP/SFP+ Interface
  6. Check SFP/SFP+ Interface (If !running Step 7)
  7. Notification (email, Telegram, etc..)

To be precise, my problem is a little different from this.

When I reboot rb5009, such as software upgrade, the sfp will be unresponsive. Even disable then enable interface won’t fix it.
I have to remove the stick from sfp port physically, then insert it to get it working again.
Is there a way to activate it by software?

I have written a script to reset sfp if issue happens, you can use it accordingly.

:local HOST "192.168.1.1"
:local PINGCOUNT "10"
:local INTF "sfp-sfpplus1"
:local DELAY "3s"
:log info "Delay 10s."
:delay 10s
:log info "Start pinging $INTF."
:if ([/ping $HOST interval=1 count=$PINGCOUNT] = 0) do={
:log error "Interface $INTF is down, restarting..."
/interface ethernet set $INTF auto-negotiation=no
:delay $DELAY
/interface ethernet set $INTF auto-negotiation=yes
:log warning "$INTF restart complete."
} else={
:log info "$INTF is working."
}

I’m suffering from a similar issue.
My router is CCR-1036-12G-4S-EM
I need to manually disable and enable SFP interfaces after router reboot to make the SFP work.

Is there any workaround for this? Please help.

I’m using UF-RJ45-1G SFP modules. Auto-negotiation is disabled and set to 1G.

The same SFP module works fine with the RB3011 router, and the issue is only with CCR.

For all that land here.Please log a ticket with Mikrotik.
They should be able if you provide them with enough diagnostic information be able to patch this in a downstream update unless there is some sort of hardware compatibility issue of the sorts.
They did it for me, they should be able to do it for you.

I’m using CRS328-24P-4S+ with LuLeey LL-XS2510 (rebranded DFP-34X-2C2 with custom firmware in it).
I had the same problem with stuck / not being able to auto negotiate with an SFP module on a hot reboot on every firmware including the last (at the time of this post) 7.15.3
However, on latest release-candidate 7.16rc2 this problem is now gone (thought, not mentioned in the changelog what so ever).
Sharing so if anyone came across this problem - update to latest stable routeros and test again.
If it still doesn’t work - update to release candidate, test again. If its still the same - open the ticket.

Mates, had literally same issue, but a bit different

Device: RB5009UPr+S+
SFP: Picotel GPON ONU SFP
RouterOS versions: 7.8, 7.15.2, 7.16.2

On the first connection of the SFP to the router - all works fine, however on the router reboot SFP was lost, even no details about the SFP device (manufacturer, etc) was visible in the interface view.
Unfortunately disable/enable, consequent router reboot, plug-out/plug-in didn’t help. Moreover, I’ve bought another SFP of the same model and it has not been recognized too.

However using RouterOS v 7.17rc3 helped. Yes, when reboot happens SFP “spins-up” no so quickly, but it “spins-up”. Will try few other SFP GPON modules soon, but again, RouterOS 7.17rc3 version if not resolves, but at least works around the issue.

maybe you can use netwatch tool… ? and launch script by the netwatch ?
I had some SFP problem with CRS326 switches, solved by upgrades and by SFP replacment.

May I send you a PM regarding the LuLeey module?

I have a related issue with 328-24P-4S.

The site suffers from frequent power-cuts and when power comes back some of the switches wont talk on SPF. Its wierd though. Lets say you have 3 switches daisy chained - after power comes back SW3 devices appear offline, yet SW3 shows up in neighbors list on SW1.

After a lot of checking and testing whats happening is traffic from SW3 is making it back to SW2 and SW1, but traffic to SW3 and its devices isnt making it past SW2 and the SFP on SW2 TX shows counters at zero.

Rebooting hard and soft doesn’t clear the issue. You have to power SW2 down for about 10min then it works again.

This issue has been present through many firmwares and still present in 7.17.

We’re looking at putting UPS in but its expensive and I can guarantee that if I swap out for say TPLink switches or any others this issue will go away, but these are Tiks flagship switches so you’d expect better. Also one of the few switches that support passive PoE.