Installing squid30 with pf on freebsd   February 19th, 2010

Download source can be on this link http://www.squid-cache.org/Versions/v3/3.0/

after the jump, unzip the package and collect:

mkdir-p / opt / src
cp squid-3.0.STABLE12 / opt / src

cd / opt/src/squid-3.0.STABLE12

chmod + x. / configure

. / configure – prefix = / opt / squid – disable-http-violations – disable-ident-lookups – enable-pf-transparent
make & & make install

After installation, edit config / opt / squid / etc / squid.conf as follows:

http_port 127.0.0.1:3129 transparent

hosts_file / etc / hosts

cache_mem 128 MB
cache_swap_high 95
cache_swap_low 80
cache_dir ufs / var / squid / cache 1000 16 256

maximum_object_size 4096 KB
minimum_object_size 0 KB
maximum_object_size_in_memory 20 KB
memory_pools off

range_offset_limit 0 KB

acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl lan src 172.21.0.0/24

http_access deny manager all
http_access allow localhost
http_access allow lan
http_access deny all

icp_access allow lan
icp_access deny all

miss_access allow lan
miss_access deny all

visible_hostname local
coredump_dir / var / spool / squid
access_log / var / log / squid / access.log squid
cache_log / var / log / squid / cache.log
cache_store_log none
error_directory / opt/squid/share/errors/Russian-1251

cache_effective_user squid

Next:

mkdir / var / log / squid
mkdir-p / var / squid / cache

chown squid: squid / var / log / squid
chown-R squid: squid / var / squid / cache

then start squid:

su squid-c ‘/ opt / squid / sbin / squid-z’ – this will create a directory for cache
su squid-c ‘/ opt / squid / sbin / squid-f / opt / squid / etc / squid.conf’

after launch corrects the right to / dev / pf squid that had the right to read.
chown root: squid / dev / pf
chmod 660 / dev / pf

Now right config for PF:

add redirects

rdr on rl0 proto tcp from 172.21.0.0/24 to! 172.21.0.0/24 port 80 -> 127.0.0.1 port 3129

pfctl-f / etc / pf.conf

After this, all traffic must go through a transparent proxy.

source here

Tags: , ,
This entry was posted on Friday, February 19th, 2010 at 5:24 am and is filed under feebsd, Networking. You can follow any responses to this entry through the RSS 2.0 feed.You can leave a response, or trackback from your own site.

No Responses

Leave a Reply

*


http://blog.csatpk.com/wp-content/plugins/wp-monalisa/icons/wpml_bye.gif 
http://blog.csatpk.com/wp-content/plugins/wp-monalisa/icons/wpml_good.gif 
http://blog.csatpk.com/wp-content/plugins/wp-monalisa/icons/wpml_negative.gif 
http://blog.csatpk.com/wp-content/plugins/wp-monalisa/icons/wpml_scratch.gif 
http://blog.csatpk.com/wp-content/plugins/wp-monalisa/icons/wpml_wacko.gif 
http://blog.csatpk.com/wp-content/plugins/wp-monalisa/icons/wpml_yahoo.gif 
http://blog.csatpk.com/wp-content/plugins/wp-monalisa/icons/wpml_cool.gif 
http://blog.csatpk.com/wp-content/plugins/wp-monalisa/icons/wpml_heart.gif 
http://blog.csatpk.com/wp-content/plugins/wp-monalisa/icons/wpml_rose.gif 
http://blog.csatpk.com/wp-content/plugins/wp-monalisa/icons/wpml_smile.gif 
http://blog.csatpk.com/wp-content/plugins/wp-monalisa/icons/wpml_whistle3.gif 
http://blog.csatpk.com/wp-content/plugins/wp-monalisa/icons/wpml_yes.gif 
http://blog.csatpk.com/wp-content/plugins/wp-monalisa/icons/wpml_cry.gif 
http://blog.csatpk.com/wp-content/plugins/wp-monalisa/icons/wpml_mail.gif 
http://blog.csatpk.com/wp-content/plugins/wp-monalisa/icons/wpml_sad.gif 
http://blog.csatpk.com/wp-content/plugins/wp-monalisa/icons/wpml_unsure.gif 
http://blog.csatpk.com/wp-content/plugins/wp-monalisa/icons/wpml_wink.gif