Benutzer-Werkzeuge

Webseiten-Werkzeuge


content:serverbasics:network-dyndns

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.

Link zu der Vergleichsansicht

Beide Seiten, vorherige ÜberarbeitungVorherige Überarbeitung
Nächste Überarbeitung
Vorherige Überarbeitung
content:serverbasics:network-dyndns [2025/02/08 15:10] obel1xcontent:serverbasics:network-dyndns [2025/07/10 20:39] (aktuell) obel1x
Zeile 36: Zeile 36:
 </file> </file>
  
 +How the rebind protection work: DNS queries to your Router won't return the IP of the service. So if you experience, that ''dig to 8.8.8.8'' will work, but ''nslookup'' does not - check the rebind protection!
 ===== Modem Setup ===== ===== Modem Setup =====
  
Zeile 66: Zeile 67:
 After that, check if your device has an temporary adress with ''ip addr'' After that, check if your device has an temporary adress with ''ip addr''
  
-*** Not finished - i have not found any docs at ddclient, how to get the interface temporary adress working, made up [[https://github.com/ddclient/ddclient/issues/651|https://github.com/ddclient/ddclient/issues/651]] *** +*** Not finished - i have not found any docs at ddclient, how to get the interface temporary adress working, made up [[https://github.com/ddclient/ddclient/issues/651|https://github.com/ddclient/ddclient/issues/651]] *** For the time beeing, i will be fine using the non- private adress.
-For the time beeing, i will be fine using the non- private adress. +
 ===== DynDNS Provider ===== ===== DynDNS Provider =====
  
Zeile 87: Zeile 86:
 The Task to update the dyndns- entry to point to the right host can be done best on the host itself as explained before. The Host may detect interface- changes of the Adress and will push out automagically using some client. The Task to update the dyndns- entry to point to the right host can be done best on the host itself as explained before. The Host may detect interface- changes of the Adress and will push out automagically using some client.
  
-DDClient can be used in the local server/host to assign some DNS- Record to an IP. It turned out, that the **DDclient V3.8.3 of OpenSuSE Leap 15.5** was not able to work with IPv6 in the Version coming from the main Repositories.+Hint for old SuSE: DDClient can be used in the local server/host to assign some DNS- Record to an IP. It turned out, that the **DDclient V3.8.3 of OpenSuSE Leap 15.5** was not able to work with IPv6 in the Version coming from the main Repositories. So add the Repository ''[[https://download.opensuse.org/repositories/network/|https://download.opensuse.org/repositories/network/]]${releasever}/''with yast and update to the Packages of that Repository first, so you get **DDclient V3.11.3**, which is able to deal with ipv6.
  
-Add the Repository ''[[https://download.opensuse.org/repositories/network/|https://download.opensuse.org/repositories/network/]]${releasever}/''with yast and update to the Packages of that Repository first, so you get **DDclient V3.11.3**which is able to deal with ipv6.+After upgrading to Leap 15.6this should be gone.
  
-The config is in ''/etc/ddclient.conf'' and it could contain e.g. those lines:+The config is in ''/etc/ddclient/ddclient.conf'' and it could contain e.g. those lines:
 <file> <file>
  
-#01.01.2023 dnydns test +Globals 
-ssl=yes,+daemon=300 
 +ssl=yes 
 +syslog=yes 
 +mail-failure=root 
 + 
 +# IP-Specific
 usev6=ifv6, usev6=ifv6,
-if=wlan0,+if=eth0,
 protocol=dyndns2, protocol=dyndns2,
-server=dynv6.com, +server=dyndns.strato.com/nic/update
-login=none, password='blabla' +login='domain.tld', password='blabla', 
-domainname.dynv6.net,cname.domainname.dynv6.net+nextcloud.domain.tld,ipa.domain.tld 
 + 
 +# If you want ipv4 too you may use: 
 +usev4=cmdv4, cmdv4=/etc/ddclient/myipv4address.sh 
 +protocol=dyndns2, 
 +server=dyndns.strato.com/nic/update, 
 +login='domain.tld', 
 +password='blabla', 
 +nextcloud.domain.tld,ipa.domain.tld
  
 </file> </file>
Zeile 110: Zeile 122:
   * DDClients Config is a bit strange to understand. My example is **one server **in the view of ddclient, which is why there are commas seperating the options for that host.   * DDClients Config is a bit strange to understand. My example is **one server **in the view of ddclient, which is why there are commas seperating the options for that host.
   * You can also specify each option without comma, but then the setting will change the **defaults**  of ddclient   * You can also specify each option without comma, but then the setting will change the **defaults**  of ddclient
 +
 +After that, you may use a script for determining the right ipv4- adress. This is while NAT of IPV4 needs the adress of your router and not you servers adress.
 +
 +One Example would be this file /etc/ddclient/myipv4address.sh
 +
 +<file>
 +#!/bin/bash
 +
 +curl -s4 http://ifconfig.me/ip
 +
 +</file>
 +
 +Or - if you are using Fritzbox, then you may use phyton:
 +
 +<file>
 +#!/bin/bash
 +FULLSTR=$(/etc/ddclient/get_ipaddress.py)
 +SEARCH='"NewExternalIPAddress":'
 +S2='",'
 +P1=${FULLSTR#*$SEARCH}
 +P2=${P1%%$S2*}
 +IPADDR=${P2:2}
 +echo -n ${IPADDR}
 +
 +</file>
 +
 +And File /etc/ddclient/get_ipaddress.py
 +
 +<file>
 +#!/usr/bin/env python3
 +# -*- coding: utf-8 -*-
 +
 +# Quelle: https://github.com/ran-sama/fritzbox-soap-json
 +# Vorbereitung:
 +# - Paket python3-xmltodict installieren
 +# - Benutzer, Passwort
 +
 +import requests, xmltodict, json, re
 +from requests.auth import HTTPDigestAuth
 +
 +def main():
 +    # define your IP and credentials in you fritzbox first
 +    username = "fritzboxuser"
 +    password = "passwordfritzboxuser"
 +
 +    # what we want to access
 +    req_endpoint = '/upnp/control/wanpppconn1'
 +    service = 'urn:dslforum-org:service:WANPPPConnection:1'
 +    action = 'GetInfo'
 +
 +    # form-autofill for python users
 +    soapaction = service + '#' + action
 +    raw_envelope = re.sub(r"\s +", "",
 +        """<?xml version="1.0" encoding="utf-8"?><s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><u:{action} xmlns:u="{service}"></u:{action}></s:Body></s:Envelope>""")
 +
 +    # send the authenticated soap request
 +    auth = HTTPDigestAuth(username, password)
 +    device = "http://fritz.box:49000" + req_endpoint
 +    headers = {'soapaction': soapaction, 'content-type': 'text/xml','charset': 'utf-8'}
 +    envelope = raw_envelope.format(service=service, action=action)
 +    encoded = envelope.encode("utf-8")
 +    boxdata = requests.post(url=device, data=encoded, headers=headers, auth=auth).content.decode('utf-8')
 +
 +    # XML to dict, remove outer nesting, pretty print JSON
 +    data_dict = xmltodict.parse(boxdata)
 +    response_tag = 'u:' + action + 'Response'
 +    data_dict = data_dict['s:Envelope']['s:Body'][response_tag]
 +    json_data = json.dumps(data_dict, indent=4)
 +    print(json_data)
 +
 +main()
 +
 +</file>
  
 ==== Debugging ==== ==== Debugging ====
content/serverbasics/network-dyndns.1739023824.txt.gz · Zuletzt geändert: von obel1x

Falls nicht anders bezeichnet, ist der Inhalt dieses Wikis unter der folgenden Lizenz veröffentlicht: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki