content:serverbasics:network-dyndns
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.
Beide Seiten, vorherige ÜberarbeitungVorherige ÜberarbeitungNächste Überarbeitung | Vorherige Überarbeitung | ||
content:serverbasics:network-dyndns [2024/01/01 19:24] – [Check the Connection] obel1x | content:serverbasics:network-dyndns [2025/07/10 20:39] (aktuell) – obel1x | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
====== DynDNS and IPv6 ====== | ====== DynDNS and IPv6 ====== | ||
- | as i have been struggeling for a bit to get IPv6 Working, i am writing down, what i have experienced so far.. this guide may not be complete, so expect things not to work. | + | I found out, that IPv6 is really nice - even if you are behind some firewall or router - as long as you can make them pass the packets |
===== Difference between IPv4 and IPv6 ===== | ===== Difference between IPv4 and IPv6 ===== | ||
Zeile 18: | Zeile 18: | ||
I experienced, | I experienced, | ||
+ | |||
+ | ==== Problematic Brands ==== | ||
For example, the German Telekom does have a modem / router called " | For example, the German Telekom does have a modem / router called " | ||
Zeile 23: | Zeile 25: | ||
So - if you did the settings at your Firewall and still you cannot curl some Adress, maybe you have the wrong modem. | So - if you did the settings at your Firewall and still you cannot curl some Adress, maybe you have the wrong modem. | ||
+ | ==== Settings ==== | ||
+ | |||
+ | Also check if your modem has some feature called " | ||
+ | |||
+ | e.g. add the fqdn like: | ||
+ | |||
+ | < | ||
+ | cname.domainname.dynv6.net | ||
+ | |||
+ | </ | ||
+ | |||
+ | How the rebind protection work: DNS queries to your Router won't return the IP of the service. So if you experience, that '' | ||
===== Modem Setup ===== | ===== Modem Setup ===== | ||
Zeile 35: | Zeile 49: | ||
There is one thing to do in your router: open the Device and the Port to be accessable from the internet. This is nearby the same as it is done at IPv4. After that, genereally the host shpuld be reachable. | There is one thing to do in your router: open the Device and the Port to be accessable from the internet. This is nearby the same as it is done at IPv4. After that, genereally the host shpuld be reachable. | ||
+ | ===== Security/ | ||
+ | |||
+ | By default, your IPv6 Adress will contain the MAC of your network card, which is an unique hardware- identifier of the chip. This has the advantage, that this part of your adress is fixed in the internet an will not change, so you can always reach your device anywhere knowing this adress part - even on mobile devices that may change the adress according to the connected network. | ||
+ | |||
+ | The opposite is, that your device can always be identified by that adress for all times - making all network traffic attached to the device directly belonging to it. So someone analysing the traffic of that adress would know exactly when and what has been done with that device. This is very poor as for privacy. | ||
+ | |||
+ | To avoid this, your device can generate an id that will change from time to time, making it impossible to identify the device with that adress. | ||
+ | |||
+ | To turn this on, you can add a line to ''/ | ||
+ | < | ||
+ | sudo sysctl net.ipv6.conf.wlan0.use_tempaddr=2 | ||
+ | |||
+ | </ | ||
+ | |||
+ | Replace wlan0 with the name of your Device. | ||
+ | |||
+ | After that, check if your device has an temporary adress with '' | ||
+ | |||
+ | *** Not finished - i have not found any docs at ddclient, how to get the interface temporary adress working, made up [[https:// | ||
===== DynDNS Provider ===== | ===== DynDNS Provider ===== | ||
- | Next Step to choose is a provider for dyndns. There are many dyndns- providers out there. | + | Next Step to choose is a provider for dyndns. There are many dyndns- providers out there - even free of charge. E.g. [[https:// |
+ | |||
+ | The opposite of those free registries is, that you can only use a subdomain of the Top-Level domain they offer, which makes your Domain Name fixed at the end. For me personally, i have bought a domain on my own in the tld of my country (costs about 15 Euro in one Year), which i can now use. | ||
+ | |||
+ | ===== Register Subdomains ===== | ||
+ | |||
+ | After you logged into your DynDNS Provider, enable dynDNS for your IPs and add subdomains - each one for one service. If you want to acces your Portainer you created when setting up docker, e.g. use a Subdomain called | ||
+ | |||
+ | portainer.domain.tld | ||
+ | |||
+ | Make sure, that DynDNS is selected for that record again! | ||
===== DDclient ===== | ===== DDclient ===== | ||
Zeile 43: | 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 '' |
- | Add the Repository '' | + | After upgrading |
- | The config is in ''/ | + | The config is in ''/ |
< | < | ||
- | #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, | ||
+ | server=dyndns.strato.com/ | ||
+ | login=' | ||
+ | nextcloud.domain.tld, | ||
+ | |||
+ | # If you want ipv4 too you may use: | ||
+ | usev4=cmdv4, | ||
protocol=dyndns2, | protocol=dyndns2, | ||
- | server=dynv6.com, | + | server=dyndns.strato.com/nic/update, |
- | login=none, password=' | + | login=' |
- | domainname.dynv6.net,cname.domainname.dynv6.net | + | password=' |
+ | nextcloud.domain.tld,ipa.domain.tld | ||
</ | </ | ||
Zeile 66: | 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** | * You can also specify each option without comma, but then the setting will change the **defaults** | ||
+ | |||
+ | 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 / | ||
+ | |||
+ | < | ||
+ | #!/bin/bash | ||
+ | |||
+ | curl -s4 http:// | ||
+ | |||
+ | </ | ||
+ | |||
+ | Or - if you are using Fritzbox, then you may use phyton: | ||
+ | |||
+ | < | ||
+ | #!/bin/bash | ||
+ | FULLSTR=$(/ | ||
+ | SEARCH='" | ||
+ | S2='",' | ||
+ | P1=${FULLSTR# | ||
+ | P2=${P1%%$S2*} | ||
+ | IPADDR=${P2: | ||
+ | echo -n ${IPADDR} | ||
+ | |||
+ | </ | ||
+ | |||
+ | And File / | ||
+ | |||
+ | < | ||
+ | # | ||
+ | # -*- coding: utf-8 -*- | ||
+ | |||
+ | # Quelle: https:// | ||
+ | # 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 = " | ||
+ | password = " | ||
+ | |||
+ | # what we want to access | ||
+ | req_endpoint = '/ | ||
+ | service = ' | ||
+ | action = ' | ||
+ | |||
+ | # form-autofill for python users | ||
+ | soapaction = service + '#' | ||
+ | raw_envelope = re.sub(r" | ||
+ | """<? | ||
+ | |||
+ | # send the authenticated soap request | ||
+ | auth = HTTPDigestAuth(username, | ||
+ | device = " | ||
+ | headers = {' | ||
+ | envelope = raw_envelope.format(service=service, | ||
+ | encoded = envelope.encode(" | ||
+ | boxdata = requests.post(url=device, | ||
+ | |||
+ | # XML to dict, remove outer nesting, pretty print JSON | ||
+ | data_dict = xmltodict.parse(boxdata) | ||
+ | response_tag = ' | ||
+ | data_dict = data_dict[' | ||
+ | json_data = json.dumps(data_dict, | ||
+ | print(json_data) | ||
+ | |||
+ | main() | ||
+ | |||
+ | </ | ||
==== Debugging ==== | ==== Debugging ==== | ||
Zeile 81: | Zeile 210: | ||
==== Check the Connection ==== | ==== Check the Connection ==== | ||
- | you may now have the IPv6 of your Device published at some adress and check this by: | + | you may now have the IPv6 of your Device published at some adress and check this by digging at googles DNS for that IPV6: |
< | < | ||
- | pcserver2023: | + | pcserver2023: |
- | Server: 192.168.2.1 | + | |
- | Address: 192.168.2.1#53 | + | ; <<>> |
+ | ; (1 server found) | ||
+ | ;; global options: +cmd | ||
+ | ;; Got answer: | ||
+ | ;; ->> | ||
+ | ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 | ||
+ | |||
+ | ;; OPT PSEUDOSECTION: | ||
+ | ; EDNS: version: 0, flags:; udp: 512 | ||
+ | ;; QUESTION SECTION: | ||
+ | ;ipa.obel1x.de. IN AAAA | ||
+ | |||
+ | ;; ANSWER SECTION: | ||
+ | ipa.obel1x.de. | ||
- | Non-authoritative answer: | + | ;; Query time: 44 msec |
- | Name: obel1x.dynv6.net | + | ;; SERVER: 8.8.8.8# |
- | Address: 2003:c4:bf3c: | + | ;; WHEN: Sat Feb 08 12:49:12 CET 2025 |
+ | ;; MSG SIZE rcvd: 70 | ||
</ | </ |
content/serverbasics/network-dyndns.1704133479.txt.gz · Zuletzt geändert: von obel1x