From owner-freebsd-questions@freebsd.org Wed Jun 29 13:21: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 5E23FB81470 for ; Wed, 29 Jun 2016 13:21:09 +0000 (UTC) (envelope-from carlopmart@gmail.com) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (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 EFF922CB5 for ; Wed, 29 Jun 2016 13:21:08 +0000 (UTC) (envelope-from carlopmart@gmail.com) Received: by mail-wm0-x22b.google.com with SMTP id r190so33402716wmr.0 for ; Wed, 29 Jun 2016 06:21:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=hATZfiBMGnHNc6nzjtPTPCQaDkaz/bKK8JkOEfNRfS4=; b=ILc8I9KrTRKBFMWNRMy87A8epOyWuMH/FNOSUJSt2a7vAzC9EsFBAX+bqJoD7Dacqy N9MByXXUe/xm82QfiAlJCg6nqmeqXFkClL6IP4EVCFkRYtGKs+3CcFas+PwvHELizKw/ lch2DRKWGz0EsgyFlieqEY5CFBl0lp6ugRufbXOttfJmSx7lKuQ+YzGuecerqPlb6n1r zeXxIgRxt/KleiUsfFGVuQs+A1bR06VXErmNbGqDDo8Wc4N7lxV9G65+xXgcQWY+OcaB dZtaIh4gEE9Hs/IKokLAPDYWb16Z6BjEHkDdektp5EV50IQZvTM4DNVqZTO89CeQacrF WpQg== 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:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=hATZfiBMGnHNc6nzjtPTPCQaDkaz/bKK8JkOEfNRfS4=; b=IJUv7A4A99u1GMQHQY3gZT1STsgI8CK9zWI1cGS23d+ETtdwlSjjkvniTGjmvF0B2Z SvQHDfwcvlOYJOSIBw59Pib9I71rSE3wmh7zJbcaWgCKpgE8OuYk23ycF04o2sqa/CPp pFqP2yvutvXfm+T3IbwUj1EatAqGY9i/514cBKvWzlpDIQdsfSe9gBWakQfHVpSl1Och bdT9ZPJ8X19JubFziiZpJypt+RvECHC6BHxhUGju+AE9pXnAJQ5spl9i0fb62yFN7J5U ZRMrsjQx0EucIAW36LYAiOjMcSPA0ZgKoS9VlJwQ5y469fNAIpdkCN3b8A1I+YjGBIiR dfoQ== X-Gm-Message-State: ALyK8tLUxQ6qdf6vSJxY/2rInt9SeQX9Z8oghWC1pKVZMDnl4tKSnFTpiNMharI/8pfsIQ== X-Received: by 10.194.54.102 with SMTP id i6mr8002812wjp.91.1467206467334; Wed, 29 Jun 2016 06:21: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 zb9sm3706273wjc.34.2016.06.29.06.21.05 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 29 Jun 2016 06:21:06 -0700 (PDT) Date: Wed, 29 Jun 2016 13:20:58 +0000 From: "C. L. Martinez" To: freebsd-questions@freebsd.org Subject: Re: Problems with pf rules for intercept squid proxy Message-ID: <20160629131951.GA12552@beagle.bcn.sia.es> References: <20160628130759.GA13226@beagle.bcn.sia.es> <2822287D-FE6F-4A4B-995A-639B696911DF@FreeBSD.org> <20160629113324.GA10436@beagle.bcn.sia.es> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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: Wed, 29 Jun 2016 13:21:09 -0000 Yep, is it not too dangerous to assign 0770 to /dev/pf?? Anyway, I have tried, but with same error: traffic is denied by squid ... On Wed 29.Jun'16 at 13:39:46 +0100, krad wrote: > have you got these lines in your /etc/devfs.conf file > > > own pf root:squid > perm pf 0770 > > you also need lines like this in the squid.conf > > http_port 192.168.1.1:3128 intercept > > > > On 29 June 2016 at 12:33, C. L. Martinez wrote: > > > On Tue 28.Jun'16 at 19:37:37 +0200, Kristof Provost wrote: > > > > > > > > > On 28 Jun 2016, at 15:07, C. L. Martinez wrote: > > > > 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. > > > > > > > You may have a different squid version, or they may be patched > > differently. > > > Your redirect rules are working, as demonstrated by the fact that squid > > gets > > > a request, and replies to it. > > > > > > Note that pf does not change your HTTP payload, it only affects TCP. In > > > other words: if Squid sees the connection (and it does) it’s a Squid > > > problem. > > > > > > Also note that you’re redirecting on FreeBSD, but using divert-to on > > > OpenBSD. > > > This may be triggering different behaviour from Squid. The man page says > > > that with divert-to: > > > > > > The packets will not be modified, so getsockname(2) on the socket > > will > > > return > > > the original destination address of the packet. > > > > > > That might be affecting an ACL in Squid. > > > > > > Regards, > > > Kristof > > > > Thanks Kristof. I am using squid installed from pkg under a FreeBSD 10.3, > > fully updated: > > > > Squid Cache: Version 3.5.19 > > Service Name: squid > > configure options: '--with-default-user=squid' '--bindir=/usr/local/sbin' > > '--sbindir=/usr/local/sbin' '--datadir=/usr/local/etc/squid' > > '--libexecdir=/usr/local/libexec/squid' '--localstatedir=/var' > > '--sysconfdir=/usr/local/etc/squid' '--with-logdir=/var/log/squid' > > '--with-pidfile=/var/run/squid/squid.pid' '--with-swapdir=/var/squid/cache' > > '--without-gnutls' '--enable-auth' '--enable-build-info' > > '--enable-loadable-modules' '--enable-removal-policies=lru heap' > > '--disable-epoll' '--disable-linux-netfilter' '--disable-linux-tproxy' > > '--disable-translation' '--disable-arch-native' '--enable-eui' > > '--enable-cache-digests' '--enable-delay-pools' '--disable-ecap' > > '--disable-esi' '--enable-follow-x-forwarded-for' '--enable-htcp' > > '--enable-icap-client' '--enable-icmp' '--enable-ident-lookups' > > '--enable-ipv6' '--enable-kqueue' '--with-large-files' > > '--enable-http-violations' '--without-nettle' '--enable-snmp' > > '--enable-ssl' '--with-openssl=/usr' 'LIBOPENSSL_CFLAGS=-I/usr/include' > > 'LIBOPENSSL_LIBS=-lcrypto -lssl' '--enable-ssl-crtd' > > '--disable-stacktraces' '--enable-ipf-transparent' > > '--enable-ipfw-transparent' '--enable-pf-transparent' '--with-nat-devpf' > > '--enable-forw-via-db' '--enable-wccp' '--enable-wccpv2' > > '--with-heimdal-krb5=/usr' 'CFLAGS=-I/usr/include -O2 -pipe > > -fstack-protector -fno-strict-aliasing' 'LDFLAGS=-L/usr/lib -pthread > > -fstack-protector' 'LIBS=-lkrb5 -lgssapi -lgssapi_krb5 ' > > 'KRB5CONFIG=/usr/bin/krb5-config' '--enable-auth-basic=DB SMB_LM > > MSNT-multi-domain NCSA PAM POP3 RADIUS fake getpwnam NIS' > > '--enable-auth-digest=file' '--enable-external-acl-helpers=file_userip > > time_quota unix_group' '--enable-auth-negotiate=kerberos wrapper' > > '--enable-auth-ntlm=fake smb_lm' '--enable-storeio=aufs diskd rock ufs' > > '--enable-disk-io=DiskThreads DiskDaemon AIO Blocking IpcIo Mmapped' > > '--enable-log-daemon-helpers=file' '--enable-url-rewrite-helpers=fake' > > '--enable-storeid-rewrite-helpers=file' '--prefix=/usr/local' > > '--mandir=/usr/local/man' '--infodir=/usr/local/info/' > > '--build=amd64-portbld-freebsd10.1' 'build_alias=amd64-portbld-freebsd10.1' > > 'CC=cc' 'CPPFLAGS=' 'CXX=c++' 'CXXFLAGS=-O2 -pipe -fstack-protector > > -fno-strict-aliasing ' 'CPP=cpp' --enable-ltdl-convenience > > > > According to this options, intercept is enabled ... Then, I don't > > understand why it doesn't works ... > > > > -- > > Greetings, > > C. L. Martinez > > _______________________________________________ > > freebsd-questions@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/freebsd-questions > > To unsubscribe, send any mail to " > > freebsd-questions-unsubscribe@freebsd.org" > > -- Greetings, C. L. Martinez