Cloudflare DDNS IPv6 update

Hey,

I'm attempting to use DDNS to keep an IPv6 DNS record updated on Cloudflare.

I'm doing this by using the ddns-script package + ddns-scripts_cloudflare.com-v4.

IPv4 is working perfectly, but not IPv6. The script fails with:

 Can not detect local IP using network_get_ipaddr6 'wan6' - Error: '1' - TERMINATE

This is indicating very clearly that the script is not able to get the IP address from my wan6 interface, but it is very clear that the interface itself has an IPv6 address assigned.

Screenshot 2021-01-30 at 21.55.01

Debugging I found that ultimately, this fails because the following command returns an empty result:

jsonfilter -s '{
	"interface": [
.
.
.
        },
		{
			"interface": "wan6",
			"up": true,
			"pending": false,
			"available": true,
			"autostart": true,
			"dynamic": false,
			"uptime": 4001,
			"l3_device": "eth0.2",
			"proto": "dhcpv6",
			"device": "eth0.2",
			"updated": [
				"prefixes"
			],
			"metric": 0,
			"dns_metric": 0,
			"delegation": true,
			"ipv4-address": [

			],
			"ipv6-address": [

			],
			"ipv6-prefix": [
				{
					"address": "2001:******::",
					"mask": 56,
					"preferred": 86000,
					"valid": 86000,
					"class": "wan6",
					"assigned": {
						"lan": {
							"address": "2001:******::",
							"mask": 60
						}
					}
				}
			],
			"ipv6-prefix-assignment": [

			],
			"route": [
				{
					"target": "::",
					"mask": 0,
					"nexthop": "fe80::7e20:64ff:fe85:c365",
					"metric": 512,
					"valid": 3617,
					"source": "2001:*********::/56"
				}
			],
			"dns-server": [
				"::1"
			],
			"dns-search": [

			],
			"neighbors": [

			],
			"inactive": {
				"ipv4-address": [

				],
				"ipv6-address": [

				],
				"route": [

				],
				"dns-server": [
					"***",
					"***"
				],
				"dns-search": [

				],
				"neighbors": [

				]
			},
			"data": {
				"passthru": "..."
			}
		}
	]
}}' -e '__DATA=@.interface[@.interface='"'"'wan6'"'"']['"'"'ipv6-prefix-assignment'"'"'][0]['"'"'local-address'"'"'].address'

It's clear that this is failing because the pv6-prefix-assignment key is empty, but the interface does have information about the assigned address under ipv6-prefix.

My googling came up empty. Is this a known bug/change? Is anyone experiencing the same?

Meanwhile I'm working around this issue by using dyndsns as the IP source, but I'd rather not have to depend on an external service to grab my IP.

1 Like

Pull the IP from LAN instead.
Lan will have the actual address in use,wan6 is just telling you what ranges were delegated

4 Likes

Lol it just had to be something easy :man_facepalming:

Resooooolved, thanks!

This topic was automatically closed 0 minutes after the last reply. New replies are no longer allowed.