2007-04-13 01:04:36 +02:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
|
|
|
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
|
|
|
<article>
|
|
|
|
<!--$Id$-->
|
|
|
|
|
|
|
|
<articleinfo>
|
|
|
|
<title>Shorewall Version 4</title>
|
|
|
|
|
|
|
|
<authorgroup>
|
|
|
|
<author>
|
|
|
|
<firstname>Tom</firstname>
|
|
|
|
|
|
|
|
<surname>Eastep</surname>
|
|
|
|
</author>
|
|
|
|
</authorgroup>
|
|
|
|
|
|
|
|
<pubdate><?dbtimestamp format="Y/m/d"?></pubdate>
|
|
|
|
|
|
|
|
<copyright>
|
|
|
|
<year>2007</year>
|
|
|
|
|
|
|
|
<holder>Thomas M. Eastep</holder>
|
|
|
|
</copyright>
|
|
|
|
|
|
|
|
<legalnotice>
|
|
|
|
<para>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
|
|
|
|
<quote><ulink url="GnuCopyright.htm">GNU Free Documentation
|
|
|
|
License</ulink></quote>.</para>
|
|
|
|
</legalnotice>
|
|
|
|
</articleinfo>
|
|
|
|
|
2007-06-29 00:06:10 +02:00
|
|
|
<section id="Intro">
|
2007-04-13 01:04:36 +02:00
|
|
|
<title>Introduction</title>
|
|
|
|
|
|
|
|
<para>Shorewall version 4 is currently in development and is available for
|
2007-05-19 16:41:19 +02:00
|
|
|
beta testing.</para>
|
2007-04-13 01:04:36 +02:00
|
|
|
|
|
|
|
<para>Shorewall version 4 represents a substantial shift in direction for
|
|
|
|
Shorewall. Up to now</para>
|
|
|
|
|
|
|
|
<itemizedlist>
|
|
|
|
<listitem>
|
|
|
|
<para>Shorewall has been written entirely in Bourne Shell.</para>
|
|
|
|
</listitem>
|
|
|
|
|
|
|
|
<listitem>
|
2007-06-25 22:30:11 +02:00
|
|
|
<para>Shorewall has run the <command>iptables</command> utility to add
|
2007-04-13 01:04:36 +02:00
|
|
|
each Netfilter rule.</para>
|
|
|
|
</listitem>
|
|
|
|
</itemizedlist>
|
|
|
|
|
2007-04-25 00:53:50 +02:00
|
|
|
<para>Shorewall version 4 offers you a choice. You can continue to use the
|
|
|
|
existing shell-based implementation or you can use a new implementation of
|
|
|
|
the Shorewall compiler written in the Perl programming language. The new
|
|
|
|
compiler:</para>
|
2007-04-13 01:04:36 +02:00
|
|
|
|
|
|
|
<itemizedlist>
|
|
|
|
<listitem>
|
|
|
|
<para>has a small disk footprint</para>
|
|
|
|
</listitem>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>is very fast.</para>
|
|
|
|
</listitem>
|
|
|
|
|
|
|
|
<listitem>
|
2007-04-13 01:10:18 +02:00
|
|
|
<para>generates a firewall script that uses
|
|
|
|
<command>iptables-restore</command>; so the script is very
|
|
|
|
fast.</para>
|
2007-04-13 01:04:36 +02:00
|
|
|
</listitem>
|
2007-06-25 22:30:11 +02:00
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>generates better and more consistent error messages.</para>
|
|
|
|
</listitem>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>does a much more thorough job of checking the configuration to
|
|
|
|
avoid run-time errors.</para>
|
|
|
|
</listitem>
|
2007-04-13 01:04:36 +02:00
|
|
|
</itemizedlist>
|
|
|
|
|
|
|
|
<para>Both compilers may be installed on your system and you can use
|
|
|
|
whichever one suits you in a particular case.</para>
|
|
|
|
</section>
|
|
|
|
|
2007-06-29 00:06:10 +02:00
|
|
|
<section id="Install">
|
2007-04-13 01:04:36 +02:00
|
|
|
<title>Installing Shorewall Version 4</title>
|
|
|
|
|
|
|
|
<para>You can download the development version of Shorewall Version 4 from
|
|
|
|
any of the download sites with the exception of SourceForge. It is
|
|
|
|
contained in the <filename
|
2007-05-19 16:41:19 +02:00
|
|
|
class="directory">/pub/shorewall/development/4.0</filename>
|
2007-04-13 01:04:36 +02:00
|
|
|
directory.</para>
|
|
|
|
|
|
|
|
<para>Shorewall 4 contains four packages:</para>
|
|
|
|
|
|
|
|
<itemizedlist>
|
|
|
|
<listitem>
|
|
|
|
<para>Shorewall-shell - the old shell-based compiler and related
|
|
|
|
components.</para>
|
|
|
|
</listitem>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>Shorewall-perl - the new Perl-based compiler. May be installed
|
2007-05-19 16:41:19 +02:00
|
|
|
under Shorewall 3.4.2 or later or 4.0.x.</para>
|
2007-04-13 01:04:36 +02:00
|
|
|
</listitem>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>Shorewall - the part of Shorewall common to both
|
|
|
|
compilers.</para>
|
|
|
|
</listitem>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>Shorewall-lite- same as the 3.4 version of Shorewall Lite. Can
|
|
|
|
run scripts generated by either Shorewall-perl or
|
|
|
|
Shorewall-shell.</para>
|
|
|
|
</listitem>
|
|
|
|
</itemizedlist>
|
|
|
|
|
|
|
|
<para>If you upgrade to Shorewall Version 4, you must install
|
|
|
|
Shorewall-shell and/or Shorewall-perl; in fact, if you are using the
|
|
|
|
tarball for your installation, you must install Shorewall-shell and/or
|
|
|
|
Shorewall-perl <emphasis role="bold">before</emphasis> you upgrade
|
|
|
|
Shorewall.</para>
|
|
|
|
</section>
|
|
|
|
|
2007-06-29 00:06:10 +02:00
|
|
|
<section id="Prereqs">
|
2007-04-13 01:45:46 +02:00
|
|
|
<title>Prerequisites for using the Shorewall Version 4 Perl-based
|
|
|
|
Compiler</title>
|
|
|
|
|
|
|
|
<itemizedlist>
|
|
|
|
<listitem>
|
|
|
|
<para>Perl (I use Perl 5.8.8 but other versions should work
|
|
|
|
fine)</para>
|
|
|
|
</listitem>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>Perl Cwd Module</para>
|
|
|
|
</listitem>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>Perl File::Basename Module</para>
|
|
|
|
</listitem>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>Perl File::Temp Module</para>
|
|
|
|
</listitem>
|
2007-06-23 19:08:26 +02:00
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>Perl Getopt::Long Module</para>
|
|
|
|
</listitem>
|
2007-06-25 22:11:24 +02:00
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>Perl Carp Module</para>
|
|
|
|
</listitem>
|
2007-04-13 01:45:46 +02:00
|
|
|
</itemizedlist>
|
|
|
|
</section>
|
|
|
|
|
2007-06-29 00:06:10 +02:00
|
|
|
<section id="Incompatibilities">
|
2007-04-13 01:04:36 +02:00
|
|
|
<title>Incompatibilities Introduced in the Shorewall Version 4 Perl-based
|
|
|
|
Compiler</title>
|
|
|
|
|
|
|
|
<para>The Shorewall-perl compiler is not 100% compatible with the
|
2007-06-25 22:30:11 +02:00
|
|
|
Shorewall-shell version. See <ulink url="Shorewall-perl.html">this
|
|
|
|
document</ulink> for details.</para>
|
2007-04-13 01:04:36 +02:00
|
|
|
</section>
|
|
|
|
|
2007-06-29 00:06:10 +02:00
|
|
|
<section id="CompilerSelection">
|
2007-04-13 01:04:36 +02:00
|
|
|
<title>Compiler Selection</title>
|
|
|
|
|
|
|
|
<para>If you only install one compiler, then that compiler will be
|
|
|
|
used.</para>
|
|
|
|
|
|
|
|
<para>If you install both compilers, then the compiler actually used
|
|
|
|
depends on the SHOREWALL_COMPILER setting in
|
2007-05-19 16:41:19 +02:00
|
|
|
<filename>shorewall.conf</filename>.</para>
|
2007-04-13 01:04:36 +02:00
|
|
|
|
2007-05-19 16:41:19 +02:00
|
|
|
<para>The value of this new option can be either 'perl' or 'shell'.</para>
|
|
|
|
|
|
|
|
<para>If you add 'SHOREWALL_COMPILER=perl' to
|
2007-04-13 01:04:36 +02:00
|
|
|
<filename>/etc/shorewall/shorewall.conf</filename> then by default, the
|
|
|
|
new compiler will be used on the system. If you add it to
|
|
|
|
<filename>shorewall.conf</filename> in a separate directory (such as a
|
|
|
|
Shorewall-lite export directory) then the new compiler will only be used
|
2007-05-19 16:41:19 +02:00
|
|
|
when you compile from that directory.</para>
|
|
|
|
|
|
|
|
<para>If you only install one compiler, it is suggested that you do not
|
|
|
|
set SHOREWALL_COMPILER.</para>
|
|
|
|
|
|
|
|
<para>You can select the compiler to use on the command line using the 'C
|
|
|
|
option:<simplelist>
|
|
|
|
<member>'-C shell' means use the shell compiler</member>
|
|
|
|
|
|
|
|
<member>'-C perl' means use the perl compiler</member>
|
|
|
|
</simplelist>The -C option overrides the setting in
|
|
|
|
shorewall.conf.</para>
|
|
|
|
|
|
|
|
<para>Example:<programlisting><command>shorewall restart -C perl</command></programlisting>Regardless
|
|
|
|
of the setting of SHOREWALL_COMPILER, there is one change in Shorewall
|
|
|
|
operation that is triggered simply by installing shorewall-perl. Your
|
|
|
|
params file will be processed during compilation with the shell's '-a'
|
|
|
|
option which causes any variables that you set or create in that file to
|
|
|
|
be automatically exported. Since the params file is processed before
|
|
|
|
shorewall.conf, using -a insures that the settings of your params
|
|
|
|
variables are available to the new compiler should its use be specified in
|
|
|
|
shorewall.conf.</para>
|
2007-04-13 01:04:36 +02:00
|
|
|
</section>
|
|
|
|
</article>
|