Firewall FreeBSD webmin module

The firewall-fbsd plugin for webmin allows you to manage the firewall rules of the kernel firewall of FreeBSD. As webmin uses the network to access the computer running the firewall, this module has a smart feature that will prevent you from locking yourself out of webmin with the firewall. Changing the firewall rules is a four step process:

  1. Modify existing rules or add new ones.
  2. Next a check is done for obvious typos.
  3. Then the rules are loaded into the firewall, checking for any error. If an error occurs the previous set of rules is reloaded into the firewall.
  4. Last you have to press a "confirmation" button on a page that is presented after the rules are loaded. If you do not click the confirmation button within the timeout (because you did not see this page because of a lockout!) the previous rules will also be reloaded into the firewall. Just refreshing your browser after the timeout should give you the screen with the rules as they were before.

Here is a screenshot of the main screen.

Operating systems supported

This module only supports versions of FreeBSD running the second version of the firewall (IPFW2). IPFW2 is standard under FreeBSD 5.x, but can be compiled into FreeBSD 4.8 with IPFW2 option in the kernel config. (Do not forget to compile a new version if the ipfw configuration utility that supports the IPFW2 firewall). 

Usage

First modify or add new rules on the first screen. If you need to add more than four rules in one go you can increase the number of add boxes in the module config page. 

After pressing the "Verify rules" button the rules are basically checked for obvious errors. If no errors are found, the "Load Rules" button will start the configuration. First the old rules are saved in a temporary file, then the new rules are loaded one by one into the firewall. The firewall is flushed of all rules before the load. If any error is detected during this load, the saved rules are restored.

If all rules were loaded successfully, the confirmation page is shown. You need to click on the confirm button before the time-out for the new rules to "stick" in your firewall. If you do not click this button in time, maybe because you did not see the page at all, the saved rules are also reloaded.

Languages

Currently the module supports English and Dutch.

Installation

Go to the add modules page of webmin, and paste the download URL into the add module box.