mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 08:34:39 +00:00
gateways: pick up interface for manual route to far gateway; closes #880
This commit is contained in:
parent
51531ca047
commit
b3d1481797
@ -662,6 +662,7 @@ function system_staticroutes_configure($interface = '', $update_dns = false)
|
||||
}
|
||||
|
||||
$gatewayip = $gateway['gateway'];
|
||||
$needs_iface = isset($gateway['fargw']);
|
||||
$interfacegw = $gateway['interface'];
|
||||
|
||||
$blackhole = "";
|
||||
@ -715,11 +716,12 @@ function system_staticroutes_configure($interface = '', $update_dns = false)
|
||||
$ip .= "/128";
|
||||
}
|
||||
$inet = (is_subnetv6($ip) ? "-inet6" : "-inet");
|
||||
$iface = $needs_iface ? ' -iface ' . escapeshellarg($interfacegw) . ' ' : '';
|
||||
$cmd = " {$inet} {$blackhole} " . escapeshellarg($ip) . " ";
|
||||
if (is_subnet($ip)) {
|
||||
if (is_ipaddr($gatewayip)) {
|
||||
mwexec("/sbin/route delete".$cmd . escapeshellarg($gatewayip));
|
||||
mwexec("/sbin/route add".$cmd . escapeshellarg($gatewayip));
|
||||
mwexec("/sbin/route delete".$cmd . $iface . escapeshellarg($gatewayip));
|
||||
mwexec("/sbin/route add".$cmd . $iface . escapeshellarg($gatewayip));
|
||||
} elseif (!empty($interfacegw)) {
|
||||
mwexec("/sbin/route delete".$cmd . "-iface " . escapeshellarg($interfacegw));
|
||||
mwexec("/sbin/route add".$cmd . "-iface " . escapeshellarg($interfacegw));
|
||||
|
||||
@ -645,7 +645,8 @@ $( document ).ready(function() {
|
||||
<td>
|
||||
<input name="fargw" type="checkbox" value="yes" <?=!empty($pconfig['fargw']) ? 'checked="checked"' : '';?> />
|
||||
<div class="hidden" for="help_for_fargw">
|
||||
<?=gettext("This will allow the gateway to exist outside of the interface subnet."); ?>
|
||||
<?=gettext("This will allow the gateway to exist outside of the interface subnet. " .
|
||||
"A corresponding route must bet set up for this gateway in order for it to operate correctly."); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user