ddns icon indicating copy to clipboard operation
ddns copied to clipboard

docs update - how to update IP on openwrt

Open schtritoff opened this issue 3 years ago • 1 comments

Hi! Thanks for this great project (and service). This issue is actually only for documentation purposes. Maybe there could be a place (in readme or wiki) for additional ddns client configuration docs.

I'm using OpenWRT for my router and wanted to update WAN IP on pboehm/ddns service as soon as possible and to avoid running cron job every X minutes to check if IP changed.

After some research I've found in OpenWRT forums those two relevant topics:

  • https://forum.openwrt.org/t/ddns-scripts-why-are-they-so-huge/56376
  • https://forum.openwrt.org/t/udhcpc-user-script-documentation-and-how-to-hotplug-for-dhcp-events/47952

Basically what you have to do is:

  1. Make sure you have wget with SSL support opkg install wget ca-certificates
  2. Create a file /etc/udhcpc.user with following contents
#!/bin/sh
if [ "wan" = $INTERFACE ]; then
	logger "$INTERFACE - $interface - $J_T5_source"
	/usr/bin/wget -q -O - 'https://ddns.pboehm.de/update/[HOST]/[TOKEN]?myip='${ip}''
fi
exit 0
  1. Make it executable chmod +x /etc/udhcpc.user

That's it!

schtritoff avatar Apr 06 '21 20:04 schtritoff

I didn't find the myip-param in docs or the source. Is there such a parameter with ddns? I looked for this to have placeholders for IPv4 + IPv6 - in case the FritzBox wants to set both IPs (no matter that the ddns-hostname resolves to and which IP is automatically returned from the request).

neufeind avatar Feb 27 '24 11:02 neufeind