I have a RB751G-2HnD running RouterOS 5.25
I have found that the following script will run OK when launched from the console, but not from webfig, winvox or scheduler:
:global IPSECOLD
:local IPSECNEW [:resolve xyz.dyndns.org]
:if ($IPSECNEW != $IPSECOLD) do={
:set IPSECOLD $IPSECNEW
/ip ipsec policy set 1 sa-dst-address=$IPSECNEW
/ip ipsec peer set 1 address=“$IPSECNEW/32”
:log info “IPSec: remote peer updated”
} else={
:log info “IPSec: no update needed”
}
The specific command that won’t execute when script is run from either, webfig, winbox or scheduler is:
/ip ipsec peer set 1 address=“$IPSECNEW/32”
If the condition is met, the log only shows “ipsec policy changed by admin” and nothing else when run from webfig, winbox or scheduler, while if run from terminal, all the actions are executed and get logged: “ipsec policy changed by admin”, “ipsec peer changed by admin”, “IPSec: remote peer updated”
Could this be a bug on 5.25? I’m pretty sure that this was working correctly on 5.23