Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Oct 2000 02:05:59 +0200
From:      Gerhard Sittig <Gerhard.Sittig@gmx.net>
To:        freebsd-stable@FreeBSD.ORG
Subject:   Re: ipf vs. ipfw ?
Message-ID:  <20001011020559.Y31338@speedy.gsinet>
In-Reply-To: <14819.8982.61823.868907@onceler.kciLink.com>; from khera@kciLink.com on Tue, Oct 10, 2000 at 10:09:26AM -0400
References:  <20001008224359.R31338@speedy.gsinet> <Pine.BSF.4.21.0010082235080.3908-100000@turtle.looksharp.net> <20001009193445.T31338@speedy.gsinet> <14819.8982.61823.868907@onceler.kciLink.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Oct 10, 2000 at 10:09 -0400, Vivek Khera wrote:
> >>>>> "GS" == Gerhard Sittig <Gerhard.Sittig@gmx.net> writes:
> 
> GS> same mechanism -- just with ipfw behind the pipe!  And these
> GS> substitutions maybe could get nested if needed like this:
> 
> GS>   REPEAT S1 $SRC : REPEAT S2 $DEST : pass ... from S1 to S2 ...
> 
> GS> if implemented in some intelligent way.  Has someone gotten
> GS> behind the stage of thinking about this and actually started
> GS> planning or implementing it?  I would be interested in different
> GS> thoughts.
> 
> ipfw lets you pre-process a file using any arbitrary pre-processor.
> It recommends cpp or m4, but who's to stop you from using perl?  Just
> make your FW rule file be a perl program and run it thusly:
> 
> ipfw -p /usr/bin/perl firewall.perl
> 
> and you're set.

That's exactly what I have now (150 lines of Perl code doing
loops and grouping and substitutions, etc).  But I have to admin
that I don't use ipfw -- I don't want to learn another syntax,
and I don't miss the dummy bandwidth limiter.  That's why I stick
with ipf (plus because I have machines around not running
FreeBSD).

> Just make sure that the output of your firewall.perl program is
> a valid set of firewall rules.  I guess the only trick would be
> figuring out how to pass flags to your program.

Not at all with the hooks I applied to /etc/rc.network. :)  And
one could even drive it to insanity with stacking shell code
(here document) and cpp and perl and whatever upon each other. :>

In case there's popular demand, I could post the 4KB script.
It's not tied to any filter language and not even to substituting
filter rules.  Although it's just a hack.  Anyone could do better
on their own, I guess.


virtually yours   82D1 9B9C 01DC 4FB4 D7B4  61BE 3F49 4F77 72DE DA76
Gerhard Sittig   true | mail -s "get gpg key" Gerhard.Sittig@gmx.net
-- 
     If you don't understand or are scared by any of the above
             ask your parents or an adult to help you.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001011020559.Y31338>