From owner-freebsd-questions@FreeBSD.ORG Wed Jul 26 11:06:39 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org 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 A4FE916A4E0 for ; Wed, 26 Jul 2006 11:06:39 +0000 (UTC) (envelope-from peter@bgnett.no) Received: from skapet.datadok.no (skapet.datadok.no [194.54.107.19]) by mx1.FreeBSD.org (Postfix) with ESMTP id 01E3F43DAE for ; Wed, 26 Jul 2006 11:06:20 +0000 (GMT) (envelope-from peter@bgnett.no) Received: from amidala.datadok.no ([194.54.103.98] helo=amidala.datadok.no.bsdly.net ident=peter) by skapet.datadok.no with esmtp (Exim 4.60) (envelope-from ) id 1G5hDU-0001To-By for freebsd-questions@freebsd.org; Wed, 26 Jul 2006 13:06:16 +0200 To: freebsd-questions@freebsd.org References: <200607252030.46540.freebsd@dfwlp.com> From: peter@bgnett.no (Peter N. M. Hansteen) Date: Wed, 26 Jul 2006 13:06:14 +0200 In-Reply-To: <200607252030.46540.freebsd@dfwlp.com> (Jonathan Horne's message of "Tue, 25 Jul 2006 20:30:46 -0500") Message-ID: <87odvczkux.fsf@amidala.datadok.no> User-Agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.4.17 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: pf firewall for a server X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jul 2006 11:06:39 -0000 Jonathan Horne writes: > ive been googling for a while now this evening, but have > unsuccesfully found any examples on how to firewall a server. i do > *not* want to build a router, and unfortunatly, every article i seem > to find wants to tell me how to build a router! The same principles apply everywhere - block everyting, allow the traffic you need. What traffic you need to pass depends on the services you intend to make accessible. For a host with a single network interface, you can get away with a handful of lines, ie localnet="xl0:network" offered="{ ssh, netbios-ns, netbios-dgm, netbios-ssn, www, https }" needed="{ ssh, domain, ntp, whois }" block all pass proto { tcp, udp } from self to any port $needed keep state pass proto { tcp, udp } from $localnet to self port $offered keep state A lot of embellishment on this (untested, may contain nuts) is possible, and you could probably do worse than spend a few moments browsing the PF docs or for that matter my rather basic PF tutorial at http://www.bgnett.no/~peter/pf/ to familiarize yourself with the system. -- Peter N. M. Hansteen, member of the first RFC 1149 implementation team http://www.blug.linux.no/rfc1149/ http://www.datadok.no/ http://www.nuug.no/ "First, we kill all the spammers" The Usenet Bard, "Twice-forwarded tales" 20:11:56 delilah spamd[26905]: 146.151.48.74: disconnected after 36099 seconds