diff options
author | PiBa-NL <pba_2k3@yahoo.com> | 2015-11-26 00:14:26 +0100 |
---|---|---|
committer | PiBa-NL <pba_2k3@yahoo.com> | 2015-11-26 00:14:26 +0100 |
commit | de34f1fc12f29db0348f8ff9b1bc8300d9fb74d2 (patch) | |
tree | 77bc38448d8145cf0d76646c3606596d27e3ef39 /src/usr | |
parent | c64e401c85f3ef081a8c6b9e4a8d0a4b4a9835f7 (diff) | |
download | pfsense-de34f1fc12f29db0348f8ff9b1bc8300d9fb74d2.zip pfsense-de34f1fc12f29db0348f8ff9b1bc8300d9fb74d2.tar.gz |
Allow gateway outside interface subnet. Fixes #972, #1847, and was checked (on 2.2.5) with that provider to work properly for the IPv4 part. In 2.3 test machine IPv6 also seems to insert the proper routes.
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/local/www/system_gateways_edit.php | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/usr/local/www/system_gateways_edit.php b/src/usr/local/www/system_gateways_edit.php index 47b19f5..5641924 100644 --- a/src/usr/local/www/system_gateways_edit.php +++ b/src/usr/local/www/system_gateways_edit.php @@ -124,6 +124,7 @@ if (isset($id) && $a_gateways[$id]) { $pconfig['down'] = $a_gateways[$id]['down']; $pconfig['monitor'] = $a_gateways[$id]['monitor']; $pconfig['monitor_disable'] = isset($a_gateways[$id]['monitor_disable']); + $pconfig['nonlocalgateway'] = isset($a_gateways[$id]['nonlocalgateway']); $pconfig['descr'] = $a_gateways[$id]['descr']; $pconfig['attribute'] = $a_gateways[$id]['attribute']; $pconfig['disabled'] = isset($a_gateways[$id]['disabled']); @@ -190,7 +191,7 @@ if ($_POST) { $parent_sn = get_interface_subnet($_POST['interface']); if (empty($parent_ip) || empty($parent_sn)) { $input_errors[] = gettext("Cannot add IPv4 Gateway Address because no IPv4 address could be found on the interface."); - } else { + } elseif (!isset($_POST["nonlocalgateway"])) { $subnets = array(gen_subnet($parent_ip, $parent_sn) . "/" . $parent_sn); $vips = link_interface_to_vips($_POST['interface']); if (is_array($vips)) { @@ -221,7 +222,7 @@ if ($_POST) { $parent_sn = get_interface_subnetv6($_POST['interface']); if (empty($parent_ip) || empty($parent_sn)) { $input_errors[] = gettext("Cannot add IPv6 Gateway Address because no IPv6 address could be found on the interface."); - } else { + } elseif (!isset($_POST["nonlocalgateway"])) { $subnets = array(gen_subnetv6($parent_ip, $parent_sn) . "/" . $parent_sn); $vips = link_interface_to_vips($_POST['interface']); if (is_array($vips)) { @@ -515,6 +516,9 @@ if ($_POST) { if ($_POST['monitor_disable'] == "yes") { $gateway['monitor_disable'] = true; } + if ($_POST['nonlocalgateway'] == "yes") { + $gateway['nonlocalgateway'] = true; + } if ($_POST['force_down'] == "yes") { $gateway['force_down'] = true; } @@ -966,6 +970,13 @@ $section->addInput(new Form_StaticText( '</span>' )); +$section->addInput(new Form_Checkbox( + 'nonlocalgateway', + 'Use nonlocal gateway', + 'Use nonlocal gateway through interface specific route.', + $pconfig['nonlocalgateway'] +))->setHelp('This will disable the check if the gateway is reachable using the interface subnet. This is usually means a configuration error, but is required for some scenarios.'); + $form->add($section); print $form; |