Hello Forum!
I would like to have the IPs updated automatically with my MikroTik router.
Does anyone here already have a script to make this happen?
According to the API I have to call the following page: https://update.dedyn.io/update?username=MYDOMAIN.dedyn.io&password=PASSWORD&myipv4=1.2.3.4&myipv6=fd08::1234
But here I have to replace the IPv4 and IPv6 with the current address of the interface.
I have a PPPoE connection, through which I get an IPv4 and a prefix (/56) of which I get an IPv6 address.
Currently I still have no plan how to determine the IPs directly on the router for the query
In the end, I need to be able to call it something like this: /tool fetch url="https://update.dedyn.io/update?username=MYDOMAIN.dedyn.io&password=PASSWORD&myipv4=$MyIpV4&myipv6=$MyIpV6" mode=https
Either way, for IPv6 the result may not be very useful unless you want to access the router itself. As you stated your provider allocates a /56 subnet to your router. Presumably your LAN clients will use SLAAC to allocate their public IPv6 addresses from this subnet. In a normal setup each client has their own public IPv6 address(es). (NATv6 is very uncommon and unnecessary in most cases.)
Thus the IPv6 address of your router will not help when trying to access a service on a client behind the router. There are more issues when trying to run a public service on a dynamic IPv6 address. Suffice to say: it can be done, but…
BTW: Many providers will actually issue a /64 prefix to the router in addition to a /56 prefix for clients behind the router. Your case may be different though.
Yes that with SLAAC is known.
In fact, I want to first transmit the IPv6 of the router so that I can establish a VPN tunnel via domain.
For internal services I then use ULA addresses and an internal DNS server.
I managed to craft an ugly script.
Unfortunately it just puts data on memory, which will be deleted at the end, I would have preferred something completely in RAM.
But at least it works …
I found a script that does just that, but for DuckDNS. I’ve adapted it for deSEC, you can find it here:
Note: click the ‘master’ button and change it to deSEC for the correct instructions.
Note 2: My public IP hasn’t changed yet since I wrote the script and I can’t force a change, so I’m not 100% sure that it actually works. If you encounter problems, feel free to open an issue on the repository and I’ll look into it when I have the time.