#!/usr/local/bin/php . All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ require("guiconfig.inc"); $pconfig['disablefilter'] = $config['system']['disablefilter']; $pconfig['disableftpproxy'] = $config['system']['disableftpproxy']; $pconfig['rfc959workaround'] = $config['system']['rfc959workaround']; $pconfig['filteringbridge_enable'] = isset($config['bridge']['filteringbridge']); $pconfig['ipv6nat_enable'] = isset($config['diag']['ipv6nat']['enable']); $pconfig['ipv6nat_ipaddr'] = $config['diag']['ipv6nat']['ipaddr']; $pconfig['cert'] = base64_decode($config['system']['webgui']['certificate']); $pconfig['key'] = base64_decode($config['system']['webgui']['private-key']); $pconfig['disableconsolemenu'] = isset($config['system']['disableconsolemenu']); $pconfig['disablefirmwarecheck'] = isset($config['system']['disablefirmwarecheck']); $pconfig['altfirmwareurl'] = $config['system']['altfirmwareurl']['enabled']; $pconfig['firmware_base_url'] = $config['system']['alt_firmware_url']['firmware_base_url']; $pconfig['firmwarename'] = $config['system']['alt_firmware_url']['firmware_filename']; $pconfig['altpkgconfigurl'] = $config['system']['alt_pkgconfig_url']['enabled']; $pconfig['pkgconfig_base_url'] = $config['system']['alt_pkgconfig_url']['pkgconfig_base_url']; $pconfig['pkgconfig_filename'] = $config['system']['alt_pkgconfig_url']['pkgconfig_filename']; $pconfig['expanddiags'] = isset($config['system']['webgui']['expanddiags']); if ($g['platform'] == "generic-pc") $pconfig['harddiskstandby'] = $config['system']['harddiskstandby']; $pconfig['noantilockout'] = isset($config['system']['webgui']['noantilockout']); $pconfig['tcpidletimeout'] = $config['filter']['tcpidletimeout']; $pconfig['schedulertype'] = $config['system']['schedulertype']; $pconfig['maximumstates'] = $config['system']['maximumstates']; $pconfig['disablerendevouz'] = $config['system']['disablerendevouz']; if ($_POST) { unset($input_errors); $pconfig = $_POST; /* input validation */ if ($_POST['ipv6nat_enable'] && !is_ipaddr($_POST['ipv6nat_ipaddr'])) { $input_errors[] = "You must specify an IP address to NAT IPv6 packets."; } if ($_POST['maximumstates'] && !is_numericint($_POST['maximumstates'])) { $input_errors[] = "The Firewall Maximum States value must be an integer."; } if ($_POST['tcpidletimeout'] && !is_numericint($_POST['tcpidletimeout'])) { $input_errors[] = "The TCP idle timeout must be an integer."; } if (($_POST['cert'] && !$_POST['key']) || ($_POST['key'] && !$_POST['cert'])) { $input_errors[] = "Certificate and key must always be specified together."; } else if ($_POST['cert'] && $_POST['key']) { if (!strstr($_POST['cert'], "BEGIN CERTIFICATE") || !strstr($_POST['cert'], "END CERTIFICATE")) $input_errors[] = "This certificate does not appear to be valid."; if (!strstr($_POST['key'], "BEGIN RSA PRIVATE KEY") || !strstr($_POST['key'], "END RSA PRIVATE KEY")) $input_errors[] = "This key does not appear to be valid."; if ($_POST['altfirmwareurl']) if ($_POST['firmwareurl'] == "" || $_POST['firmwarename'] == "") $input_errors[] = "You must specify a base URL and a filename for the alternate firmware."; if ($_POST['altpkgconfigurl']) if ($_POST['pkgconfig_base_url'] == "" || $_POST['pkgconfig_filename'] == "") $input_errors[] = "You must specifiy and base URL and a filename before using an alternate pkg_config.xml."; } if (!$input_errors) { if($_POST['disablefilter'] == "yes") { $config['system']['disablefilter'] = "enabled"; } else { unset($config['system']['disablefilter']); } if($_POST['disableftpproxy'] == "yes") { $config['system']['disableftpproxy'] = "enabled"; unset($config['system']['rfc959workaround']); } else { unset($config['system']['disableftpproxy']); } if($_POST['rfc959workaround'] == "yes") { $config['system']['rfc959workaround'] = "enabled"; } $config['bridge']['filteringbridge'] = $_POST['filteringbridge_enable'] ? true : false; $config['diag']['ipv6nat']['enable'] = $_POST['ipv6nat_enable'] ? true : false; $config['diag']['ipv6nat']['ipaddr'] = $_POST['ipv6nat_ipaddr']; $oldcert = $config['system']['webgui']['certificate']; $oldkey = $config['system']['webgui']['private-key']; $config['system']['webgui']['certificate'] = base64_encode($_POST['cert']); $config['system']['webgui']['private-key'] = base64_encode($_POST['key']); $config['system']['disableconsolemenu'] = $_POST['disableconsolemenu'] ? true : false; $config['system']['disablefirmwarecheck'] = $_POST['disablefirmwarecheck'] ? true : false; $config['system']['altfirmwareurl'] = $_POST['altfirmwareurl'] ? true : false; if ($_POST['altfirmwareurl']) { $config['system']['alt_firmware_url'] = array(); $config['system']['alt_firmware_url']['enabled'] = ""; $config['system']['alt_firmware_url']['firmware_base_url'] = $_POST['firmwareurl']; $config['system']['alt_firmware_url']['firmware_filename'] = $_POST['firmwarename']; } elseif (isset($config['system']['alt_firmware_url']['firmware_base_url']) || isset($config['system']['alt_firmware_url']['firmware_filename'])) { unset($config['system']['alt_firmware_url']['enabled']); } else { unset($config['system']['alt_firmware_url']); } if ($_POST['altpkgconfigurl']) { $config['system']['alt_pkgconfig_url'] = array(); $config['system']['alt_pkgconfig_url']['enabled'] = ""; $config['system']['alt_pkgconfig_url']['pkgconfig_base_url'] = $_POST['pkgconfig_base_url']; $config['system']['alt_pkgconfig_url']['pkgconfig_filename'] = $_POST['pkgconfig_filename']; } elseif (isset($config['system']['alt_pkgconfig_url']['pkgconfig_base_url']) || isset($config['system']['alt_pkgconfig_url']['pkgconfig_filename'])) { unset($config['system']['alt_pkgconfig_url']['enabled']); } else { unset($config['system']['alt_pkgconfig_url']); } $config['system']['webgui']['expanddiags'] = $_POST['expanddiags'] ? true : false; $config['system']['optimization'] = $_POST['optimization']; $config['system']['disablerendevouz'] = $_POST['disablerendevouz']; if ($g['platform'] == "generic-pc") { $oldharddiskstandby = $config['system']['harddiskstandby']; $config['system']['harddiskstandby'] = $_POST['harddiskstandby']; } $config['system']['webgui']['noantilockout'] = $_POST['noantilockout'] ? true : false; /* Firewall and ALTQ options */ $config['system']['schedulertype'] = $_POST['schedulertype']; $config['system']['maximumstates'] = $_POST['maximumstates']; write_config(); if (($config['system']['webgui']['certificate'] != $oldcert) || ($config['system']['webgui']['private-key'] != $oldkey)) { // touch($d_sysrebootreqd_path); system_webgui_start(); } else if (($g['platform'] == "generic-pc") && ($config['system']['harddiskstandby'] != $oldharddiskstandby)) { if (!$config['system']['harddiskstandby']) { // Reboot needed to deactivate standby due to a stupid ATA-protocol touch($d_sysrebootreqd_path); unset($config['system']['harddiskstandby']); } else { // No need to set the standby-time if a reboot is needed anyway system_set_harddisk_standby(); } } $retval = 0; if (!file_exists($d_sysrebootreqd_path)) { config_lock(); $retval = filter_configure(); if(stristr($retval, "error") <> true) $savemsg = get_std_save_message($retval); else $savemsg = $retval; $retval |= interfaces_optional_configure(); config_unlock(); } } } ?> <?=gentitle("System: Advanced functions");?>

System: Advanced functions

Note: the options on this page are intended for use by advanced users only, and there's NO support for them.


Disable Rendezvous
  onclick="enable_change(false)"> Disable the Rendevouz automatic discovery protocol.
 
IPv6 tunneling
  onclick="enable_change(false)"> NAT encapsulated IPv6 packets (IP protocol 41/RFC2893) to:

 (IP address)
Don't forget to add a firewall rule to permit IPv6 packets!
 
Filtering bridge
  > Enable filtering bridge
This will cause bridged packets to pass through the packet filter in the same way as routed packets do (by default bridged packets are always passed). If you enable this option, you'll have to add filter rules to selectively permit traffic from bridged interfaces.
 
webGUI SSL certificate/key
Certificate
Paste a signed certificate in X.509 PEM format here. Create certificates automatically.
Key
Paste an RSA private key in PEM format here.
 
Miscellaneous
Console menu > Disable console menu
Changes to this option will take effect after a reboot.
Firmware version check > Disable firmware version check
This will cause pfSense not to check for newer firmware versions when the System: Firmware page is viewed.
Alternate firmware URL > Use a different URL for firmware upgrades
Base URL:
Filename:
This is where pfSense will check for newer firmware versions when System: Firmware page is viewed.
Alternate pkg_config.xml URL > Retrieve the package list from a different URL
Base URL:
Filename:
This is where pfSense will fetch its package list from.
Hard disk standby time
Puts the hard disk into standby mode when the selected amount of time after the last access has elapsed. Do not set this for CF cards.
Navigation > Keep diagnostics in navigation expanded
webGUI anti-lockout > Disable webGUI anti-lockout rule
By default, access to the webGUI on the LAN interface is always permitted, regardless of the user-defined filter rule set. Enable this feature to control webGUI access (make sure to have a filter rule in place that allows you in, or you will lock yourself out!).
Hint: the "set LAN IP address" option in the console menu resets this setting as well.
 
Traffic Shaper and Firewall Advanced
FTP Helper onclick="enable_change(false)"> Disable the userland FTP-Proxy application
FTP RFC 959 data port violation workaround onclick="enable_change(false)"> Workaround for sites that violate RFC 959 which specifies that the data connection be sourced from the command port - 1 (typically port 20). This workaround doesn't expose you to any extra risk as the firewall will still only allow connections on a port that the ftp-proxy is listening on.
Traffic Shaper Scheduler
Select which type of queueing you would like to use 0): ?>
NOTE: This option is disabled since there are queues defined.
Firewall Optimization Options
Select which type of state table optimization your would like to use
Disable Firewall onclick="enable_change(false)"> Disable the firewalls filter altogether.
NOTE! This basically converts pfSense into a routing only platform!
Firewall Maximum States
Maximum number of connections to hold in the firewall state table.
NOTE! Leave this blank for the default of 10000