diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2007-05-09 16:48:57 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2007-05-09 16:48:57 +0000 |
commit | ab0d03948abb62b542f96741534723cfa1c0067a (patch) | |
tree | d2a4eec70abf31b89cdb953380fb0e9f0a4ab906 | |
parent | 9c9de6f702d6c186d96097e583719cf117377a10 (diff) | |
download | pfsense-ab0d03948abb62b542f96741534723cfa1c0067a.zip pfsense-ab0d03948abb62b542f96741534723cfa1c0067a.tar.gz |
Port load balancer sticky address option
-rw-r--r-- | etc/inc/services.inc | 8 | ||||
-rwxr-xr-x | etc/rc.bootup | 1 | ||||
-rwxr-xr-x | usr/local/www/system_advanced.php | 31 |
3 files changed, 39 insertions, 1 deletions
diff --git a/etc/inc/services.inc b/etc/inc/services.inc index 567a804..3dcf3bc 100644 --- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -32,6 +32,14 @@ /* include all configuration functions */ require_once("functions.inc"); +function load_balancer_use_sticky() { + global $config, $g; + if (isset ($config['system']['lb_use_sticky'])) + touch("/var/etc/use_pf_pool__stickyaddr"); + else + unlink_if_exists("/var/etc/use_pf_pool__stickyaddr"); +} + function services_dhcpd_configure() { global $config, $g; if(isset($config['system']['developerspew'])) { diff --git a/etc/rc.bootup b/etc/rc.bootup index 823db64..b7d51dc 100755 --- a/etc/rc.bootup +++ b/etc/rc.bootup @@ -175,6 +175,7 @@ setup_filter_bridge(); /* start load balancer daemon */ + load_balancer_use_sticky(); slbd_configure(); /* start OpenVPN server & clients */ diff --git a/usr/local/www/system_advanced.php b/usr/local/www/system_advanced.php index 39960d7..a0e7fb5 100755 --- a/usr/local/www/system_advanced.php +++ b/usr/local/www/system_advanced.php @@ -59,6 +59,7 @@ $pconfig['disablenatreflection'] = $config['system']['disablenatreflection']; $pconfig['disablechecksumoffloading'] = isset($config['system']['disablechecksumoffloading']); $pconfig['disablescrub'] = isset($config['system']['disablescrub']); $pconfig['shapertype'] = $config['system']['shapertype']; +$pconfig['lb_use_sticky'] = isset($config['system']['lb_use_sticky']); if ($_POST) { @@ -130,6 +131,11 @@ if ($_POST) { setup_polling(); } + if($_POST['lb_use_sticky'] == "yes") + $config['system']['lb_use_sticky'] = true; + else + unset($config['system']['lb_use_sticky']); + if($_POST['sharednet'] == "yes") { $config['system']['sharednet'] = true; system_disable_arp_wrong_if(); @@ -315,7 +321,7 @@ include("head.inc"); </tr> <tr> <td colspan="2" class="list" height="12"> </td> - </tr> + </tr> <tr> <td colspan="2" valign="top" class="listtopic">Shared Physical Network</td> </tr> @@ -403,6 +409,29 @@ include("head.inc"); <td colspan="2" class="list" height="12"> </td> </tr> <tr> + <td colspan="2" valign="top" class="listtopic">Load Balancing</td> + </tr> + <tr> + <td width="22%" valign="top" class="vncell">Load Balancing</td> + <td width="78%" class="vtable"> + <input name="lb_use_sticky" type="checkbox" id="lb_use_sticky" value="yes" <?php if ($pconfig['lb_use_sticky']) echo "checked=\"checked\""; ?> /> + <strong>Use sticky connections</strong> + <br /> + <span class="vexpl"> + Successive connections will be redirected to the servers in a round-robin manner with connections from the same source being sent to the same web server. This \"sticky connection\" will exist as long as there are states that refer to this connection. Once the states expire, so will the sticky connection. Further connections from that host will be redirected to the next web server in the round robin. + </span> + </td> + </tr> + <tr> + <td width="22%" valign="top"> </td> + <td width="78%"> + <input type="submit" class="formbtn" value="<?=gettext("Save");?>" onclick="enable_change(true)" /> + </td> + </tr> + <tr> + <td colspan="2" class="list" height="12"> </td> + </tr> + <tr> <td colspan="2" valign="top" class="listtopic">Miscellaneous</td> </tr> |