Saturday, 14 January 2012

Proxy Transparant Linux Debian


Login root first before installing anything on our debian system. Install with the command:
      # apt-get install squid

After that you can configure it with the command
     # nano / etc / squid / squid.conf

search the files below and replace
              visible_hostname replace with your domain name
              cache_mgr contents of the e-mail to web master
              http_port 3128 transparent
              always_direct allow all
              cache_dir ufs / var / spool / squid 500 16 256
             

(For Access Control List)
acl lan src (IP / mask)
acl block dstdomain. google.com. facebook.com
word url_regex acl-i "/ etc / squid / word.txt" (for the word "the want on the block: eg women)


(moved under INSERT YOUR OWN)
http_access allow lan
http_access deny block
http_access deny word
           
Then create the cache directory by typing:
      # squid-z

Run the IP Forwarding:
      # echo 1> / proc/sys/net/ipv4/ip_forward

Disguise connection, install ipmasq:
      # apt-get install ipmasq

And for the last one, run the command:
     # iptables t nat-A POSTROUTING-o eth0-j MASQUERADE (eth0 = eth internet)
(The command above is for internet sharing)

     # iptables-t nat-A PREROUTING-p tcp - dport 80-j REDIRECT - to-port 3128
(This is to divert to port 3128 which is the proxy port)

     # / Etc / init.d / squid start

it's easy right ?? 
Share:

0 comments:

Post a Comment