🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: be.comp.security
Article #1759

Re: firewall with ipfw and natd

#1759
From: Ish
Date: Tue, 07 Aug 2001 20:27
61 lines
3770 bytes
Mmmmm... still not clear what I'm doing wrong... sorry...

<shikahr-usenet@[10.0.0.1]> wrote in message
news:shikahr-usenet-997210205@[10.0.0.1]...
> In <GuNb7.123$gX2.27571@afrodite.telenet-ops.be>,
> Ish wrote:
>
>
> > I wrote some firewall-rules under FreeBSD 3.5.1 and most of them are
quite
> > working...
> > Having a little local network (192.xxx.xxx.0), surfing tru my BSD with 2
> > nic's,
> > one connected to The Net (rl1), one to the local net (rl0).
> >
> > LOCALNET ------> rl0 ------> rl1 -------> INTERNET
>
> # make the rules understandable by interface
> # what you want to do differs by where the packet is and where
> # it is going
>
> #  ipfw add 150 count log all from any to any # see whats happening
>
>    ipfw add 200 skipto 1000 all from any to any via rl0
>    ipfw add 300 skipto 2000 all from any to any via rl1
>    ipfw add 400 deny log all from any to any   # just in case
>
> # rules for the localnet
> # no particular rules here in this example
>    ipfw add 1100 allow all from localnet to any in
>    ipfw add 1200 allow all from any to localnet out
>    ipfw add 1300 deny log all from any to any # just in case
>
> # rules for the internet
>    ipfw add 2100 skipto 3000 all from any to any in
>    ipfw add 2200 skipto 4000 all from any to any out
>    ipfw add 2300 deny log all from any to any # just in case
>
> # packets coming in from the internet
>    ipfw add 3100 deny log all from localnet to any # no spoofing
>    ipfw add 3200 deny log all from 127.0.0.0/8 to any # no spoofing
>    ipfw add 3300 skipto 5000 all from any to any
>    ipfw add 3400 deny log all from any to any # just because
>
> # packets going out to the internet
>    ipfw add 4100 skipto 5000 all from localnet to any # natd these
>    ipfw add 4200 allow all from rl1-IP to any # un-natd stuff
>    ipfw add 4300 deny log all from any to any # just because
>
> # nat translation - only 1 divert rule allowed/works (see man page)
> # that why the various skipto rules all converge here
>
>    ipfw add 5100 divert natd all from any to any
>    ipfw add 5200 allow all from rl1-IP to any out
>    ipfw add 5300 allow all from any to localnet in
>
> The setup for natd and ipfw is not the most straightforward thing,
> especially is you have some kind of server on the natd machine
> that is not supposed to be translated. You have to intercept those
> packets and accept them directly, without translatation.
>
Technical Details
Message-ID: <5bYb7.1334$gX2.325343@afrodite.telenet-ops.be>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!ossa.telenet-ops.be!afrodite.telenet-ops.be.POSTED!not-for-mail
References: <GuNb7.123$gX2.27571@afrodite.telenet-ops.be> <shikahr-usenet-997210205@[10.0.0.1]>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f922c,27de0af21f29d3af
X-Google-Attributes: gidf922c,public
X-Google-Thread: 113446,27de0af21f29d3af
X-Google-Attributes: gid113446,public
X-Google-Thread: 10eb3b,27de0af21f29d3af
X-Google-Attributes: gid10eb3b,public
X-Google-ArrivalTime: 2001-08-07 13:27:50 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!ossa.telenet-ops.be!afrodite.telenet-ops.be.POSTED!not-for-mail
From: "Ish" <keeos@crosswinds_NOSPAM_.net>
Newsgroups: be.comp.security,comp.security.firewalls,comp.unix.bsd.freebsd.misc
References: <GuNb7.123$gX2.27571@afrodite.telenet-ops.be> <shikahr-usenet-997210205@[10.0.0.1]>
Subject: Re: firewall with ipfw and natd
Lines: 63
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
Message-ID: <5bYb7.1334$gX2.325343@afrodite.telenet-ops.be>
Date: Tue, 07 Aug 2001 20:27:45 GMT
NNTP-Posting-Host: 213.224.41.72
X-Complaints-To: abuse@pandora.be
X-Trace: afrodite.telenet-ops.be 997216065 213.224.41.72 (Tue, 07 Aug 2001 22:27:45 MET DST)
NNTP-Posting-Date: Tue, 07 Aug 2001 22:27:45 MET DST
Organization: Telenet Internet