summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/inc/services.inc3
-rw-r--r--usr/local/www/services_rfc2136_edit.php9
2 files changed, 12 insertions, 0 deletions
diff --git a/etc/inc/services.inc b/etc/inc/services.inc
index 25fad4f..0a3ccad 100644
--- a/etc/inc/services.inc
+++ b/etc/inc/services.inc
@@ -2018,6 +2018,9 @@ EOD;
/* Update IPv4 if we have it. */
if (is_ipaddrv4($wanip)) {
if (($wanip != $cachedipv4) || (($currentTime - $cacheTimev4) > $maxCacheAgeSecs) || $forced) {
+ if (isset($dnsupdate['usepublicip'])) {
+ $wanip = dyndnsCheckIP($dnsupdate['interface']);
+ }
$upinst .= "update delete {$dnsupdate['host']}. A\n";
$upinst .= "update add {$dnsupdate['host']}. {$dnsupdate['ttl']} A {$wanip}\n";
$notify_text .= sprintf(gettext("DynDNS updated IP Address (A) for {$dnsupdate['host']} on %s (%s) to %s"), convert_real_interface_to_friendly_descr($if), $if, $wanip) . "\n";
diff --git a/usr/local/www/services_rfc2136_edit.php b/usr/local/www/services_rfc2136_edit.php
index 091cfbd..965940f 100644
--- a/usr/local/www/services_rfc2136_edit.php
+++ b/usr/local/www/services_rfc2136_edit.php
@@ -55,6 +55,7 @@ if (isset($id) && isset($a_rfc2136[$id])) {
$pconfig['server'] = $a_rfc2136[$id]['server'];
$pconfig['interface'] = $a_rfc2136[$id]['interface'];
$pconfig['usetcp'] = isset($a_rfc2136[$id]['usetcp']);
+ $pconfig['usepublicip'] = isset($a_rfc2136[$id]['usepublicip']);
$pconfig['descr'] = $a_rfc2136[$id]['descr'];
}
@@ -89,6 +90,7 @@ if ($_POST) {
$rfc2136['keydata'] = $_POST['keydata'];
$rfc2136['server'] = $_POST['server'];
$rfc2136['usetcp'] = $_POST['usetcp'] ? true : false;
+ $rfc2136['usepublicip'] = $_POST['usepublicip'] ? true : false;
$rfc2136['interface'] = $_POST['interface'];
$rfc2136['descr'] = $_POST['descr'];
@@ -191,6 +193,13 @@ include("head.inc");
<input name="usetcp" type="checkbox" id="usetcp" value="<?=gettext("yes");?>" <?php if ($pconfig['usetcp']) echo "checked"; ?>>
<strong><?=gettext("Use TCP instead of UDP");?></strong></td>
</tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq"><?=gettext("Use Public IP");?></td>
+ <td width="78%" class="vtable">
+ <input name="usepublicip" type="checkbox" id="usepublicip" value="<?=gettext("yes");?>" <?php if ($pconfig['usepublicip']) echo "checked"; ?>>
+ <strong><?=gettext("If the interface IP is private, attempt to fetch and use the public IP instead.");?></strong>
+ </td>
+ </tr>
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Description");?></td>
<td width="78%" class="vtable">
OpenPOWER on IntegriCloud