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

dynu: ddclient not setting ip to ip it says #688

Open
BPplays opened this issue Jun 7, 2024 · 5 comments
Open

dynu: ddclient not setting ip to ip it says #688

BPplays opened this issue Jun 7, 2024 · 5 comments
Labels
bug Something isn't working needinfo More information is needed from the user

Comments

@BPplays
Copy link

BPplays commented Jun 7, 2024

with dynu ddclient is setting the ip to my servers temp gua instead of it's static gua even tho it's getting the static gua according to the logs

=== opt ====
opt{cache}                           : <undefined>
opt{cmd}                             : <undefined>
opt{cmd-skip}                        : <undefined>
opt{cmdv4}                           : <undefined>
opt{cmdv6}                           : <undefined>
opt{curl}                            : <undefined>
opt{daemon}                          : 0
opt{debug}                           : 1
opt{exec}                            : <undefined>
opt{facility}                        : <undefined>
opt{file}                            : <undefined>
opt{force}                           : <undefined>
opt{foreground}                      : <undefined>
opt{fw}                              : <undefined>
opt{fw-banlocal}                     : CODE(0x5565d921c098)
opt{fw-login}                        : <undefined>
opt{fw-password}                     : <undefined>
opt{fw-skip}                         : <undefined>
opt{fw-ssl-validate}                 : <undefined>
opt{fwv4}                            : <undefined>
opt{fwv4-skip}                       : <undefined>
opt{fwv6}                            : <undefined>
opt{fwv6-skip}                       : <undefined>
opt{geturl}                          : <undefined>
opt{help}                            : <undefined>
opt{host}                            : <undefined>
opt{if}                              : <undefined>
opt{if-skip}                         : CODE(0x5565d921c098)
opt{ifv4}                            : <undefined>
opt{ifv6}                            : <undefined>
opt{ip}                              : <undefined>
opt{ipv4}                            : <undefined>
opt{ipv6}                            : <undefined>
opt{list-devices}                    : CODE(0x5565d93df660)
opt{list-protocols}                  : CODE(0x5565d9401060)
opt{list-web-services}               : CODE(0x5565d94245a0)
opt{login}                           : <redacted>
opt{mail}                            : <undefined>
opt{mail-failure}                    : <undefined>
opt{max-interval}                    : 2592000
opt{max-warn}                        : <undefined>
opt{min-error-interval}              : 300
opt{min-interval}                    : 30
opt{options}                         : <undefined>
opt{password}                        : <redacted>
opt{pid}                             : <undefined>
opt{postscript}                      : <undefined>
opt{priority}                        : <undefined>
opt{protocol}                        : <undefined>
opt{proxy}                           : <undefined>
opt{query}                           : <undefined>
opt{quiet}                           : 0
opt{retry}                           : <undefined>
opt{server}                          : <undefined>
opt{ssl}                             : <undefined>
opt{ssl_ca_dir}                      : <undefined>
opt{ssl_ca_file}                     : <undefined>
opt{syslog}                          : <undefined>
opt{test}                            : <undefined>
opt{timeout}                         : <undefined>
opt{use}                             : <undefined>
opt{usev4}                           : <undefined>
opt{usev6}                           : <undefined>
opt{verbose}                         : 1
opt{web}                             : <undefined>
opt{web-skip}                        : <undefined>
opt{web-ssl-validate}                : <undefined>
opt{webv4}                           : <undefined>
opt{webv4-skip}                      : <undefined>
opt{webv6}                           : <undefined>
opt{webv6-skip}                      : <undefined>
=== globals ====
globals{daemon}                      : 60
globals{debug}                       : 1
globals{ifv6}                        : ens33
globals{quiet}                       : 0
globals{ssl}                         : 1
globals{syslog}                      : 1
globals{usev6}                       : ifv6
globals{verbose}                     : 1
=== config ====
config{example.org}{atime} : 0
config{example.org}{backupmx} : 0
config{example.org}{cacheable} : ARRAY(0x5565d95a5c18)
config{example.org}{cmd} : <undefined>
config{example.org}{cmd-skip} :
config{example.org}{custom} : 0
config{example.org}{fw} :
config{example.org}{fw-login} : <undefined>
config{example.org}{fw-password} :
config{example.org}{fw-skip} :
config{example.org}{fw-ssl-validate} : 1
config{example.org}{host} : example.org
config{example.org}{if} : ppp0
config{example.org}{ip} : <undefined>
config{example.org}{ipv4} : <undefined>
config{example.org}{ipv6} : <undefined>
config{example.org}{login} : <redacted>
config{example.org}{max-interval} : 2592000
config{example.org}{min-error-interval} : 300
config{example.org}{min-interval} : 30
config{example.org}{mtime} : 0
config{example.org}{mx} :
config{example.org}{password} : <redacted>
config{example.org}{protocol} : dyndns2
config{example.org}{script} : /nic/update
config{example.org}{server} : api.dynu.com
config{example.org}{static} : 0
config{example.org}{status} :
config{example.org}{status-ipv4} :
config{example.org}{status-ipv6} :
config{example.org}{use} : ip
config{example.org}{warned-min-error-interval} : 0
config{example.org}{warned-min-interval} : 0
config{example.org}{web} : dyndns
config{example.org}{web-skip} :
config{example.org}{web-ssl-validate} : 1
config{example.org}{wildcard} : 0
config{example.org}{wtime} : 30
=== cache ====
WARNING:  '' is not a valid IPv4 or IPv6 address
WARNING:  found neither IPv4 nor IPv6 address
DEBUG:    get_ip: using ip, ip reports <undefined>
WARNING:  example.org: unable to determine IP address with strategy use=ip
WARNING:  'if-skip' is deprecated and does nothing for IPv6
DEBUG:    Reply from 'ip -6 -o addr show dev ens33 scope global' :
DEBUG:    ------
DEBUG:    2: ens33    inet6 {{ temp_gua }}/64 scope global temporary dynamic \       valid_lft 86154sec preferred_lft 14154sec
DEBUG:    2: ens33    inet6 {{ static_gua }}/64 scope global dynamic mngtmpaddr noprefixroute \       valid_lft 86154sec preferred_lft 14154sec
DEBUG:    2: ens33    inet6 {{ temp_ula }}/64 scope global temporary dynamic \       valid_lft 86154sec preferred_lft 14154sec
DEBUG:    2: ens33    inet6 {{ static_ula }}/64 scope global dynamic mngtmpaddr noprefixroute \       valid_lft 86154sec preferred_lft 14154sec
DEBUG:    ------
DEBUG:    Raw IPv6 after filtering for GUA addresses ens33: (1)
DEBUG:    2: ens33    inet6 {{ static_gua }}/64 scope global dynamic mngtmpaddr noprefixroute \       valid_lft 86154sec preferred_lft 14154sec
DEBUG:    get_ipv6: using (ifv6, ens33) reports {{ static_gua }}
INFO:     forcing updating example.org because no cached entry exists.
DEBUG:
DEBUG:    nic_dyndns2_update -------------------
Use of uninitialized value $_[0] in sprintf at /usr/bin/ddclient line 2160.
INFO:     setting IP address to  for example.org
UPDATE:   updating example.org
DEBUG:    proxy    = <undefined>
DEBUG:    protocol = https
DEBUG:    server   = api.dynu.com
DEBUG:    url      = nic/update?<redacted>
DEBUG:    ip ver   =
CONNECT:  api.dynu.com
CONNECTED:  using SSL
SENDING:  GET /nic/update?system=dyndns&hostname=example.org&myip= HTTP/1.1
SENDING:  Host: api.dynu.com
SENDING:  Authorization: Basic {{ i guess i'll censor this? }}
SENDING:  User-Agent: ddclient/3.10.0
SENDING:  Connection: close
SENDING:
RECEIVE:  HTTP/1.1 200 OK
RECEIVE:  Date: Fri, 07 Jun 2024 22:5:1 GMT
RECEIVE:  Server: Dynu Web Server
RECEIVE:  X-Powered-By: Dynu Dynamic DNS Service
RECEIVE:  Content-Length: 44
RECEIVE:  Content-Type: text/html; charset=UTF-8
RECEIVE:
RECEIVE:  good {{ temp_gua }}
SUCCESS:  updating example.org: good: IP address set to {{ temp_gua }}
> s cat /etc/ddclient.conf
syslog=yes
ssl=yes


daemon=5m
usev6=ifv6
ifv6=ens33

protocol=dyndns2, \
server=api.dynu.com, \
login={{ login }}, \
password={{ pass }} \
{{ example.org }}
@rhansen
Copy link
Member

rhansen commented Jun 25, 2024

@BPplays Have you tried the latest master revision? There have been some recent fixes to dyndns2.

@rhansen rhansen added needinfo More information is needed from the user bug Something isn't working labels Jun 25, 2024
@BPplays
Copy link
Author

BPplays commented Jun 27, 2024

@rhansen it seems to be fixed in master aka 5757f7e

@BPplays BPplays closed this as completed Jun 27, 2024
@BPplays
Copy link
Author

BPplays commented Jul 17, 2024

@rhansen this issue seems to have come back again i think on the same commit but i tested on 9256096 and it seems its still broken, i checked dynu and the v4 is not set at all and v6 is set to the temp gua:

-> /usr/bin/ddclient --verbose --foreground --file /etc/ddclient.conf
SENDING:   Curl system cmd to https://api.ipify.org
SENDING:   silent
SENDING:   include
SENDING:   ipv4
SENDING:   user-agent="ddclient/4.0.0~alpha"
SENDING:   connect-timeout=120
SENDING:   max-time=120
SENDING:   request=GET
SENDING:   url="https://api.ipify.org/"
RECEIVE:   HTTP/2 200
RECEIVE: | date: Wed, 17 Jul 2024 20:17:03 GMT
RECEIVE: | content-type: text/plain
RECEIVE: | content-length: 14
RECEIVE: | vary: Origin
RECEIVE: | cf-cache-status: DYNAMIC
RECEIVE: | server: cloudflare
RECEIVE: | cf-ray: 8a4ce9cc6962aab1-SJC
RECEIVE: |
RECEIVE: | {{ ipv4 public }}
INFO:      forcing updating {{ censored }} because no recap entry exists in cache file.
INFO:      setting IPv4 address to {{ ipv4 public }} for {{ censored }}
INFO:      setting IPv6 address to {{ static gua }} for {{ censored }}
UPDATE:    updating {{ censored }}
SENDING:   Curl system cmd to https://api.dynu.com
SENDING:   silent
SENDING:   include
SENDING:   user-agent="ddclient/4.0.0~alpha"
SENDING:   connect-timeout=120
SENDING:   max-time=120
SENDING:   request=GET
SENDING:   user="{{ censored }}:{{ censored }}"
SENDING:   url="https://api.dynu.com/nic/update?system=dyndns&hostname={{ censored }}&myip={{ ipv4 public }},{{ static gua }}"
RECEIVE:   HTTP/1.1 200 OK
RECEIVE: | Date: Wed, 17 Jul 2024 20:17:4 GMT
RECEIVE: | Server: Dynu Web Server
RECEIVE: | X-Powered-By: Dynu Dynamic DNS Service
RECEIVE: | Content-Length: 44
RECEIVE: | Content-Type: text/html; charset=UTF-8
RECEIVE: |
RECEIVE: | good {{ temp gua }}
SUCCESS:   updating {{ censored }}: good: IPv4 address set to {{ ipv4 public }}
SUCCESS:   updating {{ censored }}: good: IPv6 address set to {{ static gua }}

config and script:

-> cat /etc/ddclient.conf
syslog=yes                  # log update msgs to syslog
ssl=yes

usev4=webv4
webv4=ipify-ipv4
usev6=cmdv6
cmdv6=/usr/local/bin/get_ipv6.sh

protocol=dyndns2, \
server=api.dynu.com, \
login={{censored}}, \
password={{censored}} \
{{censored}}

-> /usr/local/bin/get_ipv6.sh
{{ static gua }}

@BPplays BPplays reopened this Jul 17, 2024
@rhansen
Copy link
Member

rhansen commented Jul 18, 2024

SENDING:   url="https://api.dynu.com/nic/update?system=dyndns&hostname={{ censored }}&myip={{ ipv4 public }},{{ static gua }}"

Looks like ddclient is sending the right IP address to dynu, so the problem is either (1) a bug at dynu, or (2) ddclient is not sending the IP addresses in the format expected by dynu.

It's unclear to me which case this is. Reading dynu's documentation, it looks like dyndns2 is not the correct protocol. dyndns2 does myip={{ipv4}},{{ipv6}} but dynu expects myip={{ipv4}}&myipv6={{ipv6}}. However, dynu's own ddclient documentation says to use dyndns2.

Looks like we'll have to add a new dynu protocol, unless dynu modifies their service to support both IPv4 and IPv6 addresses in the myip parameter.

@BPplays
Copy link
Author

BPplays commented Jul 18, 2024

@rhansen i tried with just a curl command and myip={{ipv4}}&myipv6={{ipv6}} seems to work but myip={{ipv4}},{{ipv6}} doesn't.
maybe dynu doesn't well support v6 and assumes you aren't ​using it, based on what you said i assume dynu's ddclient config works with v4 only configurations,
also if i curl to set just the v4 address it seems to set the v6 to whatever sent the request to change it which may be problematic for configs that try to set just the v4 address


myip={{ipv4}},{{ipv6}}:

-> curl -s \
             -i \
             -A "ddclient/4.0.0~alpha" \
             --connect-timeout 120 \
             --max-time 120 \
             -u "{{ censored }}:{{ censored }}" \
             "https://api.dynu.com/nic/update?system=dyndns&hostname={{ censored }}&myip={{public ipv4 }},{{ static gua }}"

HTTP/1.1 200 OK
Date: Thu, 18 Jul 2024 2:14:28 GMT
Server: Dynu Web Server
X-Powered-By: Dynu Dynamic DNS Service
Content-Length: 44
Content-Type: text/html; charset=UTF-8

good {{ temp gua }}

i checked dynu and it's just the temp gua and no v4, i'd guess if the request it gets is invalid it defaults to whatever ip sent the request
​​


myip={{ipv4}}&myipv6={{ipv6}}:

-> curl -s \
             -i \
             -A "ddclient/4.0.0~alpha" \
             --connect-timeout 120 \
             --max-time 120 \
             -u "{{ censored }}:{{ censored }}" \
             "https://api.dynu.com/nic/update?system=dyndns&hostname={{ censored }}&myip={{public ipv4 }}&myipv6={{ static gua }}"

HTTP/1.1 200 OK
Date: Thu, 18 Jul 2024 2:14:39 GMT
Server: Dynu Web Server
X-Powered-By: Dynu Dynamic DNS Service
Content-Length: 19
Content-Type: text/html; charset=UTF-8

good {{public ipv4 }}

i checked and it set both the v6 and v4 correctly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needinfo More information is needed from the user
Projects
None yet
Development

No branches or pull requests

2 participants