Hi all,
I have a full working script working perfectly in my Wired fiber router, but it’s NOT in my new hAP ax lite LTE6.
Well, it works but it doesn’t update the public IP. It updates like internal ip.
- In my wired router CRS125-24G-1S-2HND-IN ( v6.49.7 ) the Interface for the internet it’s called “pppoe-out1” and it’s showing public IP, like 79.150.123.123.
- In my LTE router hAP ax lite LTE6 ( v7.8 ) the interface it’s called “lte1” but it not showing the public ip, it’s showing like network internal (10.23.1.1), which is is the one that uses and publishes in DYNU.
Can you please help me to modify the script to get the right public IP?
Thank you all in advance
:global ddnsuser "USER"
:global ddnspass "PASSWORD"
:global theinterface "lte1"
:global ddnshost "DOMAIN.webredirect.org"
:global ipddns [:resolve $ddnshost];
:global ipfresh [ /ip address get [/ip address find interface=$theinterface ] address ]
:if ([ :typeof $ipfresh ] = nil ) do={
:log info ("dynu: No ip address on $theinterface .")
} else={
:for i from=( [:len $ipfresh] - 1) to=0 do={
:if ( [:pick $ipfresh $i] = "/") do={
:set ipfresh [:pick $ipfresh 0 $i];
}
}
:if ($ipddns != $ipfresh) do={
:log info ("dynu: IP-dynu = $ipddns")
:log info ("dynu: IP-Fresh = $ipfresh")
:log info "dynu: Update IP needed, Sending UPDATE...!"
:global str "/nic/update?hostname=$ddnshost&myip=$ipfresh"
/tool fetch address=api.dynu.com src-path=$str mode=http user=$ddnsuser password=$ddnspass dst-path=("/Dynu.".$ddnshost)
:delay 1
:global str [/file find name="Dynu.$ddnshost"];
/file remove $str
:global ipddns $ipfresh
:log info "dynu: IP updated to $ipfresh!"
} else={
:log info "dynu: dont need changes";
}
}