From owner-freebsd-questions@FreeBSD.ORG Fri Oct 15 15:39:44 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 1D93C16A4CE for ; Fri, 15 Oct 2004 15:39:44 +0000 (GMT) Received: from emboss.bossbox.com (cpc2-tall1-5-0-cust19.dbln.cable.ntl.com [81.98.89.19]) by mx1.FreeBSD.org (Postfix) with ESMTP id 704C943D58 for ; Fri, 15 Oct 2004 15:39:43 +0000 (GMT) (envelope-from Brian@bossbox.com) Received: from bogbox ([192.168.0.2]) by emboss.bossbox.com (8.12.10/8.12.10) with ESMTP id i9FFdeXL047691 for ; Fri, 15 Oct 2004 16:39:41 +0100 (IST) (envelope-from Brian@bossbox.com) Message-Id: <200410151539.i9FFdeXL047691@emboss.bossbox.com> From: "Brian " To: "'FreeBSD Questions'" Date: Fri, 15 Oct 2004 16:39:42 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.5510 In-Reply-To: <200410141822.i9EIMnXL043794@emboss.bossbox.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Thread-Index: AcSxZel4PZPkALbBRKan1neUHW8NRAAqQ74gAAIcz7AAAEgQ0AAtHwcg Subject: RE: IPFW NATD 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: Fri, 15 Oct 2004 15:39:44 -0000 Hi I'm trying to setup natd to port forward to a http,ftp and vnc server behind the natd box But I only want a customer from their static ip address to be able to login and block everything else Is this possible in an natd enviroment? Any examples? Port forwarding works ok, I just can't figure out the rules to stop everyone and allow this one client Cheers Brian Brian, If you've got the portforwarding working, then a few IPFW rules will add the security you're looking for. If your divert rule is number 100, then add a few rules above it, like this: ipfw add 50 skipto 100 tcp from [static.ip.of.customer] to [public.ip.of.nat.box] 80 ipfw add 51 skipto 100 tcp from [static.ip.of.customer] to [public.ip.of.nat.box] 21 ipfw add 52 skipto 100 tcp from [static.ip.of.customer] to [public.ip.of.nat.box] [VNC port] ipfw add 53 deny tcp from any to [public.ip.of.nat.box] 80 ipfw add 54 deny tcp from any to [public.ip.of.nat.box] 21 ipfw add 55 deny tcp from any to [public.ip.of.nat.box] [VNC port] The first three rules pass the traffic from the specified IP, to the divert rule, to natd, and get portforwaded. Any other traffic on those ports get blocked, and doesn't get diverted. This worked a treat, thanks very much. Brian --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.773 / Virus Database: 520 - Release Date: 05/10/2004