mirror of
https://github.com/opnsense/core.git
synced 2026-02-03 20:39:42 -05:00
Merge 0df992200c into a5fed616a5
This commit is contained in:
commit
cc452a494d
2 changed files with 7 additions and 2 deletions
|
|
@ -91,12 +91,16 @@ class SNatRule extends Rule
|
|||
$this->log('SNAT / pool type not round-robin');
|
||||
$rule['disabled'] = true;
|
||||
}
|
||||
} elseif (preg_match("/^(wan|lan|opt[0-9]+)ip$/", $rule['target'], $matches)) {
|
||||
} elseif (preg_match("/^(wan|lan|opt[0-9]+)(ip)?$/", $rule['target'], $matches)) {
|
||||
if (empty($this->interfaceMapping["{$matches[1]}"])) {
|
||||
$this->log("SNAT / target missing");
|
||||
$rule['disabled'] = true;
|
||||
} else {
|
||||
} elseif (count($matches) == 3) {
|
||||
// interface was suffixed by "ip", use its primary address
|
||||
$rule['target'] = "({$this->interfaceMapping["{$matches[1]}"]['if']}:0)";
|
||||
} else {
|
||||
// network is possible here also, but only without aliases
|
||||
$rule['target'] = "({$this->interfaceMapping["{$matches[1]}"]['if']}:network:0)";
|
||||
}
|
||||
}
|
||||
foreach (array("sourceport", "dstport", "natport") as $fieldname) {
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ function formTranslateAddresses() {
|
|||
|
||||
// add this hosts ips
|
||||
foreach (legacy_config_get_interfaces(array('virtual' => false, "enable" => true)) as $intf => $intfdata) {
|
||||
$retval[$intf] = (!empty($intfdata['descr']) ? $intfdata['descr'] : $intf ) . " " . gettext("net");
|
||||
$retval[$intf."ip"] = (!empty($intfdata['descr']) ? $intfdata['descr'] : $intf ) . " " . gettext("address");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue