Dear MikroTik Team,
I would like to suggest a new feature for the Winbox utility that could greatly enhance flexibility and automation: the ability to run a user-defined script before connecting to a MikroTik device.
Suggested Feature:
An optional script field (per session or globally) in Winbox where users can define commands or scripts to be executed prior to initiating a connection to a router.
Use Cases:
Port Knocking Automation
Some administrators secure access to their MikroTik devices using port knocking. With this feature, Winbox could automate sending the correct knock sequence to temporarily open required management ports before attempting to connect.
Dynamic Environment Setup
In advanced setups, users might need to:
Set up a specific VPN or tunnel before connecting.
Modify routing rules.
Define temporary environment variables.
Trigger logging or alerts for connection auditing.
Multiple Device Profiles
Users managing multiple environments (home lab, enterprise, client routers) could tailor the pre-connection behavior depending on the device profile, improving both usability and security.
Proposed Implementation:
Add a βPre-Connect Scriptβ field in each Winbox session entry.
Support running:
Windows batch (.bat)
PowerShell
Or even internal Winbox macros in the future.
A timeout and error-handling mechanism to abort the connection if the script fails or is interrupted.
This feature would be a small addition but provide enormous value to network administrators, especially those managing many remote or secured devices.
Thank you for considering this idea!
Best regards,
Tishri Clarin
Network Consultant & Software Developer