Edit Firewall

Getting Started
Firewall Wizard
New Rule
Default Policy
Manage Chains
Setup Interfaces
Install Firewall
Uninstall Firewall



Getting Started

There are three ways to create a firewall with fBuilder: The Firewall Wizard, one rule at a time with the New Rule option, or a combination of both. The most common way is to use the combination of both. With the wizard, you can create your basic firewall configuration and then fill in your more complex rules with the New Rule option. Also, you can insert a rule at any point in the chain by using the Insert function or edit and delete any of the rules in the chains by using the edit function (both are located on the View Options >> View Firewall screen). This makes for a very flexible design that is easy enough for the novice and powerful enough for the seasoned firewall administrator. Also, as mentioned in the introduction, fBuilder works directly with the rules in memory. When you insert, edit, or delete a rule through the fBuilder interface, there is no need to save and reinstall the firewall because the change takes place as soon as you click the submit button.

All of the options listed here are explained in much greater detail later in this document and in the View Options document.


The Wizard

Using the wizard is pretty straight forward, just click on the 'Edit Firewall>>Firewall Wizard' link and answer a few basic questions about your network. The wizard will then create an iptables script based on the information you provided. The firewall that the wizard creates sets all default policies to DENY and opens specific holes (based on your choices) to allow incoming traffic from the Internet and from your internal network.

The first screen in the wizard asks for the Network Interface information. fBuilder's auto-discovery routines should fill this screen in for you. You should confirm that the settings are correct before continuing to the next screen. You will see the following screens: If you chose to enter DMZ information when setting up your interfaces, you will also see that information on the screen above. Also, please note that this screen asks for NETWORK addresses, NOT the ip address of your NIC. If you are unsure of your network address, you can assume that fBuilder has the correct information filled in for you.

The second screen in the wizard is for choosing your incoming and outgoing services. The services listed in the boxes come directly from the /etc/services file on your system. To add/delete a service, edit your /etc/services file and make the addition or deletion. To add the services which will be allowed access through your firewall choose a service from the left window and move it to the right window by highlighting the service you would like moved and clicking on the direction arrow. You can remove services from the right side using the same technique. Remember, in iptables, this information controls what will be allowed in and out of the firewall host machine itself. To learn more about the difference between INPUT (Incoming), OUTPUT (Outgoing), and FORWARD chains, take a look at the iptables section in 'The Basics' section of this documentation.

The third screen is for choosing DNS, ICMP and logging options. By checking the box you are enabling that particular service/protocol. You should note that by logging all packets that your /var/log/messages file will grow very fast. For this reason, we recommend logging only denied packets

At this point you are given the option to choose whether or not to setup IP masquerade / forwarding services. If you say no to this question (or ignore this question) you will be finished using the wizard and your firewall will be created. If you answer yes to this question you will be brought to a screen exactly like the service chooser screen mentioned above. Here you can choose which services your internal network may access. Note: If your firewall is acting as a router (providing services for an internal network) you will want to set up forwarding services. If this is a stand alone machine (Like a desktop or Webserver) you will say no to forwarding services.

After your firewall is created you can install with the 'Install' link at the bottom of the script or with the 'Edit Firewall>>Install Firewall' option. Once your firewall is installed you can view your rule set with the 'View Options>>View Firewall' option and make any necessary changes using the New Rule, edit/delete, or insert capabilities.

The Firewall Wizard saves the settings chose the last time you ran the Wizard. This can be convenient to make modifications to an existing Wizard created firewall. If you make changes using Insert, Edit, or New Rule, your changes will be lost if you choose to run the Wizard again.


New Rule

The New Rule function allows you to create new firewall rules one by one. Each rule will be inserted at the end of the chain specified. If you would like to insert a rule in the middle of a chain, please view the 'Insert' option in the 'View Options' documentation. Please note that when using this method for creating your firewall, you will also need to use the 'Default Policy' option to set the default policy for the INPUT, OUTPUT and FORWARD chains. If you created your firewall through the Wizard, you will not have to worry about setting the default policy as the Wizard does this for you.

The New Rule function is for system administrators who are experienced in building Linux firewalls or for those that want to customize their Linux firewall. The New Rule function works much like the command line in that you can invert a particular option by clicking the exclamation point next to the option you wish to invert, create limits, use custom protocols and user defined chains, state checking (connection tracking), etc.

Here we will list all of the choices found on the New Rule screen and what each one does: When you click the 'Add New Rule' button, your change takes place immediately. The rule is appended to the end of the chain that you specified in the 'Rule Type' option. If an error occurs, you will be prompted with the error that was produced by iptables to help you diagnose the problem.


Default Policy

The Default Policy function will enable you to set the default policies for the INPUT, OUTPUT, and FORWARD chains. As with all fBuilder functions, the policy change takes place immediately after hitting the 'Set Net Policy' button. If you created the firewall with the 'Firewall Wizard', your polices will be set to 'DROP'. This is the most secure method as it says 'That which is not explicitly allowed is Dropped'. For troubleshooting reasons, you may want to change these settings temporarily to ACCEPT to see if the desired traffic is allowed through. If it is, then you know that your firewall is blocking the traffic that you are troubleshooting. Remember: Change the setting back to DROP after you have finished troubleshooting the issue.


Manage Chains

The Manage Chains function allows you to create and delete user defined chains in your firewall. To create a new User defined chain, you can type the name in the text area labeled 'Add User Defined Chain' and click 'Add'. Your chain is immediately added to the firewall and you will see it added to the upper section labeled 'Existing User Defined Chains'. To delete a chain, you can put a check next to the name of the chain and click 'Delete'. If there are rules in the chain, fBuilder will give you the option to flush the chain before deleting. You can check both boxes for the chain and click delete again. If there is a reference to that chain somewhere in one of your other chains, iptables will not allow you to delete it until the reference is gone. You will have to find the rule in the 'View Firewall' screen and delete it by clicking the 'Edit' button and then 'Delete' once you are in the edit function. Once all references are removed, fBuilder will allow you to delete the user defined chain.


Setup Interfaces

On your first run of fBuilder, you will be prompted to 'Set Up Interfaces' if a .interfaces file is not found. This is so that fBuilder will know what interface is facing the external network and which is facing the internal network. If this machine only has one interface (for example a desktop machine or a stand alone server) you will put the same interface name in both the External Interface and the Internal Interface. The DMZ interface should be set to NONE unless you have three NIC's and intend on having one of them be a DMZ. To assist in understanding External and Internal, you can think of it as External points to the Internet and Internal points to the private network.


Install Firewall

By clicking 'Install Firewall', fBuilder will install the firewall that is saved in the fw-init script. This script is created by the 'Firewall Wizard' and updated every time you click 'Save Firewall' from the 'View Firewall' screen. The fw-init script is fBuilder dependant and is not the script that you will run at boot time. The boot time firewall is the rc.firewall script that you can Export from the 'View Firewall' screen. Remember to save the firewall, then click 'View Firewall' and then "Export to rc.firewall' so your changes are in both places. Remember, you do not need to click 'Install Firewall; after saving because all changes with fBuilder are happening in real time. Saving the firewall just allows you to start it again in the future after you 'Uninstall Firewall' or Reboot. rc.firewall can be added to your start up scripts so you don't have to do this manually every time. For more information on how to make fBuilder start at boot time, please see the section called 'Boot time' in the 'Other' section of this documentation.


Uninstall Firewall

Uninstall Firewall will set all Default Policies to ACCEPT and then flush your chains. This will allow all traffic to be allowed.