Introduction Tom Eastep 2004-01-26 2003-2004 Thomas M. Eastep Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover, and with no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License.
Introduction The information in this document applies only to 1.4.x releases of Shorewall.
Glossary Netfilter - the packet filter facility built into the 2.4 and later Linux kernels. ipchains - the packet filter facility built into the 2.2 Linux kernels. Also the name of the utility program used to configure and control that facility. Netfilter can be used in ipchains compatibility mode. iptables - the utility program used to configure and control Netfilter. The term iptables is often used to refer to the combination of iptables+Netfilter (with Netfilter not in ipchains compatibility mode).
What is Shorewall? The Shoreline Firewall, more commonly known as Shorewall, is high-level tool for configuring Netfilter. You describe your firewall/gateway requirements using entries in a set of configuration files. Shorewall reads those configuration files and with the help of the iptables utility, Shorewall configures Netfilter to match your requirements. Shorewall can be used on a dedicated firewall system, a multi-function gateway/router/server or on a standalone GNU/Linux system. Shorewall does not use Netfilter's ipchains compatibility mode and can thus take advantage of Netfilter's connection state tracking capabilities. Shorewall is not a daemon. Once Shorewall has configured Netfilter, it's job is complete although the /sbin/shorewall program can be used at any time to monitor the Netfilter firewall.
Getting Started with Shorewall New to Shorewall? Start by selecting the QuickStart Guide that most closely match your environment and follow the step by step instructions.
Looking for Information? The Documentation Index is a good place to start.
Shorewall Concepts The configuration files for Shorewall are contained in the directory /etc/shorewall -- for simple setups, you will only need to deal with a few of them. Shorewall views the network where it is running as being composed of a set of zones. In the three-interface sample configuration for example, the following zone names are used: NameDescriptionnetThe InternetlocYour Local NetworkdmzDemilitarized ZoneZones are defined in the /etc/shorewall/zones file. Shorewall also recognizes the firewall system as its own zone - by default, the firewall itself is known as fw. Rules about what traffic to allow and what traffic to deny are expressed in terms of zones. You express your default policy for connections from one zone to another zone in the /etc/shorewall/policy file.You define exceptions to those default policies in the /etc/shorewall/rules file.For each connection request entering the firewall, the request is first checked against the /etc/shorewall/rules file. If no rule in that file matches the connection request then the first policy in /etc/shorewall/policy that matches the request is applied. If that policy is REJECT or DROP the request is first checked against the rules in /etc/shorewall/common if that file exists; otherwise the rules in /etc/shorewall/common.def are checked. The /etc/shorewall/policy file included with the three-interface sample has the following policies: #SOURCE DEST POLICY LOG LEVEL LIMIT:BURST loc net ACCEPT net all DROP info all all REJECT infoIn the three-interface sample, the line below is included but commented out. If you want your firewall system to have full access to servers on the internet, uncomment that line. #SOURCE DEST POLICY LOG LEVEL LIMIT:BURST fw net ACCEPT The above policy will: Allow all connection requests from your local network to the internetDrop (ignore) all connection requests from the internet to your firewall or local networkOptionally accept all connection requests from the firewall to the internet (if you uncomment the additional policy)reject all other connection requests. The simplest way to define a zone is to associate the zone with a network interface using the /etc/shorewall/interfaces file. In the three-interface sample, the three zones are defined using that file as follows: #ZONE INTERFACE BROADCAST OPTIONS net eth0 detect dhcp,routefilter,norfc1918 loc eth1 detect dmz eth2 detect The above file defines the net zone as all hosts interfacing to the firewall through eth0, the loc zone as all hosts interfacing through eth1 and the dmz as all hosts interfacing through eth2.
License This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more detail. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA