eworm on meadow QR code: rsc.eworm.de RouterOS Scripts
a collection of scripts for MikroTik RouterOS

Forward received SMS

GitHub stars GitHub forks GitHub watchers required RouterOS version Telegram group @routeros_scripts donate with PayPal

⬅️ Go back to main README

ℹ️ Info: This script can not be used on its own but requires the base installation. See main README for details.

Description

RouterOS can receive SMS. This script forwards SMS as notification.

A broadband interface with SMS support is required.

Sample notification

sms-forward notification

Requirements and installation

Just install the script:

$ScriptInstallUpdate sms-forward;

… and add a scheduler to run it periodically:

/system/scheduler/add interval=2m name=sms-forward on-event="/system/script/run sms-forward;" start-time=startup;

Configuration

You have to enable receiving of SMS:

/tool/sms/set receive-enabled=yes;

The configuration goes to global-config-overlay, this is the only parameter:

ℹ️ Info: Copy relevant configuration from global-config (the one without -overlay) to your local global-config-overlay and modify it to your specific needs.

Notification settings are required for e-mail, gotify, matrix, ntfy and/or telegram.

Tips & Tricks

Take care of harmful commands!

It is easy to fake the sending phone number! So make sure you do not rely on that number for potentially harmful commands. Add a shared secret to match into the text instead, for example: reboot-53cr3t-5tr1n9 instead of just reboot.

Order new volume

Most broadband providers include a volume limit for their data plans. The hook functionality can be used to order new volume automatically.

Let’s assume an imaginary provider ABC sends a message when the available volume is about to deplete. The message is sent from ABC and the text contains the string 80%. New volume can be ordered by sending a SMS back to the phone number 1234 with the text data-plan.

:global SmsForwardHooks {
  { match="80%";
    allowed-number="ABC";
    command="/tool/sms/send lte1 phone-number=1234 message=\"data-plan\";" };
};

Adjust the values to your own needs.

See also


⬅️ Go back to main README
⬆️ Go back to top

RouterOS Scripts documentation generated on Thu, 20 Nov 2025 20:47:50 +0100 for main/3287/699be25b
Copyright © 2013-2025 Christian Hesse <mail@eworm.de>