Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Oct 2005 09:04:29 -0500
From:      Eric F Crist <ecrist@secure-computing.net>
To:        John Do <pcbsdguy@yahoo.ca>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: IPFW equivalent of iptables --state ESTABLISHED, RELATED
Message-ID:  <4950C291-2CC5-4042-BB56-42A8C95CAC90@secure-computing.net>
In-Reply-To: <20051023045343.27950.qmail@web35802.mail.mud.yahoo.com>
References:  <20051023045343.27950.qmail@web35802.mail.mud.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Oct 22, 2005, at 11:53 PM, John Do wrote:

> Hi guys
>
> I'm having trouble with IPFW I need to allow user
> initiated traffic IN but I can't
>
> Basically in iptables for Linux I would have used
> something like
> -A INPUT -p tcp -m tcp --state ESTABLISHED,RELATED -j
> ACCEPT
>
>
> Can someone help me discover what the equivalent
> syntax in IPFW would be?
>
> I have tried to use "allow tcp from any to any
> established in" but it doesn't work
>
> much appreciated
>
> thanks guys !

I'm not quite sure what you're trying to accomplish.  If you just  
want traffic enabled so that when users are browsing the web they get  
the replies from their requests, that rule is written as:

ipfw add ### allow ip from any to any established

The rule won't allow new traffic in or out without other rules  
enabling it.  An example ruleset could look like this:

ipfw add 100 allow ip from me to any
ipfw add 200 allow ip from 192.168.1.0/24 to any out via dc0
ipfw add 300 allow ip from any to any established
ipfw add 400 deny ip from 192.168.1.0/24 to me in via dc0
ipfw add 500 allow ip from any to any via sk0

In this example, I'm assuming your FreeBSD machine is the network  
gateway.  NIC dc0 is the outside NIC and sk0 is the internal one.

HTH
_______________________________________________________
Eric F Crist                  "I am so smart, S.M.R.T!"
Secure Computing Networks              -Homer J Simpson




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4950C291-2CC5-4042-BB56-42A8C95CAC90>