[INFO] opendd, ein DynDNS-Client

...
Wie ist es eigentlich bei openDD mit dem check, ob die IP immer noch aktuell ist, also was sind das für Zeitintervalle?
...

OpenDD aus dem Trunk und der (Pre-)Stable 1.2 werden durch ein Script aus dem AVM-Teil heraus aufgerufen (onlinechanged). Und selbst wenn sich die IP nicht geändert hat: opendd prüft zuvor, ob aktualisiert werden muss.
 
Komischerweise habe ich heute keine IP per Mail erhalten. Hab daraufhin überprüft, ob DynDNS evtl doch aktualisiert wurde mit der jeweils aktuellen IP, was aber nicht der Fall war. Woran kann das liegen? Hat es was mit onlinechanged zu tun oder was ist da schief gelaufen?

Gibt es denn irgendwie eine Möglichkeit, sich sozusagen. als Absicherung, nur die IP per Mail zusenden zu lassen, sobald die 24 Stunden Zwangstrennung erfolgt ist? Gibt es da irgend ein Script und wenn ja wie binde ich das ein, bin was Linux angeht ein absoluter Neuling, bräuchte da also etwas Hilfe beim implementieren.
 
Zuletzt bearbeitet:
Du könntest Dir via crond eine Mail schicken lassen, täglich zur vollen Stunde nach der geplanten Zwangstrennung. Frag mich aber jetzt nicht, was Du bei crond eintragen musst. Ich habe dazu allerdings hier im Forum schon Lösungen gesehen.
 
Ich hab mal den Log kopiert.

Dec 7 04:26:31 fritz user.notice ONLINECHANGED[3903]: [offline] approved
Dec 7 04:26:32 fritz user.notice ONLINECHANGED[3903]: [offline] executing /etc/onlinechanged/00-get_ip
Dec 7 04:26:32 fritz user.notice ONLINECHANGED[3903]: [offline] executing /etc/onlinechanged/20-opendd
Dec 7 04:26:32 fritz user.notice ONLINECHANGED[3903]: [offline] finished
Dec 7 04:26:33 fritz user.notice ONLINECHANGED[3914]: [online] approved
Dec 7 04:26:33 fritz user.notice ONLINECHANGED[3914]: [online] executing /etc/onlinechanged/00-get_ip
Dec 7 04:26:33 fritz user.notice ONLINECHANGED[3914]: [online] executing /etc/onlinechanged/20-opendd
Dec 7 04:26:34 fritz daemon.info opendd[3943]: -- running OpenDD 0.7.9 in normal mode
Dec 7 04:26:34 fritz daemon.info opendd[3943]: main() : getting my ip address : xx.xxx.xxx.xx
Dec 7 04:26:36 fritz daemon.info opendd[3943]: dyndns() : connected to members.dyndns.org:80
Dec 7 04:26:36 fritz daemon.info opendd[3943]: dyndns() : GET /nic/update?system=dyndns&hostname=blabla.blubb.org&wildcard=OFF&backmx=NO&offline=NO&myip=xx.xxx.xxx.xx HTTP/1.0
Dec 7 04:26:36 fritz daemon.info opendd[3943]: dyndns() : connection closed
Dec 7 04:26:36 fritz daemon.info opendd[3943]: main() : dyndns() exit normally
Dec 7 04:26:37 fritz user.notice ONLINECHANGED[3914]: [online] * Running OpenDD ... done.
Dec 7 04:26:37 fritz user.notice ONLINECHANGED[3914]: [online] finished

Was ist da falsch gelaufen?
Nach dem GET müsste doch folgendes kommen:

Dec 5 04:29:10 fritz daemon.info opendd[3835]: listen_response() : HTTP/1.1 200 OK
Dec 5 04:29:10 fritz daemon.info opendd[3835]: listen_response() : Date: Mon, 05 Dec 2011 03:29:11 GMT
Dec 5 04:29:10 fritz daemon.info opendd[3835]: listen_response() : Server: Apache
Dec 5 04:29:10 fritz daemon.info opendd[3835]: listen_response() : X-User-Status: free
Dec 5 04:29:10 fritz daemon.info opendd[3835]: listen_response() : Content-Type: text/plain
Dec 5 04:29:10 fritz daemon.info opendd[3835]: listen_response() : Accept-Ranges: none
Dec 5 04:29:10 fritz daemon.info opendd[3835]: listen_response() : Connection: close
Dec 5 04:29:10 fritz daemon.info opendd[3835]: listen_response() : good xx.xxx.xxx.xx
Dec 5 04:29:10 fritz daemon.info opendd[3835]: listen_response() : The update was successful, and the hostname is now updated.
Dec 5 04:29:12 fritz daemon.info opendd[3835]: listen_response() : mail report sent !
 
Zuletzt bearbeitet:
Die Einträge im Syslog "listen_response ..." wurden auch bei mir schon mal verschluckt, die Aktualisierung hatte aber trotzdem statt gefunden, weswegen ich dem keine Beachtung geschenkt hatte. Eventuell ist das Verschlucken bei Dir halt zufällig mit einer fehlgeschlagenen Aktualisierung zusammen gefallen? :gruebel:
 
Hm könnte natürlich sein. Ich werde es die nächsten Tage mal beobachten.
 
Fehler: dyndns() : Can't read external IP file!

Hallo!

Ich habe das Paket OpenDD für mein Image freetz-devel-8158M auf FB7390 ausgewählt.
Während dem Kompilieren traten keine Fehler auf, und auch die GUI zeigt OpenDD fehlerfrei an.
Die Konfiguration über das GUI klappt auch.

Nur die Synchronisation mit meinem DynDNS-Account klappt nicht.
Wenn ich OpenDD via Terminal ausführe, erhalte ich diesen Fehler:
Code:
root@192:/var/mod/root# opendd -c /var/mod/etc/opendd.conf -v
-- running OpenDD 0.7.9 in normal mode
dyndns() : Can't read external IP file!
main() : cannot get IP address for update

In der Konfigurations-Datei steht:
Code:
root@192:/var/mod/root# cat /var/mod/etc/opendd.conf 
##do not change
cert_path = /tmp/flash/opendd/opendd.pem
runasdaemon = 0
pidfile_path = /var/run/opendd.pid
use_syslog = 1

##accounts
servername = members.dyndns.org
hostname = <my_dyndns_hostname>
username = <username>
password = <password>

##advanced
wildcard = 0
backupmx = 0
offline = 0

##depends on make!
use_ssl = 0

Der AVM Dynamic DNS Dienst funktioniert ohne Probleme.

THX
 
@c.monty,
habe das gleich Problem, hat es den schon mal jemand mit der Stable versucht ob es da funktioniert ?
 
Nur die Synchronisation mit meinem DynDNS-Account klappt nicht.
Wenn ich OpenDD via Terminal ausführe, erhalte ich diesen Fehler:
Code:
root@192:/var/mod/root# opendd -c /var/mod/etc/opendd.conf -v
-- running OpenDD 0.7.9 in normal mode
[COLOR=red]dyndns() :[/COLOR] [COLOR=red]Can't read external IP file![/COLOR]
main() : cannot get IP address for update
Die Fehlermeldung stammt aus diesem Patch:
...
+
+ /* Get my IP from an /tmp/.opendd.ip */
+ file = fopen("/tmp/.opendd.ip", "r");
+ if (NULL == file) {
+ logmsg(LOG_ERR, "dyndns() : Can't read external IP file!");
+ return 0;
+ }
...
Wie ist die Ausgabe von:
Code:
sh -x /etc/init.d/rc.opendd run
?
 
Hallo sf3978,
da ich die gleiche Log-Ausgabe habe, kannst du mal über meine gucken, Danke

Code:
root@fritz:/var/mod/root# sh -x /etc/init.d/rc.opendd run
+ DAEMON=opendd
+ DAEMON_LONG_NAME=OpenDD
+ . /etc/init.d/modlibrc
+ export PATH=/mod/sbin:/mod/bin:/mod/usr/sbin:/mod/usr/bin:/sbin:/bin:/usr/sbin
:/usr/bin
+ export LD_LIBRARY_PATH=/mod/lib:/mod/usr/lib
+ : OpenDD
+ : opendd
+ : opendd_ENABLED
+ : /mod/etc/opendd.conf
+ : opendd
+ : /var/run/opendd.pid
+ [ -n opendd ]
+ modlib_loadconfig
+ local CONF_FILE=/mod/etc/conf/opendd.cfg
+ [ ! -r /mod/etc/conf/opendd.cfg ]
+ . /mod/etc/conf/opendd.cfg
+ export OPENDD_BACKUPMX=0
+ export OPENDD_EMAIL_ENABLED=no
+ export OPENDD_EMAIL_FROM=
+ export OPENDD_EMAIL_PASS=
+ export OPENDD_EMAIL_PORT=25
+ export OPENDD_EMAIL_SERVER=
+ export OPENDD_EMAIL_TO=
+ export OPENDD_EMAIL_USER=
+ export OPENDD_ENABLED=yes
+ export OPENDD_FORCE_UPDATE=yes
+ export OPENDD_HOST=stimmt.dyndns.com
+ export OPENDD_MX=
+ export OPENDD_OFFLINE=0
+ export OPENDD_PASS=stimmt
+ export OPENDD_SERVER=members.dyndns.org
+ export OPENDD_USER=stimmt
+ export OPENDD_USE_SSL=0
+ export OPENDD_WILDCARD=0
+ run
+ echo -n Running OpenDD ...
Running OpenDD ... + modlib_check_running
+ [ -n  ]
+ [ -x /etc/init.d/rc.inetd ]
+ echo opendd_ENABLED
+ tr [:lower:]- [:upper:]_
+ eval echo $OPENDD_ENABLED
+ echo yes
+ [ yes == inetd ]
+ [ -n  ]
+ local fn=/var/run/opendd.pid
+ [ ! -s /var/run/opendd.pid ]
+ return 3
+ [ yes != yes ]
+ which opendd
+ [ ! -x /usr/bin/opendd ]
+ modlib_config
+ local in_files=opendd
+ local out_file=/mod/etc/opendd.conf
+ [ -x /tmp/flash/opendd_conf ]
+ [ -x /tmp/flash/opendd/opendd_conf ]
+ /mod/etc/default.opendd/opendd_conf
+ [ -f /tmp/flash/opendd.extra ]
+ [ -f /tmp/flash/opendd/opendd.extra ]
+ chmod 600 /mod/etc/opendd.conf
+ get_ip
+ NEW_IP=98.333.xxxx
+ [ -z 98.333.xxxx ]
+ [ yes == yes ]
+ cat /tmp/flash/opendd/opendd.ip
+ OLD_IP=98.333.xxxx
+ [ 98.333.xxxx != 98.333.xxxx ]
+ find /tmp/flash/opendd/ -name opendd.ip -mtime +25 -exec rm -rf {} ;
+ [ ! -e /tmp/flash/opendd/opendd.ip ]
+ [ ! -e /tmp/flash/opendd/opendd.ip ]
+ update_ip 98.333.xxxx
+ echo 98.333.xxxx
+ opendd -c /mod/etc/opendd.conf
+ rm -rf /tmp/.opendd.ip
+ echo done.
done.
+ exit 0
root@fritz:/var/mod/root#
 
der Log kam nach dem ich den Befehl in Telnet eingegeben habe
sh -x /etc/init.d/rc.opendd run

Code:
Dec  8 23:20:11 fritz user.info opendd[6538]: -- running OpenDD 0.7.9 in normal mode
Dec  8 23:20:11 fritz user.info opendd[6538]: main() : getting my ip address : 98.333.xxxx
Dec  8 23:20:11 fritz user.info opendd[6538]: getdyndnshostnames() : no need to update stimmt.dyndns.com with 98.333.xxxx
Dec  8 23:20:11 fritz user.err opendd[6538]: main() : No hostname(s) to update
 
... nach dem ich den Befehl in Telnet eingegeben habe
Versuch es jetzt mal mit dem Befehl in telnet, nach geänderter externer (öffentlicher) IP-Adresse der Box und ohne aktivierten dynamic-dns-Dienst (weder AVM, noch opendd oder sonst was) auf der Box. Bitte poste danach die Ausgaben von "sh -x /etc/init.d/rc.opendd run" bzw. aus dem syslog.
 
Ich habe da auch ein neues Problem:
Bin seit heute Kunde von Unitymedia, und habe somit meine bisher am DSL laufende 7390 nun als IP-Client hinter einer 6360_Cable laufen. So weit so gut, aber: openDD aktualisiert die Adresse, nur leider fehlt die letzte Ziffer der IP:
Also meine öffentliche IP lautet zum Beispiel: 123.234.123.237
opendd aktualisiert auf: 123.234.123.23
Verschluckt also die 7.

Ist meine IP zu lang? :)
 
Zuletzt bearbeitet:
Ist meine IP zu lang? :)
Versuch mal in diesem Patch, in der Funktion fgets, die Länge des strings (der aus der Datei ".opendd.ip" gelesen werden soll) von 15 auf 16 zu ändern:
Code:
+  struct sockaddr_in addr;
+  FILE *file;
+  char buffer[[COLOR=red][B]16[/B][/COLOR]];
+
+  /* Get my IP from an /tmp/.opendd.ip */
+  file = fopen("/tmp/.opendd.ip", "r");
+  if (NULL == file) {
+    logmsg(LOG_ERR, "dyndns() : Can't read external IP file!");
+    return 0;
+  }
+  [COLOR=red]fgets[/COLOR](buffer, [COLOR=red][B]15[/B][/COLOR], file);
+  fclose (file);
+  file = NULL;
+  inet_aton(buffer, &addr.sin_addr);
+  if (is_valid_ip(buffer)) {
+    *ip = strdup(inet_ntoa(addr.sin_addr));
 
Werde ich probieren, aber kann was dauern.
Habe jetzt vorerst mal den DNS-Clienten in der 6360 Cable aktiviert, damit ich wieder von außen zugreifen kann.
 
Werde ich probieren, ...
Code:
#include <stdio.h>

int main(void)
{
  FILE* fp;
  char buffer[16];

  fp=fopen("./openddip.txt","r");
  fgets(buffer, [COLOR=red][B]15[/B][/COLOR], fp);
  printf("the ip is: %s\n", buffer);

  fclose(fp);
  return (0);
}
Code:
:~/my_c> ./testip
the ip is: 224.224.224.22
Maintainer, please take action.;)
 
Es muss heißen
Code:
char buffer[[COLOR="red"]16[/COLOR]];
...
fgets(buffer, [COLOR="red"]16[/COLOR], fp);
Besser noch so, dann muss man nicht die Größe zweimal angeben.
Code:
char buffer[[COLOR="red"]16[/COLOR]];
...
fgets(buffer, [COLOR="red"]sizeof (buffer)[/COLOR], fp);

Und bevor man sich da groß Gedanken dazu macht, kann man auch gleich 20 nehmen. Der Speicher ist zwar begrenzt, aber es kommt nicht auf das letzte Byte an.
 

Statistik des Forums

Themen
244,885
Beiträge
2,220,165
Mitglieder
371,619
Neuestes Mitglied
Lebeat
Holen Sie sich 3CX - völlig kostenlos!
Verbinden Sie Ihr Team und Ihre Kunden Telefonie Livechat Videokonferenzen

Gehostet oder selbst-verwaltet. Für bis zu 10 Nutzer dauerhaft kostenlos. Keine Kreditkartendetails erforderlich. Ohne Risiko testen.

3CX
Für diese E-Mail-Adresse besteht bereits ein 3CX-Konto. Sie werden zum Kundenportal weitergeleitet, wo Sie sich anmelden oder Ihr Passwort zurücksetzen können, falls Sie dieses vergessen haben.