I am an enthusiastic recent owner of a CRS328-24P-4S+, running RouterOS v6.45.6. The router is configured pretty much like out of the box, WAN on ether1 (DHCP from service provider) and LAN on bridge on the rest of the ports.
Out of all the available options to update my domain name (Google domains) with my dynamic IP, the first to consider was the script execution within the DHCP client options, triggered by the acquisition of a new lease. My understanding is that this is one of the use cases this could be used for. Great!
///
However, things didn't work out as expected:
- I can positively see that the script is triggered, but the http request does not reach the endpoint on the Google Domains API
- In my problem finding steps, I have tested with a API mock server (https://beeceptor.com/console/dnstest) to no avail
- Further step was to consume an endpoint on the local LAN which WORKED! (http://192.168.1.100:8080). I ran a simple webserver on a local machine
- Assuming that the internet connection is not "ready" in the same milisecond that the lease is acquired, I put a delay of 30s with the same result
- The internet endpoint is consumed "no problemo" if the script is run manually or from the cli. It's only in the context of the lease acquisition where this happens
- The script is triggered and runs
- An internet endpoint (via the same ether1 interface) is not consumed, only a local one (if triggered by the DHCP lease bonding)
Scripts in question are here:
Code: Select all
// Script in DHCP client configuration
:if ($"bound" = "1") do {/system script run DDNS}
//Script in System->Script->DDNS, simply triggered this way in order to observe the execution counter tally
/tool fetch url="https://dnstest.free.beeceptor.com/" mode=https
And now my request for help
- Any chance any of you manages to pass an internet http request from within this script?
- Any suggestion on how to closer debug the script and catch the reason for the failed http request?
Appreciated. Felix