Hi! Im inew in this forum, and new in the Mikrotik world. I linked 2 homes with an ipip tunnel. Both homes have dynamic IPs, so I created the Local and remote Address with DDNS. The problem is when some of the homes reboot the router. The IP changes, and the field “local address” in ipip tunnel doesnt update. I would like create a script for each Hour update the local and remote address fields in the ipip tunnel interface. Do you have a script for that?
Do you need any script at all? Remote address accepts hostname (I’m not sure since which RouterOS version), and local address is optional and should use current WAN address automatically.
Thanks for your answer Sob. Both in remote address and in local address I use ddns. The problem is that in the remote address the ddns remains permanently, but not in the local direction. When I put in the local address the address of ddns automatically translates it to the IP of the WAN. When I restart one of the routers the local address stays with the old IP and is not updated.
How can indicate that the IP of the wan be localized at any time? Both routers have Ros 6.41.2
Hi! The problem is that I use IPsec for this interface, so when I put the Local address field emtpy this message it show: Couldnt change Interface - both local and remote addrs must be set for ipsec to work (6)
It sounds like you might need a script. I’m not scripting guy, but bare-bones version is:
/interface ipip set local-address=[:resolve your.local.hostname] <ipip interface name>
Put it in scheduler and it works. I’m not sure if it would benefit from some error checking, or not setting the address when it didn’t change. Start with this and watch if anything happens with IPSec when the script runs (when address didn’t change).
If it wasn’t clear, what I posted works, so feel free to try it like this. Put it in scheduler, set the interval and enjoy. I didn’t try the whole thing with IPSec, but it will probably work fine too. The local address of tunnel changes correctly, and the only risk would be if RouterOS would see even setting the same address as change and reinitialized IPsec, but there’s good chance that it won’t.