Great Circle Associates Firewalls
(September 1997)
 

Indexed By Date: [Previous] [Next] Indexed By Thread: [Previous] [Next]

Subject: Re: IPMasquerading question
From: Bernd Eckenfels <lists @ lina . inka . de>
Date: Sun, 7 Sep 1997 18:45:07 +0200
To: HPet @ svb . nl
Cc: firewalls @ greatcircle . com
In-reply-to: <12310503600628 @ svb . nl>; from Hanno Pet on Tue, Sep 02, 1997 at 02:33:50PM +0000
References: <12310503600628 @ svb . nl>

Hello,

this is just a simple solution, not a complete Firewall configuration. You
should realy read more about the basics before you trust your filtering
rules:

> Example 4,  does not work
> 
> ipfwadm -I -p deny
> ipfwadm -O -p deny

This will stop the System from accepting or sending packets. The incoming
and outgoing rules are checkes before/after the forewarding rules. Incomming
you have to allow packets with the right source address on the internal
interface, and deny packets with the wrong source address on external
interface:

ipfwadm -I -a accept -W eth0 -S 555.666.777.0/24
ipfwadm -I -a deny   -W eth1 -S 555.666.777.0/24 -o # spoofed
ipfwadm -I -a accept -W eth1 -S 0/0

outgoing you have to allow only the masqueraded packets:

ipfwadm -O -a accept -W eth0 -S 555.666.777.1 -D 555.666.777.0/24
ipfwadm -O -a deny   -W eth1 -S 555.666.777.0/24 # prevent leakage
ipfwadm -O -a deny   -W eth1 -D 555.666.777.0/24 # prevent leakage
ipfwadm -O -a accept -W eth1 -S 111.222.333.1 -D 0/0

(notice: the order of the rules is important here)

> ipfwadm -F - deny
> ipfwadm -F -a accept -b -S 555.666.777.0/24 -D 111.222.333.444 
> ipfwadm -F -a accept -b -S 555.555.777.0/24 -D 111.222.333.444 
> ipfwadm -F -a masquerade -b -S 555.666.777.0/24 -D 111.222.333.444

This dooes not do what you want. If you accept in a forwarding rule the
package will be forwarded without rewriting. This is the right way:

ipfwadm -F - deny
ipfwadm -F -a accept -m -b -S 555.666.777.0/24 -D 111.222.333.444

Greetings
Bernd

BTW: instead of deny policy add an additional rule like:

ipfwadm {-I,-O,-F} -a deny -S0/0 -D0/0 -o

which will deny AND log all the denied packets (at least this is good for
testing).

Greetings
Bernd
-- 
  (OO)      -- Bernd_Eckenfels @
 Wittumstrasse13 .
 76646Bruchsal .
 de --
 ( .. )  ecki @
 {inka .
 de,linux.de,debian.org} http://home.pages.de/~eckes/
  o--o     *plush*  2048/93600EFD  eckes @
 irc  +4972573817  BE5-RIPE
(O____O)       If privacy is outlawed only Outlaws have privacy


References:
Indexed By Date Previous: RE: Denver Systems, Inc Firebox
From: Stephen Greenwalt <StephenG @ DENVERSYS . COM>
Next: Re: Denver Systems, Inc Firebox
From: Peter da Silva <peter @ grendel . nmti . com>
Indexed By Thread Previous: IPMasquerading question
From: "Hanno Pet" <HPet @ svb . nl>
Next: IPMasquerading question (second post)
From: "Hanno Pet" <HPet @ svb . nl>

Google
 
Search Internet Search www.greatcircle.com