Im trying to create a script to identify my routers public address at a specific port (mutiple ISPs in use behind nat) and foward my identified address via fetch-tool
I have the fetch tool script working well to post messages but i think i need a script that will identify the public address and save it to a “variable” and then forward the “variable” via fetch-tool.
Here is a snipet of my script for fetchtool that simply sends a “eth=down” message to a specific ipaddress and port.
Thanks for the reply it got me on track, although i still need to refine the script to do multiple ISP public.
So far i have set the following script to run in scheduler.
/ip cloud set ddns-enabled=yes
/ip cloud force-update
/delay 40
/global WANIP [ip cloud get public-address]
/log info $WANIP
/tool fetch mode=/tool fetch mode=http url="http://xxx.xxx.xxx.xxx:xxxx/example/string" http-method=post http-data="IPWAN=$WANIP"
/delay 20
/ip cloud set ddns-enabled=no