mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Add tunable, by default disabled, to enable the default gateway switching feature when the default one 'disappears'.
This commit is contained in:
parent
f8f3732a63
commit
7af360ceef
@ -372,7 +372,7 @@ function return_gateway_groups_array() {
|
||||
$gateways_arr = return_gateways_array();
|
||||
$gateway_groups_array = array();
|
||||
|
||||
if (0) {
|
||||
if (isset($config['system']['gw_switch_default'])) {
|
||||
/*
|
||||
* NOTE: The code below is meant to replace the default gateway when it goes down.
|
||||
* This facilitates services running on pfSense itself and are not handled by a PBR to continue working.
|
||||
|
||||
@ -56,6 +56,7 @@ $pconfig['proxyuser'] = $config['system']['proxyuser'];
|
||||
$pconfig['proxypass'] = $config['system']['proxypass'];
|
||||
$pconfig['harddiskstandby'] = $config['system']['harddiskstandby'];
|
||||
$pconfig['lb_use_sticky'] = isset($config['system']['lb_use_sticky']);
|
||||
$pconfig['gw_switch_default'] = isset($config['system']['gw_switch_default']);
|
||||
$pconfig['preferoldsa_enable'] = isset($config['ipsec']['preferoldsa']);
|
||||
$pconfig['racoondebug_enable'] = isset($config['ipsec']['racoondebug']);
|
||||
$pconfig['maxmss_enable'] = isset($config['system']['maxmss_enable']);
|
||||
@ -106,6 +107,11 @@ if ($_POST) {
|
||||
else
|
||||
unset($config['system']['lb_use_sticky']);
|
||||
|
||||
if($_POST['gw_switch_default'] == "yes")
|
||||
$config['system']['gw_switch_default'] = true;
|
||||
else
|
||||
unset($config['system']['gw_switch_default']);
|
||||
|
||||
if($_POST['preferoldsa_enable'] == "yes")
|
||||
$config['ipsec']['preferoldsa'] = true;
|
||||
else
|
||||
@ -271,6 +277,15 @@ function maxmss_checked(obj) {
|
||||
"robin."); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="22%" valign="top" class="vncell"><?=gettext("Load Balancing"); ?></td>
|
||||
<td width="78%" class="vtable">
|
||||
<input name="lb_use_sticky" type="checkbox" id="gw_switch_default" value="yes" <?php if ($pconfig['gw_switch_default']) echo "checked=\"checked\""; ?> />
|
||||
<strong><?=gettext("Allow default gateway switching"); ?></strong><br/>
|
||||
<?=gettext("If the link where the default gateway resides fails " .
|
||||
"switch the default gateway to another available one."); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" class="list" height="12"> </td>
|
||||
</tr>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user