From owner-freebsd-questions@freebsd.org Tue Jun 28 13:08:09 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CD1AB8518A for ; Tue, 28 Jun 2016 13:08:09 +0000 (UTC) (envelope-from carlopmart@gmail.com) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 13693201A for ; Tue, 28 Jun 2016 13:08:09 +0000 (UTC) (envelope-from carlopmart@gmail.com) Received: by mail-wm0-x22d.google.com with SMTP id f126so139422444wma.1 for ; Tue, 28 Jun 2016 06:08:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=sGS2955wNMPSuQGIsjNWOdeUHiN9iI/5fMraYIRBfTU=; b=r9uIsApxAWOODxKdjJwVR52b3JLPslYQzEuxQZuY7wQZuvk8lWtleQvRkZrQVrTLYZ ZBgzHwGdwRWPYqfnBJqsYcylfv3r/IG9sE64LhXAdSVq8JWAKoFXlCpEoWHJ36l8chz+ LfLS/sMg88IGEvaAOrw71wSH9+nz5F6HK6+hYrdLAHDKiRNFYxtk8d2DhKKZcB8a/JK3 MxMkARt4zGkOQKRhKdXiGiB0BU29S8OtayUOUGZmRsO3n02BObK5+ujG6He2vkDbEgCV H8qrcfg5nVmeDgRqw5zPLlpaLmaM8AqYV/mVzZZgUiKZWdS2mi6084w+TxnvskH9Bbah gMKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=sGS2955wNMPSuQGIsjNWOdeUHiN9iI/5fMraYIRBfTU=; b=DPRBjtnXVWkAtYC4KsSVVfHnPlDwYnPUEA9jH/VZrKK+bIOj8+SgfPGbhUV3gsszlR 78p2QDxkD4cEgJNnEwYD1wfJaPuoyYk8rVEQqBxGCol8MiE1Uz2HhvKnT7e8ti4thIvy PlpdVOmdnyaONvmTGEQnwr4mBcb3l47pvribApDzTHCXyuAu86ihA4RyTOi5tzWUziPk U6VJIIN+gb/tqv1+b/dWF1kBuPR9XTT6EljFDKyACeIrVhRPnGlkMXE3IG2Ie2NtrIHu tC4tNuJhrkIMoDXO0bCutu7+iVGKZLzJX0wfxlVdg+WKiuvkDK4fo6w6PUSkTnwROT1P 10pw== X-Gm-Message-State: ALyK8tJYKFBrkzlqPyruMJlqCFhKJfGARqwPVTEnWuBvQ/cTGlb8FELGl00PEqLzOJEqrA== X-Received: by 10.28.93.65 with SMTP id r62mr8906105wmb.51.1467119287206; Tue, 28 Jun 2016 06:08:07 -0700 (PDT) Received: from beagle.bcn.sia.es (132.red-79-154-242.dynamicip.rima-tde.net. [79.154.242.132]) by smtp.gmail.com with ESMTPSA id bh7sm344472wjb.22.2016.06.28.06.08.05 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 Jun 2016 06:08:06 -0700 (PDT) Date: Tue, 28 Jun 2016 13:07:59 +0000 From: "C. L. Martinez" To: freebsd-questions@freebsd.org Subject: Problems with pf rules for intercept squid proxy Message-ID: <20160628130759.GA13226@beagle.bcn.sia.es> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline User-Agent: Mutt/1.6.0 (2016-04-01) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jun 2016 13:08:09 -0000 Hi all, I have some problems with my pf rules on a FreeBSD 10.3 host that acts as a squid intercept proxy. My actual pf rules are: rdr pass on $vpnif proto tcp from $int_network to any port http -> lo0 port 5144 rdr pass on $vpnif proto tcp from $int_network to any port https -> lo0 port 5145 At first stage it seems that these rules works, but don't. Traffic is redirected to squid, but squid denies all connections: 1467111934.502 1 172.22.55.1 TCP_DENIED/403 4221 GET http://www.osnews.com/ - HIER_NONE/- text/html Using same squid.conf's file under an OpenBSD test machine, squid works without problems. For this reason, I don't think there is some problem with my squid's config. The only difference between this OpenBSD host and FreeBSD are the pf rules. In OpenBSD host, pf rules are: pass in inet proto tcp from $int_network to any port http divert-to 127.0.0.1 port 5144 pass in inet proto tcp from $int_network to any port https divert-to 127.0.0.1 port 5145 .. and all works ok. Any idea why squid denies connections using FreeBSD's pf rules?? Thanks. -- Greetings, C. L. Martinez