Miguel Alcántara miguel.alc at
Mon Jun 23 16:17:38 UTC 2008

Hi everybody, I'm having a problem for a week. I have to setup PF + SQUID in
a P2 machine, with 128RAM and 6GB hard disk and just one nic. I virtualized
an interface with an ip and it has squid, the nic has and all the lan is

My problem is that I can´t browse some sites the must be permitted.


#rules for firewall
ext_nic = "dc0"
yo = ""

table <dns_cautivo> {,}
rdr pass on $ext_nic inet proto tcp from $yo to any port www -> 3128
nat on $ext_nic from $yo to any -> ($ext_nic)
block all
#pass in on $ext_nic from $yo
pass out on $ext_nic from any to <dns_cautivo>


#Recommended minimum configuration:
acl all src
acl manager proto cache_object
acl localhost src
acl to_localhost dst
acl SSL_ports port 443
acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443         # https
acl Safe_ports port 70          # gopher
acl Safe_ports port 210         # wais
acl Safe_ports port 1025-65535  # unregistered ports
acl Safe_ports port 280         # http-mgmt
acl Safe_ports port 488         # gss-http
acl Safe_ports port 591         # filemaker
acl Safe_ports port 777         # multiling http
acl special_client src
#acl lista_permitidos url_regex "/usr/local/etc/squid/free.squid"

#acl special_url url_regex ucci
acl hotmail dstdomain
acl mail dstdomain
acl mailhot dstdom_regex -i mail
acl hotmail_mail dstdomain
acl passport dstdomain
acl msn dstdomain
acl ie6 browser MSIE[[:space:]]6
acl permitidos url_regex "/usr/local/etc/squid/free.squid"
acl palabra urlpath_regex -i
acl numconn maxconn 80
acl browse_hotmail url_regex
acl browse_ulima url_regex
acl browse_yahoo url_regex

http_access allow manager localhost
http_access deny manager
# Deny requests to unknown ports
http_access deny !Safe_ports
# Deny CONNECT to other than SSL ports
http_access deny CONNECT !SSL_ports
##http_access allow special_client lista_permitidos
##http_access allow special_client hotmail
##http_access allow special_client mailhot
##http_access allow special_client mail
#http_access deny special_url
#http_access allow special_client

http_access allow special_client permitidos
http_access allow special_client hotmail
http_access allow special_client mail
http_access allow special_client mailhot
http_access allow special_client Safe_ports
http_access allow special_client hotmail_mail
http_access allow special_client palabra
http_access allow special_client browse_hotmail
http_access allow special_client browse_ulima
http_access allow special_client browse_yahoo
#http_access allow special_client special_url
http_access deny all

Well, it doens`t work, when I try to surf in any domain name listed above in
squid squid sends me a message:

ERROR The requested URL could not be retrieved

While trying to retrieve the URL:

The following error was encountered:

   - * Connection to Failed *

 The system returned:

*    (1) Operation not permitted*

 The remote host or network may be down. Please try the request again.

Your cache administrator is webmaster.
 Generated Thu, 27 Dec 2007 13:12:36 GMT by pf (squid/2.6.STABLE16)

*Then in logs from squid I can see an 503 error TCP_MISS.

I use FBSD 7 and SQUID 2.6, obviously with PF. Ah!, squid was compiled with
pf habilities or something like that.

Plz, what I am doing wrong.


Miguel Alcántara A.

More information about the freebsd-pf mailing list