OpenWRT DDNS: Difference between revisions
| Line 15: | Line 15: | ||
==Installation and Configuration== | ==Installation and Configuration== | ||
=== Installation for Client and Server === | ===Installation for Client and Server=== | ||
Client: opkg install ddns-scripts luci-app-ddns curl * | opkg update | ||
Client: opkg install ddns-scripts ddns-scripts_nsupdates luci-app-ddns wget curl * | |||
Server: opkg install bind-server bind-tools (bind-tools includes: bind-rndc bind-check, plus dependencies are all installed)** | Server: opkg install bind-server bind-tools (bind-tools includes: bind-rndc bind-check, plus dependencies are all installed)** | ||
| Line 32: | Line 34: | ||
<nowiki>**</nowiki> It is necessary to disable the DNS functionality of DNSMASQ for BIND / NAMED to function properly. If DHCPD is used, and none of DNSMASQ's functionality is necessary, it is highly recommended to remove DNSMASQ instead of disabling it. Odd issues seem to crop up if it remains installed, even if disabled. | <nowiki>**</nowiki> It is necessary to disable the DNS functionality of DNSMASQ for BIND / NAMED to function properly. If DHCPD is used, and none of DNSMASQ's functionality is necessary, it is highly recommended to remove DNSMASQ instead of disabling it. Odd issues seem to crop up if it remains installed, even if disabled. | ||
=== Configuration for Client === | ===Configuration for Client=== | ||
Below is a working /etc/config/ddns configuration file for DDNS Scripts; <syntaxhighlight lang="text"> | Below is a working /etc/config/ddns configuration file for DDNS Scripts; <syntaxhighlight lang="text"> | ||
config ddns 'global' | config ddns 'global' | ||
| Line 57: | Line 59: | ||
It was found that WGET did not work reliably in situation where the router running the DDNS Client Scripts with a private WAN IP Address was behind another router with a public WAN IP Address. So CURL was used to address the issue. DD-WRT addresses this very issue with a radio button choice titled "Do not use external ip check" (worded poorly as negative questions are always a bit confusing), but OpenWRT offers no similar configuration via its GUI or in the configuration file (/etc/config/ddns). | It was found that WGET did not work reliably in situation where the router running the DDNS Client Scripts with a private WAN IP Address was behind another router with a public WAN IP Address. So CURL was used to address the issue. DD-WRT addresses this very issue with a radio button choice titled "Do not use external ip check" (worded poorly as negative questions are always a bit confusing), but OpenWRT offers no similar configuration via its GUI or in the configuration file (/etc/config/ddns). | ||
=== Configuration for Server === | ===Configuration for Server=== | ||
It is not the intent of this article to provide complete documentation on configuring a BIND / NAMED DNS server. This section assumes one has a functioning BIND / NAMED DNS Daemon / Service running. | It is not the intent of this article to provide complete documentation on configuring a BIND / NAMED DNS server. This section assumes one has a functioning BIND / NAMED DNS Daemon / Service running. | ||
| Line 66: | Line 68: | ||
}; | }; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
The above directives essentially adds a User Name / Password (in encrypted form) that the BIND / NAMED DNS Daemon / Service use to authenticate clients. "ddns" is the User name and the text within, but not including the double quotes, is the password. | |||
=== Secure Encrypted Communication Between Client and Server === | |||
...coming soon. | |||
== Troubleshooting == | ==Troubleshooting== | ||
For troubleshooting on the client side, under Services, Dynamic DNS, Advanced Settings Tab, enable the Log to file Check Box. | For troubleshooting on the client side, under Services, Dynamic DNS, Advanced Settings Tab, enable the Log to file Check Box. | ||
| Line 212: | Line 218: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== Additional Subjects == | |||
===DDNS on a Router Behind Another Router=== | |||
=== | |||
To get it to work properly, below is an example of a router with two WAN connections to the internet where both interfaces are behind other routers (IE, the router with the DDNS service has local IP Addresses assigned to its WAN interfaces);<syntaxhighlight lang="text"> | To get it to work properly, below is an example of a router with two WAN connections to the internet where both interfaces are behind other routers (IE, the router with the DDNS service has local IP Addresses assigned to its WAN interfaces);<syntaxhighlight lang="text"> | ||
config ddns 'global' | config ddns 'global' | ||
| Line 267: | Line 270: | ||
Some good hints came from here: https://github.com/openwrt/packages/issues/8277 | Some good hints came from here: https://github.com/openwrt/packages/issues/8277 | ||
=== | == Special Thanks == | ||
Several authors of several web pages stand out in terms of offering really good tips this article is based on. The are noted below; | |||
* https://www.leurent.eu/wiki/FAQ:OpenWRT (the example given using the dnssec-keygen will not work with the version of the tool included with OpenWRT, so use a different Linux system to generate the password) | |||
* https://www.foell.org/justin/diy-dynamic-dns-with-openwrt-bind/ and https://github.com/sleinen/openwrt-nsupdate (Nice examples, but older article, and is seems the DDNS Scripts have essentially addressed the custom DDNS script the authors describe, so don't actually follow the instructions) | |||
* https://stackoverflow.com/questions/11153958/how-to-enable-named-bind-dns-full-logging (the first person, [https://stackoverflow.com/users/1618161/steven-carr Steven Carr], that answers the question is greate, and I hate, hate, hate the idiot user ( [https://stackoverflow.com/users/1439767/alexsergeyev alexsergeyev]) that replied to this great answer by questioning why it is configured such that the logging to go to separate files. Well alexsergeyev, you're too stupid to understand the answer. So shut up and let smart users like [https://stackoverflow.com/users/1618161/steven-carr Steven Carr] answer the questions and quit bothering them since you have nothing useful to contribute.) | |||