Question regarding inadyn

jorhett

Occasional Visitor
I want to update my IPV4+IPV6 using cloudflare
using this template works, but (of course) it's updating WAN IPV6
I need it to update specific client IPV6 (the one using 192.168.50.3 internal IPV4 ip)
what is the way to do it?
There's nothing specific to asuswrt about inadyn. You would get better support directly from inadyn folks.

FWIW, inadyn still doesn't support dual updates so if you want to update both ipv6 and ipv4 you need to run it twice with two different configs.

For simplicity, I use this script in /jffs/scripts/ddns-start which does the API calls that cloudflare needs under the hood. You have to set the variables used above this, but this is the meat of the script:

Code:
IP=$(ip -4 addr show dev eth0 scope global |awk '/inet / { print $2 }'|cut -d/ -f1)
TYPE=A
curl -X PATCH "https://api.cloudflare.com/client/v4/zones/$ZONEID/dns_records/$IP4_RECORDID" \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  --data "{\"type\":\"$TYPE\",\"name\":\"$RECORDNAME\",\"content\":\"$IP\",\"ttl\":"$TTL",\"proxied\":false}"
echo

IP=$(ip -6 addr show dev eth0 scope global permanent |awk '/inet6 / { print $2 }'|cut -d/ -f1)
TYPE=AAAA
curl -X PATCH "https://api.cloudflare.com/client/v4/zones/$ZONEID/dns_records/$IP6_RECORDID" \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  --data "{\"type\":\"$TYPE\",\"name\":\"$RECORDNAME\",\"content\":\"$IP\",\"ttl\":"$TTL",\"proxied\":false}"
echo

if [ $? -eq 0 ]; then
  /sbin/ddns_custom_updated 1
else
  /sbin/ddns_custom_updated 0
fi
 

SomeWhereOverTheRainBow

Part of the Furniture
There's nothing specific to asuswrt about inadyn. You would get better support directly from inadyn folks.

FWIW, inadyn still doesn't support dual updates so if you want to update both ipv6 and ipv4 you need to run it twice with two different configs.

For simplicity, I use this script in /jffs/scripts/ddns-start which does the API calls that cloudflare needs under the hood. You have to set the variables used above this, but this is the meat of the script:

Code:
IP=$(ip -4 addr show dev eth0 scope global |awk '/inet / { print $2 }'|cut -d/ -f1)
TYPE=A
curl -X PATCH "https://api.cloudflare.com/client/v4/zones/$ZONEID/dns_records/$IP4_RECORDID" \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  --data "{\"type\":\"$TYPE\",\"name\":\"$RECORDNAME\",\"content\":\"$IP\",\"ttl\":"$TTL",\"proxied\":false}"
echo

IP=$(ip -6 addr show dev eth0 scope global permanent |awk '/inet6 / { print $2 }'|cut -d/ -f1)
TYPE=AAAA
curl -X PATCH "https://api.cloudflare.com/client/v4/zones/$ZONEID/dns_records/$IP6_RECORDID" \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  --data "{\"type\":\"$TYPE\",\"name\":\"$RECORDNAME\",\"content\":\"$IP\",\"ttl\":"$TTL",\"proxied\":false}"
echo

if [ $? -eq 0 ]; then
  /sbin/ddns_custom_updated 1
else
  /sbin/ddns_custom_updated 0
fi
Thats bastically something I was going to look into. With my dynv6, I have mine setup to do ipv6 and ipv4 separately.
 

SomeWhereOverTheRainBow

Part of the Furniture
I override the inadyn.conf with my own in /jffs/inadyn.conf
1653189516892.png


1653189431347.png


1653189595464.png


Obviously you would have to adapt this to your cloudflare setup, but it is doable if they have an update API similar to this. Adjust your setup accordingly
 
Last edited:

omrij

New Around Here
Thanks!
What part of the script is "calling" the specific client ipv6?
Does it matter that the client is macvlan client?
 

BreakingDad

Very Senior Member
Mind Blown
 

Similar threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top