Remote IP Public Static For Secondary Gateway - Mikrotik Script RouterOS

So that the Public Static IP can be used for remote even though not as the main gateway

An easy example like this ... suppose we use Indihome as the main gateway and Astinet as a backup gateway, in the standard routing concept, of course, Public IP Astinet cannot be used for remote because its position is only as a backup gateway, so that Astinet Public IP can still be used for example. Winbox remote needs are very easy, and this method can also be applied to all ISP that have Public Static IP

Or you can use Script Maker or Generator

####################################################################
# Remote IP Public Static For Secondary Gateway Mikrotik
# Date/Time: 2/14/2021, 1:40:07 PM
# By BuanaNET Secure! https://fb.me/buananet.pbun
####################################################################

/ip firewall mangle
add action=mark-connection chain=input in-interface="ether2" new-connection-mark=ip-public passthrough=yes
add action=mark-routing chain=output connection-mark=ip-public new-routing-mark=ip-public passthrough=no

/ip route
add check-gateway=ping gateway="192.168.10.1" routing-mark=ip-public
Credit: https://www.o-om.com/2020/12/remote-ip-public-static-for-secondary.html