diff options
author | Chris Buechler <cmb@pfsense.org> | 2013-01-08 01:58:07 -0800 |
---|---|---|
committer | Chris Buechler <cmb@pfsense.org> | 2013-01-08 01:58:07 -0800 |
commit | 3042761accdea0982089fe879ced13b3458694c2 (patch) | |
tree | 6e66dcaf3ba043929f16aa950a2889de2e92a0cf /usr/local | |
parent | 1b0074d5d139e71e1540230c3d2e36d71ccaf550 (diff) | |
parent | 3cde94cff2077122a3455bacbefaf295211183b3 (diff) | |
download | pfsense-3042761accdea0982089fe879ced13b3458694c2.zip pfsense-3042761accdea0982089fe879ced13b3458694c2.tar.gz |
Merge pull request #310 from bcyrill/bogons_patch1
Allow changing of bogons update frequency
Diffstat (limited to 'usr/local')
-rwxr-xr-x | usr/local/www/interfaces.php | 2 | ||||
-rw-r--r-- | usr/local/www/system_advanced_firewall.php | 35 |
2 files changed, 37 insertions, 0 deletions
diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php index 7d14829..c4c127b 100755 --- a/usr/local/www/interfaces.php +++ b/usr/local/www/interfaces.php @@ -2619,6 +2619,8 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"), "(but not RFC 1918) or not yet assigned by IANA."); ?> <?=gettext("Bogons are prefixes that should never appear in the Internet routing table, " . "and obviously should not appear as the source address in any packets you receive."); ?> + <br/><br/> + <?=gettext("Note: The update frequency can be changed under System->Advanced Firewall/NAT settings.")?> </td> </tr> </table> <!-- End "allcfg" table --> diff --git a/usr/local/www/system_advanced_firewall.php b/usr/local/www/system_advanced_firewall.php index db0aaa4..e65581e 100644 --- a/usr/local/www/system_advanced_firewall.php +++ b/usr/local/www/system_advanced_firewall.php @@ -59,6 +59,7 @@ $pconfig['maximumtables'] = $config['system']['maximumtables']; $pconfig['maximumtableentries'] = $config['system']['maximumtableentries']; $pconfig['disablereplyto'] = isset($config['system']['disablereplyto']); $pconfig['disablenegate'] = isset($config['system']['disablenegate']); +$pconfig['bogonsinterval'] = $config['system']['bogons']['interval']; $pconfig['disablenatreflection'] = $config['system']['disablenatreflection']; $pconfig['enablebinatreflection'] = $config['system']['enablebinatreflection']; $pconfig['reflectiontimeout'] = $config['system']['reflectiontimeout']; @@ -170,6 +171,22 @@ if ($_POST) { $config['system']['tftpinterface'] = implode(",", $_POST['tftpinterface']); else unset($config['system']['tftpinterface']); + + if ($_POST['bogonsinterval'] != $config['system']['bogons']['interval']) { + switch ($_POST['bogonsinterval']) { + case 'daily': + install_cron_job("/usr/bin/nice -n20 /etc/rc.update_bogons.sh", true, "1", "3", "*", "*", "*"); + break; + case 'weekly': + install_cron_job("/usr/bin/nice -n20 /etc/rc.update_bogons.sh", true, "1", "3", "*", "*", "1"); + break; + case 'monthly': + // fall through + default: + install_cron_job("/usr/bin/nice -n20 /etc/rc.update_bogons.sh", true, "1", "3", "1", "*", "*"); + } + $config['system']['bogons']['interval'] = $_POST['bogonsinterval']; + } write_config(); @@ -392,6 +409,24 @@ function update_description(itemnum) { <tr> <td colspan="2" class="list" height="12"> </td> </tr> + <tr> + <td colspan="2" valign="top" class="listtopic"><?=gettext("Bogon Networks");?></td> + </tr> + <tr> + <td width="22%" valign="top" class="vncell"><?=gettext("Update Frequency");?></td> + <td width="78%" class="vtable"> + <select name="bogonsinterval" class="formselect"> + <option value="monthly" <?php if (empty($pconfig['bogonsinterval']) || $pconfig['bogonsinterval'] == 'monthly') echo "selected"; ?>><?=gettext("Monthly"); ?></option> + <option value="weekly" <?php if ($pconfig['bogonsinterval'] == 'weekly') echo "selected"; ?>><?=gettext("Weekly"); ?></option> + <option value="daily" <?php if ($pconfig['bogonsinterval'] == 'daily') echo "selected"; ?>><?=gettext("Daily"); ?></option> + </select> + <br/> + <?=gettext("The frequency of updating the lists of IP addresses that are reserved (but not RFC 1918) or not yet assigned by IANA.");?> + </td> + </tr> + <tr> + <td colspan="2" class="list" height="12"> </td> + </tr> <?php if(count($config['interfaces']) > 1): ?> <tr> <td colspan="2" valign="top" class="listtopic"><?=gettext("Network Address Translation");?></td> |