summaryrefslogtreecommitdiff
path: root/scripts/dynamic-dns
diff options
context:
space:
mode:
authorAlex Harpin <development@landsofshadow.co.uk>2015-02-08 19:33:14 +0000
committerAlex Harpin <development@landsofshadow.co.uk>2015-02-08 20:08:35 +0000
commit935deedc1499e1446fad6e153f761f11817be201 (patch)
treeccdb6227cbe50ee550d98998fbcbc416ec77cbf4 /scripts/dynamic-dns
parenta0df6222dcf9a8d2a2d6f02b28ede4858d3a5c17 (diff)
downloadvyatta-cfg-system-935deedc1499e1446fad6e153f761f11817be201.tar.gz
vyatta-cfg-system-935deedc1499e1446fad6e153f761f11817be201.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
Diffstat (limited to 'scripts/dynamic-dns')
-rwxr-xr-xscripts/dynamic-dns/vyatta-dynamic-dns.pl12
1 files changed, 10 insertions, 2 deletions
diff --git a/scripts/dynamic-dns/vyatta-dynamic-dns.pl b/scripts/dynamic-dns/vyatta-dynamic-dns.pl
index 8788730f..83206253 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");