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