mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Add bogons update frequency selection
This commit is contained in:
parent
149ed85efb
commit
6b4480dc84
@ -194,6 +194,9 @@
|
||||
<disablelargereceiveoffloading/>
|
||||
<ipv6allow/>
|
||||
<powerd_mode>hadp</powerd_mode>
|
||||
<bogons>
|
||||
<interval>monthly</interval>
|
||||
</bogons>
|
||||
</system>
|
||||
<interfaces>
|
||||
<wan>
|
||||
|
||||
@ -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 -->
|
||||
|
||||
@ -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>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user