Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ddns-scripts: introduce use_network option #26031

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Noltari
Copy link
Member

@Noltari Noltari commented Feb 21, 2025

Maintainer: me / @feckert
Compile tested: N/A
Run tested: N/A

Description:
This new option is used to prevent issues caused when forcing the network interface used on GNU Wget and cURL when the interface is IPv6 and the DDNS provider host is IPv4-only.

An example would be trying to update an IPv6 from HE 6in4 interface to OVH, which is IPv4-only:

dns.eu.ovhapis.com      canonical name = eu.ovhapis.com.
Name:   eu.ovhapis.com
Address: 141.95.186.231
 131133       : ddns version  : 2.8.2-52
 131133       : uci configuration:
ddns.router6.dns_server='dns100.ovh.net'
ddns.router6.domain='****domain****'
ddns.router6.enabled='1'
ddns.router6.interface='henet'
ddns.router6.ip_network='henet'
ddns.router6.ip_source='network'
ddns.router6.lookup_host='****lookup_host****'
ddns.router6.password='***PW***'
ddns.router6.service_name='ovh.com'
ddns.router6.use_https='1'
ddns.router6.use_ipv6='1'
ddns.router6.use_syslog='2'
ddns.router6.username='****username****'
ddns.router6=service
 131133       : verbose mode  : 0 - run normal, NO console output
 131133       : check interval: 600 seconds
 131133       : force interval: 259200 seconds
 131133       : retry interval: 60 seconds
 131133       : retry max count : 0 times
 131133       : No old process
 131133       : last update: never
 131133       : Detect registered/public IP
 131133       : #> /usr/bin/drill -V0 -u ****domain**** @dns100.ovh.net AAAA >/var/run/ddns/router6.dat 2>/var/run/ddns/router6.err
 131133       : Registered IP '2600:XXXX:XXXX::XXXX' detected
 131133  info : Starting main loop at 2025-02-21 13:11
 131133       : Detect current IP on 'network'
 131133       : Current IP '2001:XXXX:XXXX:XXXX::XXXX' detected on network 'henet'
 131133       : Update needed - L: '2001:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX' <> R: '2600:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX'
 131133       : Force communication via IP '2001:XXXX:XXXX:XXXX::XXXX'
 131133       : #> /usr/bin/wget --hsts-file=/tmp/.wget-hsts -nv -t 1 -O /var/run/ddns/router6.dat -o /var/run/ddns/router6.err --bind-address=2001:XXXX:XXXX:XXXX::XXXX --no-proxy 'https://***USERNAME***:***PW***@dns.eu.ovhapis.com/nic/update?system=dyndns&hostname=***HOSTNAME***&myip=2001:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX'
 131133 ERROR : GNU Wget Error: '4'
 131133       : failed: Address family not supported by protocol.
 131133  WARN : Transfer failed - retry 1/0 in 60 seconds```

@Noltari Noltari requested a review from feckert February 21, 2025 12:55
This new option is used to prevent issues caused when forcing the network
interface used on GNU Wget and cURL when the interface is IPv6 and the DDNS
provider host is IPv4-only.

An example would be trying to update an IPv6 from HE 6in4 interface to OVH,
which is IPv4-only:
Non-authoritative answer:
dns.eu.ovhapis.com      canonical name = eu.ovhapis.com.
Name:   eu.ovhapis.com
Address: 141.95.186.231

 131133  note : PID '21141' started at 2025-02-21 13:11
 131133       : ddns version  : 2.8.2-52
 131133       : uci configuration:
ddns.router6.dns_server='dns100.ovh.net'
ddns.router6.domain='****domain****'
ddns.router6.enabled='1'
ddns.router6.interface='henet'
ddns.router6.ip_network='henet'
ddns.router6.ip_source='network'
ddns.router6.lookup_host='****lookup_host****'
ddns.router6.password='***PW***'
ddns.router6.service_name='ovh.com'
ddns.router6.use_https='1'
ddns.router6.use_ipv6='1'
ddns.router6.use_syslog='2'
ddns.router6.username='****username****'
ddns.router6=service
 131133       : verbose mode  : 0 - run normal, NO console output
 131133       : check interval: 600 seconds
 131133       : force interval: 259200 seconds
 131133       : retry interval: 60 seconds
 131133       : retry max count : 0 times
 131133       : No old process
 131133       : last update: never
 131133       : Detect registered/public IP
 131133       : #> /usr/bin/drill -V0 -u ****domain**** @dns100.ovh.net AAAA >/var/run/ddns/router6.dat 2>/var/run/ddns/router6.err
 131133       : Registered IP '2600:XXXX:XXXX::XXXX' detected
 131133  info : Starting main loop at 2025-02-21 13:11
 131133       : Detect current IP on 'network'
 131133       : Current IP '2001:XXXX:XXXX:XXXX::XXXX' detected on network 'henet'
 131133       : Update needed - L: '2001:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX' <> R: '2600:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX'
 131133       : Force communication via IP '2001:XXXX:XXXX:XXXX::XXXX'
 131133       : #> /usr/bin/wget --hsts-file=/tmp/.wget-hsts -nv -t 1 -O /var/run/ddns/router6.dat -o /var/run/ddns/router6.err --bind-address=2001:XXXX:XXXX:XXXX::XXXX --no-proxy 'https://***USERNAME***:***PW***@dns.eu.ovhapis.com/nic/update?system=dyndns&hostname=***HOSTNAME***&myip=2001:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX'
 131133 ERROR : GNU Wget Error: '4'
 131133       : failed: Address family not supported by protocol.
 131133  WARN : Transfer failed - retry 1/0 in 60 seconds

Signed-off-by: Álvaro Fernández Rojas <[email protected]>
@Noltari Noltari force-pushed the ddns-scripts-use_network branch from ae21063 to a1f4521 Compare February 21, 2025 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant