This script for ipip tunnel works with v.7.1?

Hi! I use this script for a ipip tunnel in a 6.49.2 version for update the DDNS, because i have in both sites dynamic public IP . Someone knows if it will work with the new version 7.1? Thank you!

local LocalAddr “XXXXXXXXXXXXX.sn.mynetname.net
:local RemoteAddr “ZZZZZZZZZZZZZ.sn.mynetname.net
:local CommentIDF “tunnel1”

##########################################

:local NewLocalAddr [:resolve $LocalAddr]
:local NewRemoteAddr [:resolve $RemoteAddr]

:local OldLocalAddr [/interface ipip get [find comment=$CommentIDF ] local-address]
:local OldRemoteAddr [/interface ipip get [find comment=$CommentIDF ] remote-address]

if ($NewLocalAddr != $OldLocalAddr) do={
/interface ipip set [find comment=$CommentIDF] local-address=$NewLocalAddr
/log info “Local tunnel IP for $CommentIDF has changed from $OldLocalAddr to $NewLocalAddr”
}

if ($NewRemoteAddr != $OldRemoteAddr) do={
/interface ipip set [find comment=$CommentIDF] remote-address=$NewRemoteAddr
/log info “Remote tunnel IP for $CommentIDF has changed from $OldRemoteAddr to $NewRemoteAddr”
}

Yes, it will work. You can easily test things like this yourself, even if you don’t have spare router, simply get free CHR, run in it VM, and test anything you want.

Question is whether you need it at all. You can use hostname for remote address directly, IPIP tunnel supports it for some time already. And unless you have some multi-WAN config or several addresses on WAN for any other reason, you shouldn’t need to set local address at all.

Thanks for your answer Sob.

The problem about not use the script, I think, is that if my ISP changes the IP once the router is started, the tunnel will not change by itself. Also, some time ago I tried to put the ddns in the ip tunnel configuration and if I reboot the router and changes the public IPs in the tunnels, the ip’s are not updated, so they do not connect with each other.

I think that where I have to put the ddns so that it works as you indicate is in the red fields of the photo, right?
Captura de pantalla 2021-12-16 085633.png

if you use DNS name, than why you need that script?

I didn’t test exact behaviour, how it deals with address changes, so maybe there is some unexpected glitch. Test it, don’t set Local Address at all (close the field with arrow at the right), put remote hostname in Remote Address, and see how it works. If it does, good. If not, you can either try to debug what wrong, in case it’s some bug. Or just go back to script, if it works for you.