Linux 下仅用 iptables 实现为透明代理服务器

在网上 Google/Baidu  一下 “iptables 代理服务器” 多是讲的 iptables 结合 Squid 来实现透明代理的,用 iptables 把请求转发到 Squid  的代理端口上的,由于 Squid 有其局限性,不能支持 POP3、SMTP 和 P2P 协议。所以想在不影响多数人上网方式,集中控制的情况下,给自己单独开个小灶,用 iptables 在代理服务器上另辟一条溪径。

代理服务器有两网卡:

eth0 10.1.0.1  连接内部的网卡
eth1 202.x.x.x       能上互联网的网卡

建立脚本,比如 /usr/local/transparent_proxy.sh,内容如下: 阅读全文 >>