Community discussions

MikroTik App
jack2020
newbie
Topic Author
Posts: 43
加入: Sat Aug 17, 2019 4:47 pm

Looking for a script to update 2 public dynamic IP

Wed May 17, 2023 5:02 pm

去od morning:

I currently have two ISPs set up on my Mikrotik. Both providers give me a dynamic public IP. I have IP Cloud enabled so that it updates my IP when it changes. But with IP Cloud, only the IP of a single ISP that is connected on the eth1 port is updated. How can I capture the IP change of the second ISP that is on the eth2 port. Does anyone have a script for this. Thanks for any help.
Top
optio
Member Candidate
Member Candidate
Posts: 295
加入: Mon Dec 26, 2022 2:57 pm

Re: Looking for a script to update 2 public dynamic IP

Wed May 17, 2023 9:26 pm

You can retrieve public IP fromhttps://api.ipify.orgusing fetch tool.
Addapi.ipify.orginto address list and create 2 disabled mangle rules to mark routing for each route which will have created address list in dst list.
In script first enable mangle rule for routing over eth1, retrieve public IP with fetch tool, disable first rule, enable second rule, use fetch tool again to retrieve public IP from eth2 and then disable second rule.
Just a proposition, didn't try it, maybe there is a better way to achieve this...
Top
jack2020
newbie
Topic Author
Posts: 43
加入: Sat Aug 17, 2019 4:47 pm

Re: Looking for a script to update 2 public dynamic IP

Thu May 18, 2023 2:54 am

Thanks for the idea. I will try that option.
Top

Who is online

Users browsing this forum:Bing [Bot]and 5 guests

Baidu
map