From owner-freebsd-questions@FreeBSD.ORG Mon Sep 13 16:23:44 2010 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32551106566B for ; Mon, 13 Sep 2010 16:23:44 +0000 (UTC) (envelope-from nvidican@m2.vidican.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id C6B1D8FC17 for ; Mon, 13 Sep 2010 16:23:43 +0000 (UTC) Received: by wyb33 with SMTP id 33so7467937wyb.13 for ; Mon, 13 Sep 2010 09:23:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.54.202 with SMTP id i52mr4575186wec.40.1284393468043; Mon, 13 Sep 2010 08:57:48 -0700 (PDT) Sender: nvidican@m2.vidican.com Received: by 10.216.181.70 with HTTP; Mon, 13 Sep 2010 08:57:47 -0700 (PDT) X-Originating-IP: [136.1.1.105] In-Reply-To: References: Date: Mon, 13 Sep 2010 11:57:47 -0400 X-Google-Sender-Auth: 7okBuMFByfYUzYAk8iI_RWyJ8L4 Message-ID: From: Nathan Vidican To: questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Subject: Re: ipfw fwd for transparent proxy (squid) - but, not on loopback 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: Mon, 13 Sep 2010 16:23:44 -0000 On Mon, Sep 13, 2010 at 11:53 AM, Nathan Vidican wrote= : > > Hey all - I've been trying to implement a transparent proxy for all outgo= ing traffic to port 80 to forward to a proxy server. The problem is that th= e proxy itself resides on a different host than the forward rule does. Has = anyone done something similar? Ideally I'd like to implement with ipfw, but= not opposed to other suggestions? > > Internet -> firewall/gateway -> proxy server -> LAN/clients > > Where the firewall/gateway is the central router for multiple networks, i= ncluding the public subnet which 'proxy server' gets it's external IP for. = So ideally I would like something along the lines of this (assuming the pro= xy server is running on 10.1.1.12:3128): > > ipfw add 600 fwd 10.1.1.12,3128 tcp from 10.1.2.0/24 to any 80 via 10.1.2= .254 > ipfw add 600 fwd 10.1.1.12,3128 tcp from 10.1.3.0/24 to any 80 via 10.1.3= .254 > ipfw add 600 fwd 10.1.1.12,3128 tcp from 10.1.1.0/26 to any 80 via 10.1.1= .1 > > I have tried the identical rules to above using 127.0.0.1,3128 - of cours= e starting up squid on the gateway machine too... the problem is that machi= ne simply doesn't have the resources and I'd prefer to run squid on a diffe= rent host. > > Any suggestions or referrals to RTFM somewhere would be greatly appreciat= ed. Thanks. > > -- > Nathan Vidican > nathan@vidican.com > Go figure, five minutes after posting I found what I needed in squid's documentation. FYI in case anyone comes accross this thread, what I had been doing wrong was 'http_port 3128 transparent' should have been 'http_port 3128 intercept' instead. See this link for more details: http://wiki.squid-cache.org/ConfigExamples/Intercept/FreeBsdIpfw -- Nathan Vidican nathan@vidican.com