This module will now work with FreeBSD's IPFW firewall too, although data counts may not be completely accurate as individual packet sizes are not logged. Instead, only the average packet size for each hour is available.
Firewall rules are now correctly created even when using Shorewall, by adding them to the /etc/shorewall/start file.
The module now also supports the IPFilter firewall, although counts may not be accurate on fast network interfaces, as IPFilter appears to not log all packets.
+---- Changes since 1.390 ----
+Bandwidth monitoring can now be setup on an interface that isn't currently active, including patterns like ppp+.
push(@ifaces, $i->{'fullname'}) if ($i->{'virtual'} eq '');
}
print &ui_select("iface", $config{'iface'},
- [ map { [ $_, $_ ] } &unique(@ifaces) ]);
+ [ (map { [ $_, $_ ] } &unique(@ifaces)),
+ [ '', $text{'index_other'} ] ],
+ 1, 0, $config{'iface'} ? 1 : 0)." ".
+ &ui_textbox("other", undef, 10);
print &ui_submit($text{'index_setup'});
print &ui_form_end();
print "<p>\n";
index_missing2=Several firewall rules must be added.
index_missing1=A syslog configuration entry must be created.
index_iface=External network interface
+index_other=Other..
index_setup=Setup Now
index_by=Show traffic by
index_hour=hour
turnoff_ecannot=You are not allowed to disable monitoring
setup_ecannot=You are not allowed to enable monitoring
+setup_eiface=Missing or invalid interface name
setup_ezone=Failed to fine Shorewall zone for the selected interface
system_firewall=IPtables
&ReadParse();
$access{'setup'} || &error($text{'setup_ecannot'});
+# Work out interface
+$iface = $in{'iface'} || $in{'other'};
+$iface =~ /^\S+$/ || &error($text{'setup_eiface'});
+
# Add missing firewall rules
-$err = &setup_rules($in{'iface'});
+$err = &setup_rules($iface);
&error($err) if ($err);
if ($syslog_module eq "syslog") {
# Save the interface
&lock_file($module_config_file);
-$config{'iface'} = $in{'iface'};
+$config{'iface'} = $iface;
&save_module_config();
&unlock_file($module_config_file);
&unlock_file(&cron::cron_file($job));
}
-&webmin_log("setup", undef, $in{'iface'});
+&webmin_log("setup", undef, $iface);
&redirect("");