Linux iptables squid transparent proxy

Source: Internet
Author: User

Yesterday I configured a simple Linux machine and used iptables to implement dual-nic Intranet access to the Internet. Today I briefly studied squid, found a lot of information on the Internet, and implemented the squid transparent proxy.
Use default configurations for squid. conf. You need to learn more about the configurations.

[Root @ localhost ~] # More/usr/local/bin/firewall. Sh
#
Modprobe ip_tables
Modprobe iptable_filter
Modprobe iptable_nat
Modprobe ip_conntrack
Modprobe ip_conntrack_ftp
Modprobe ip_nat_ftp

#
Echo 1>/proc/sys/NET/IPv4/ip_forward

#
Iptables-T Nat-A postrouting-s 192.168.168.0/24-O eth1-j snat -- to external IP address
Iptables-T Nat-A prerouting-I eth0-P TCP-s 192.168.168.0/24 -- dport 80-J redirect -- to-port 3128

[Root @ localhost ~] # More/etc/squid. conf

ACL our_networks SRC 192.168.168.0/24
Http_access allow our_networks

Http_port 3128 transparent

Cache_mem 128 MB

Cache_dir ufs/var/spool/squid 1000 64 1024

Cache_swap_low 90
Cache_swap_high 95

Access_log/var/log/squid/access. Log squid
Cache_log/var/log/squid/cache. Log
Cache_store_log/var/log/squid/store. Log

Mime_table/etc/squid/mime. conf

Pid_filename/var/run/squid. PID

Cache_inclutive_user squid
Cache_paitive_group squid

Icp_port 3130

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.