Broken script since 2.9 to 3.9 upgrade

Hi All

I’ve had this bit of script working fine in 2.9, but now in 3.9 it does not seem to work


{/ip route set [/ip route find dst 0.0.0.0/0] gateway 192.168.15.254}

Any ideas?

Thanks in advance

Glen

Try something like this

/ip route set [/ip route find dst-address="0.0.0.0/0"] gateway="192.168.15.254"

-Louis

Hi Louis

Thanks for the reply. I’ve tried your suggestion, but still not working.

Any other ideas?

Thanks

Glen

is your 0.0.0.0/0 route dynamic or static?

Do you get an error message when you try to change it from CLI?

You can only set/edit static routes.

-Louis

It’s a static route, and I don’t see andy errors if I run the same command from the terminal…

I’m considering going back to 2.9, but I’ve not got the downgrade feature to work yet either!

Glen

This works correctly under ROS 3.7:

:local found

:set found "0"
/ip route
:set found [/ip route find dst-address="0.0.0.0/0"]

:if ($found = 0) do={
        :log info "Dst-Address not found. Adding.";
        /ip route add dst-address=0.0.0.0/0 gateway=192.168.15.254; }

:if ($found != 0) do={
        :log info "Dst-Address found. Updating.";
        /ip route set $found gateway=192.168.15.254; }

Enjoy!
-Krige