2007-03-28 18:19:35 +02:00
|
|
|
Shorewall-perl 3.9.0
|
2007-03-24 18:16:13 +01:00
|
|
|
|
|
|
|
This companion product to Shorewall 3.4.2 and later includes a complete
|
|
|
|
rewrite of the compiler in Perl.
|
2007-03-24 01:52:30 +01:00
|
|
|
|
2007-03-28 18:19:35 +02:00
|
|
|
Shorewall-perl depends on Shorewall (3.4.2 or later). So if you want to use the
|
|
|
|
new compiler, you must install both Shorewall and Shorewall-perl.
|
2007-03-24 22:12:10 +01:00
|
|
|
|
2007-03-28 18:19:35 +02:00
|
|
|
Even if you install Shorewall-perl, you have a choice of which compiler you use.
|
2007-03-24 22:12:10 +01:00
|
|
|
The choice is specified in the shorewall.conf file so you can select the
|
|
|
|
compiler to use on a system-by-system basis when running Shorewall Lite on
|
|
|
|
remote systems.
|
|
|
|
|
2007-03-28 18:19:35 +02:00
|
|
|
I decided to make Shorewall-perl a separate product for several reasons:
|
2007-03-24 22:12:10 +01:00
|
|
|
|
2007-03-28 18:19:35 +02:00
|
|
|
a) Embedded applications are unlikely to adopt Shorewall-perl; even Mini-Perl
|
2007-03-24 22:12:10 +01:00
|
|
|
has a substantial disk and Ram footprint.
|
|
|
|
|
|
|
|
b) Because of the gross incompatibilities between the new compiler and the
|
|
|
|
old (see below), migration to the new compiler must be voluntary.
|
|
|
|
|
2007-03-28 18:19:35 +02:00
|
|
|
c) By allowing Shorewall-perl to co-exist with the current Shorewall stable
|
2007-03-24 22:12:10 +01:00
|
|
|
release (3.4), I'm hoping that the new compiler will get more testing and
|
|
|
|
validation than it would if I were to package it with a new development
|
|
|
|
version of Shorewall itself.
|
|
|
|
|
|
|
|
d) Along the same vein, I think that users will be more likely to experiment
|
|
|
|
with the new compiler if they can easily fall back to the old one if things
|
|
|
|
get sticky.
|
2007-03-24 01:52:30 +01:00
|
|
|
|
|
|
|
The good news:
|
|
|
|
|
|
|
|
a) The compiler is small.
|
|
|
|
b) The compiler is very fast.
|
|
|
|
c) The compiler generates a firewall script that uses iptables-restore;
|
|
|
|
so the script is very fast.
|
2007-03-24 16:59:17 +01:00
|
|
|
d) Use of the perl compiler is optional! The old slow clunky
|
2007-03-24 18:16:13 +01:00
|
|
|
Bourne-shell compiler is still available.
|
2007-03-24 01:52:30 +01:00
|
|
|
|
|
|
|
The bad news:
|
|
|
|
|
2007-03-24 18:16:13 +01:00
|
|
|
There are a number of incompatibilities between the Perl-based compiler
|
2007-03-28 19:43:09 +02:00
|
|
|
and the Bourne-shell one. Some of these will probably go away by first
|
|
|
|
official release but some will not.
|
2007-03-24 01:52:30 +01:00
|
|
|
|
2007-03-24 18:16:13 +01:00
|
|
|
a) The Perl-based compiler requires the following capabilities in your
|
|
|
|
kernel and iptables.
|
2007-03-24 01:52:30 +01:00
|
|
|
|
2007-03-28 19:43:09 +02:00
|
|
|
- addrtype match (may be relaxed later)
|
|
|
|
- multiport match (will not be relaxed)
|
2007-03-24 16:59:17 +01:00
|
|
|
|
|
|
|
These capabilities are in current distributions.
|
|
|
|
|
2007-03-26 22:46:38 +02:00
|
|
|
b) The Bourne-shell compiler goes to great pain (in some cases) to
|
2007-03-26 22:23:09 +02:00
|
|
|
break very long port lists ( > 15 where port ranges in lists count
|
2007-03-28 19:43:09 +02:00
|
|
|
as two ports) into individual rules. In the new compiler, I'm
|
|
|
|
avoiding the ugliness required to do that. The new compiler just
|
|
|
|
gives you an error if your list is too long. It will also give you
|
|
|
|
an error if you insert a port range into a port list and you don't
|
|
|
|
have extended multiport support. Now that Netfilter has features to
|
|
|
|
deal reasonably with port lists, I see no reason to duplicate those
|
|
|
|
features in Shorewall.
|
2007-03-26 22:23:09 +02:00
|
|
|
|
2007-03-26 22:46:38 +02:00
|
|
|
c) BRIDGING=Yes is not supported. The kernel code necessary to
|
2007-03-24 16:59:17 +01:00
|
|
|
support this option was removed in Linux kernel 2.6.20.
|
|
|
|
|
2007-03-26 22:46:38 +02:00
|
|
|
d) The BROADCAST column in the interfaces file is essentailly unused;
|
2007-03-24 01:52:30 +01:00
|
|
|
if you enter anything in this column but '-' or 'detect', you will
|
2007-03-28 19:43:09 +02:00
|
|
|
receive a warning. This will be relaxed if and when the addrtype
|
|
|
|
match requirement is relaxed.
|
2007-03-24 01:52:30 +01:00
|
|
|
|
2007-03-26 22:46:38 +02:00
|
|
|
e) Because the compiler is now written in Perl, your compile-time
|
2007-03-24 18:16:13 +01:00
|
|
|
extension scripts from earlier versions will no longer work.
|
2007-03-24 01:52:30 +01:00
|
|
|
|
2007-03-26 22:46:38 +02:00
|
|
|
f) The 'refresh' command is now synonamous with 'restart'.
|
2007-03-24 01:52:30 +01:00
|
|
|
|
2007-03-26 22:46:38 +02:00
|
|
|
g) Some run-time extension scripts are no longer supported because they
|
2007-03-24 01:52:30 +01:00
|
|
|
make no sense (iptables-restore instantiates the new configuration
|
|
|
|
atomically).
|
|
|
|
|
|
|
|
continue
|
|
|
|
initdone
|
|
|
|
continue
|
|
|
|
refresh
|
|
|
|
refreshed
|
|
|
|
|
2007-03-28 19:43:09 +02:00
|
|
|
h) The /etc/shorewall/tos file now has zone-independent SOURCE and DEST
|
|
|
|
columns as do all other files except the rules and policy files.
|
2007-03-25 21:43:33 +02:00
|
|
|
|
|
|
|
The SOURCE column may be one of the following:
|
|
|
|
|
|
|
|
[all:]<address>[,...]
|
|
|
|
[all:]<interface>[:<address>[,...]]
|
|
|
|
$FW[:<address>[,...]]
|
|
|
|
|
|
|
|
The DEST column may be one of the following:
|
|
|
|
[all:]<address>[,...]
|
|
|
|
[all:]<interface>[:<address>[,...]]
|
|
|
|
|
2007-03-28 19:43:09 +02:00
|
|
|
This is a perminent change. The old zone-based rules have never
|
|
|
|
worked right and this is a good time to replace them. I've tried to
|
|
|
|
make the new syntax cover the most common cases without requiring
|
|
|
|
change to existing files. In particular, it will handle the tos file
|
|
|
|
released with Shorewall 1.4 and earlier.
|
|
|
|
|
2007-03-26 22:46:38 +02:00
|
|
|
i) Currently, support for ipsets is untested. That will change with
|
2007-03-24 16:59:17 +01:00
|
|
|
future releases but one thing is certain -- Shorewall is now out of the
|
2007-03-26 22:46:38 +02:00
|
|
|
ipset load/reload business. With scripts generated by the Perl-based
|
|
|
|
Compiler, the Netfilter ruleset is never cleared. That means that
|
|
|
|
there is no opportunity for Shorewall to load/reload your ipsets
|
|
|
|
since that cannot be done while there are any current rules using
|
|
|
|
your ipsets.
|
2007-03-24 01:52:30 +01:00
|
|
|
|
|
|
|
So:
|
|
|
|
|
|
|
|
i) Your ipsets must be loaded before Shorewall starts.
|
|
|
|
|
|
|
|
ii) Your ipsets may not be reloaded until Shorewall is stopped or
|
|
|
|
cleared.
|
|
|
|
|
|
|
|
iii) If you specify ipsets in your routestopped file then
|
|
|
|
Shorewall must be cleared in order to reload your ipsets.
|
|
|
|
|
2007-03-24 18:16:13 +01:00
|
|
|
As a consequence, scripts generated by the Perl-based compiler will
|
|
|
|
ignore /etc/shorewall/ipsets and will issue a warning if you set
|
|
|
|
SAVE_IPSETS=Yes in shorewall.conf.
|
|
|
|
|
|
|
|
Installation
|
|
|
|
------------
|
|
|
|
|
2007-03-26 22:46:38 +02:00
|
|
|
Either
|
2007-03-24 18:16:13 +01:00
|
|
|
|
2007-03-28 18:19:35 +02:00
|
|
|
$ tar -jxf shorewall-perl-3.9.0.tar.bz2
|
|
|
|
$ cd shorewall-perl-3.9.0
|
2007-03-26 22:46:38 +02:00
|
|
|
$ ./install.sh
|
2007-03-24 18:16:13 +01:00
|
|
|
|
2007-03-26 22:46:38 +02:00
|
|
|
or
|
2007-03-24 18:16:13 +01:00
|
|
|
|
2007-03-26 22:46:38 +02:00
|
|
|
$ rpm -ivh shoreawll-pl-3.9.0-1.noarch.rpm
|
2007-03-24 01:52:30 +01:00
|
|
|
|
2007-03-24 18:16:13 +01:00
|
|
|
Using the New compiler
|
|
|
|
----------------------
|
2007-03-24 01:52:30 +01:00
|
|
|
|
2007-03-24 18:16:13 +01:00
|
|
|
By default, the old Bourne-shell based compiler will be used.
|
2007-03-24 01:52:30 +01:00
|
|
|
|
2007-03-28 19:43:09 +02:00
|
|
|
To use the new compiler, add this to shorewall.conf:
|
2007-03-24 01:52:30 +01:00
|
|
|
|
2007-03-28 19:43:09 +02:00
|
|
|
SHOREWALL_COMPILER=perl
|
2007-03-24 01:52:30 +01:00
|
|
|
|
2007-03-24 18:16:13 +01:00
|
|
|
If you add this setting to /etc/shorewall/shorewall.conf then by
|
|
|
|
default, the new compiler will be used on the system. If you add it to
|
|
|
|
shorewall.conf in a separate directory (such as a Shorewall-lite export
|
|
|
|
directory) then the new compiler will only be used when you compile
|
|
|
|
from that directory.
|
2007-03-28 19:43:09 +02:00
|
|
|
|
|
|
|
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 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 it's use be
|
|
|
|
specified in shorewall.conf.
|
|
|
|
|