Squid (transparent proxy), squid Proxy
1. squid transparent proxy (one website server and squid Proxy Server)
Vim/etc/squid. conf
Http_port 3128 transparent # transparent proxy keyword
Visible_hostname host name # If the host name is default, it is not required if it is not modified. Otherwise, you need to add
Cache_mem 64 MB # Cache
Cache_dir ufs/var/spool/squid 100 16 256 # cache directory ufs file format 100 indicates cache size 16 indicates level 1 subdirectory 256 indicates level 2 subdirectory
Service squid restart
Enable iptables
Graphical environment # setup or service iptables start
Iptables-t filter-nL # view filter table rules
Iptables-t filter-F # Clear the default rules of the filter table
Iptables-t nat-A nat PREROUTING-s source CIDR Block-p tcp-dport = 80-j REDIRECT -- to-ports 3128
Iptables-t nat-A nat PREROUTING-s source CIDR Block-p tcp-dport = 443-j REDIRECT -- to-ports 3128
++ ++ ++
2. yum-y install httpd elinks # web Site Server
Service httpd start
Chkconfig httpd on
Echo "1111">/var/www/html/index.html
Elinks -- dump http: // localhost/or curl http: // localhost
++ ++ ++
3. Client settings:
Route-n
Route add default gw squid Server IP # add gateway route add default gw squid Server IP # Delete Gateway
Enter the address of the website server in the firefox address bar.
Use tailf/var/log/squid/access. log # To view logs