summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Harpin <development@landsofshadow.co.uk>2015-02-08 19:33:14 +0000
committerDaniil Baturin <daniil@baturin.org>2017-09-14 13:52:53 +0200
commita77b7539a77283aac8729e58d47b50ca80dadbd2 (patch)
tree87ffee3deaf85898e69b16762b149e292d3d29ee
parent508ef2c225fd62a2a823489a0c112a14fae38117 (diff)
downloadvyatta-cfg-system-a77b7539a77283aac8729e58d47b50ca80dadbd2.tar.gz
vyatta-cfg-system-a77b7539a77283aac8729e58d47b50ca80dadbd2.zip
vyatta-cfg-system: allow dynamic dns updating from behind nat
Add a couple of configuration options to DDNS, to allow the use=web option from ddclient when determining the external IP address. This will allow DDNS to be correctly updated when behind a NAT device. Syntax: set service dns dynamic interface eth0 use-web url (url to use) set service dns dynamic interface eth0 use-web skip (search for this) Bug #455 http://bugzilla.vyos.net/show_bug.cgi?id=455
-rwxr-xr-xscripts/dynamic-dns/vyatta-dynamic-dns.pl12
-rw-r--r--templates/service/dns/dynamic/interface/node.tag/use-web/node.def1
-rw-r--r--templates/service/dns/dynamic/interface/node.tag/use-web/skip/node.def2
-rw-r--r--templates/service/dns/dynamic/interface/node.tag/use-web/url/node.def2
4 files changed, 15 insertions, 2 deletions
diff --git a/scripts/dynamic-dns/vyatta-dynamic-dns.pl b/scripts/dynamic-dns/vyatta-dynamic-dns.pl
index 59495f99..5f852d6c 100755
--- a/scripts/dynamic-dns/vyatta-dynamic-dns.pl
+++ b/scripts/dynamic-dns/vyatta-dynamic-dns.pl
@@ -96,16 +96,24 @@ sub dynamicdns_get_constants {
$output .= "ssl=yes\n";
$output .= "pid=$ddclient_run_dir/ddclient_$interface.pid\n";
$output .= "cache=$ddclient_cache_dir/ddclient_$interface.cache\n";
- $output .= "use=if, if=$interface\n\n\n";
return $output;
}
sub dynamicdns_get_values {
- my $output = '';
+ my $output;
my $config = new Vyatta::Config;
$config->setLevel("service dns dynamic interface $interface");
+ my $web_url = $config->returnValue("use-web url");
+ my $web_skip = $config->returnValue("use-web skip");
+
+ if ($web_url && $web_skip) {
+ $output = "use=web, web=$web_url, web-skip='".$web_skip."'\n\n\n";
+ } else {
+ $output = "use=if, if=$interface\n\n\n";
+ }
+
my @services = $config->listNodes("service");
foreach my $service (@services) {
$config->setLevel("service dns dynamic interface $interface service $service");
diff --git a/templates/service/dns/dynamic/interface/node.tag/use-web/node.def b/templates/service/dns/dynamic/interface/node.tag/use-web/node.def
new file mode 100644
index 00000000..f1b86b6d
--- /dev/null
+++ b/templates/service/dns/dynamic/interface/node.tag/use-web/node.def
@@ -0,0 +1 @@
+help: Web check used for obtaining the external IP address
diff --git a/templates/service/dns/dynamic/interface/node.tag/use-web/skip/node.def b/templates/service/dns/dynamic/interface/node.tag/use-web/skip/node.def
new file mode 100644
index 00000000..f316a4b5
--- /dev/null
+++ b/templates/service/dns/dynamic/interface/node.tag/use-web/skip/node.def
@@ -0,0 +1,2 @@
+help: Skip everything before this on the given URL
+type: txt
diff --git a/templates/service/dns/dynamic/interface/node.tag/use-web/url/node.def b/templates/service/dns/dynamic/interface/node.tag/use-web/url/node.def
new file mode 100644
index 00000000..164ddde4
--- /dev/null
+++ b/templates/service/dns/dynamic/interface/node.tag/use-web/url/node.def
@@ -0,0 +1,2 @@
+help: URL to obtain the current external IP address
+type: txt