From owner-freebsd-questions@FreeBSD.ORG Wed Jun 2 13:39:59 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8A8D616A4D1 for ; Wed, 2 Jun 2004 13:39:59 -0700 (PDT) Received: from frodo.otenet.gr (frodo.otenet.gr [195.170.0.12]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8F37F43D41 for ; Wed, 2 Jun 2004 13:39:56 -0700 (PDT) (envelope-from keramida@ceid.upatras.gr) Received: from gothmog.gr (patr530-b152.otenet.gr [212.205.244.160]) by frodo.otenet.gr (8.12.10/8.12.10) with ESMTP id i52Kdosc017280; Wed, 2 Jun 2004 23:39:51 +0300 Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.12.11/8.12.11) with ESMTP id i52KdoA7004413; Wed, 2 Jun 2004 23:39:50 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from giorgos@localhost) by gothmog.gr (8.12.11/8.12.11/Submit) id i52Kdom0004412; Wed, 2 Jun 2004 23:39:50 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Wed, 2 Jun 2004 23:39:50 +0300 From: Giorgos Keramidas To: Randy Babb Message-ID: <20040602203950.GB4054@gothmog.gr> References: <1086188875.5101.29.camel@localhost> <20040602203750.GA4054@gothmog.gr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040602203750.GA4054@gothmog.gr> cc: freebsd-questions@freebsd.org Subject: Re: IPFILTER Rules X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2004 20:39:59 -0000 On 2004-06-02 15:12, Randy Babb wrote: > Hi, > I'm just learning how to use IPFilter and I'm having some trouble. I > hope someone can help me. I have a server running on my LAN I'm trying > to set up some rules on, they are basically the same as the ones in > Absolute BSD by Michael Lucas. The server is running two instances of > Apache (on port 80 and 81, the latter should only be accessible from my > machine through the LAN), a POP3 server, the SSH daemon, an FTP server > and a proxy server (Squid). > > When I use these rules all my connections to the server are really slow, > except to both instances of Apache for some reason - those are normal. > For instance, a connection to the POP3 server would usually be > established almost instantly, but now it takes around 80 seconds. If I > just use the rules "pass in all" and "pass out all" it works fine, so it > is definitely a problem with my rules. The delay seems suspiciously like a DNS timeout. Since you haven't mentioned any rules to explicitly allow DNS traffic below, I assume you don't have any. Just add the following rules before your groups: pass out quick proto udp from any to any keep state block return-icmp-as-dest(port-unr) in log proto udp from any to any A good place to add these would be right after your lo0 rules. > Here are the rules: > > block in log quick from any to any with ipopts > block in log quick proto tcp from any to any with short > > pass in quick on lo0 all > pass out quick on lo0 all Here... > pass out on rl0 all head 100 > block out from 127.0.0.0/8 to any group 100 > block out from any to 127.0.0.0/8 group 100 > block out from any to 192.168.1.30 group 100 > > block in on rl0 all head 200 > > block in from 127.0.0.0/8 to any group 200 > block in from 192.168.1.30 to any group 200 > > pass in quick proto tcp from any to any port = www keep state group 200 > pass in quick proto tcp from any to any port = pop3 keep state group 200 > pass in quick proto tcp from any to any port = ssh keep state group 200 > pass in quick proto tcp from any to any port = ftp keep state group 200 > pass in quick proto tcp from any to any port = 8080 keep state group 200 > pass in quick proto tcp from 192.168.1.40 to any port = 81 keep state group 200 > > block return-rst in log proto tcp from any to any flags S/SA group 200 > block return-icmp(net-unr) in proto udp all group 200