Testing OpenWRT 21.02rc3 on one of my TP-link Archer C6v2 routers. Cloudflare rejects the DDNS update requests. Any pointers?
{"success":false,"errors":[{"code":6003,"message":"Invalid request headers","error_chain":[{"code":6102,"message":"Invalid format for X-Auth-Email header"},{"code":6103,"message":"Invalid format for X-Auth-Key header"}]}],"messages":[],"result":null}
Detect local IP on 'interface'
#> ip -o addr show dev eth0.2 scope global >/var/run/ddns/myddns_ipv4.dat 2>/var/run/ddns/myddns_ipv4.err
Local IP '87.NNN.NNN.206' detected on interface 'eth0.2'
Update needed - L: '87.NNN.NNN.206' <> R: '192.168.1.1'
parsing script '/usr/lib/ddns/update_cloudflare_com_v4.sh'
Found Username 'Bearer' using Password as Bearer Authorization Token
#> /usr/bin/curl -RsS -o /var/run/ddns/myddns_ipv4.dat --stderr /var/run/ddns/myddns_ipv4.err --capath /etc/ssl/certs --noproxy '*' --header 'Authorization: Bearer ***PW***' --header 'Content-Type: application/json' --request GET 'https://api.cloudflare.com/client/v4/zones?name=boom.DOMAIN.TLD'
WARN : Could not detect 'zone id' for domain.tld: 'boom.DOMAIN.TLD'
ERROR : No update send to DDNS Provider
try boom@domain.tld in the Domain field.
and boom.domain.tld in the Lookup Hostname field.
There is no need to edit anything, it just works out of the box now.
You have to use Bearer as username, this tells the script to use custom token authentication.
Changed the "Domain" from "boom.DOMAIN.TLD" to "boom@DOMAIN.TLD".
Success.
Detect registered/public IP
#> /usr/bin/nslookup boom.DOMAIN.TLD >/var/run/ddns/myddns_ipv4.dat 2>/var/run/ddns/myddns_ipv4.err
Registered IP '192.168.1.1' detected
info : Starting main loop at YYYY-MM-DD HH:MM
Detect local IP on 'interface'
#> ip -o addr show dev eth0.2 scope global >/var/run/ddns/myddns_ipv4.dat 2>/var/run/ddns/myddns_ipv4.err
Local IP '87.NNN.NNN.206' detected on interface 'eth0.2'
Update needed - L: '87.NNN.NNN.206' <> R: '192.168.1.1'
parsing script '/usr/lib/ddns/update_cloudflare_com_v4.sh'
Found Username 'Bearer' using Password as Bearer Authorization Token
#> /usr/bin/curl -RsS -o /var/run/ddns/myddns_ipv4.dat --stderr /var/run/ddns/myddns_ipv4.err --capath /etc/ssl/certs --noproxy '*' --header 'Authorization: Bearer ***PW***' --header 'Content-Type: application/json' --request GET 'https://api.cloudflare.com/client/v4/zones?name=DOMAIN.TLD'
#> /usr/bin/curl -RsS -o /var/run/ddns/myddns_ipv4.dat --stderr /var/run/ddns/myddns_ipv4.err --capath /etc/ssl/certs --noproxy '*' --header 'Authorization: Bearer ***PW***' --header 'Content-Type: application/json' --request GET 'https://api.cloudflare.com/client/v4/zones/nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn/dns_records?name=boom.DOMAIN.TLD&type=A'
IPv4 at CloudFlare.com already up to date
info : Update successful - IP '87.NNN.NNN.206' send
info : Forced update successful - IP: '87.NNN.NNN.206' send
Clicking the link "Pause Cloudflare on Site" opens up a window with the text:
Pause Website
Are you sure you want to pause DOMAIN.TLD?
Pausing Cloudflare stops traffic from passing through our network, making your origin server IP address visible. Also, Cloudflare’s security and protection features become disabled. As an alternative, consider Development Mode to bypass caching while preserving security and protection.
Well...
Maybe there is some script around to query the registered IP via the cloudflare API....I don't know...
But you can also create a new subdomain, checkip.domain.tld as CNAME for boom.domain.tld and only disable the proxy for checkip.domain.tld.
And use checkip.domain.tld as look up domain in the OpenWRT's dyndns config...
The protection seems to be activated for the entire domain. There is that possibility to pause the Cloudflare protection and if I do that then the correct IP is shown on the DDNS page.
The router LOGIN is set to be available only from the Local network interface. When I have the VPN ready that will allow changing the router settings through the virtual private network encrypted channel.
So I guess I can leave the LOGIN unprotected by Cloudflare.