ubuntu 14.04 伺服器上的透明魷魚代理程式

ubuntu 14.04 伺服器上的透明魷魚代理程式

我的伺服器上安裝了 ubuntu 14.04 LTS 伺服器,我想在 LAN 網路的伺服器上安裝透明代理伺服器。請在這件事上給我幫助。

提前致謝。

答案1

這非常簡單,因為您已經擁有一台帶有 2 個以上 NIC 的 Ubuntu 機器 - 您只需要安裝或多或少最新的 Squid;您網路中的所有電腦都必須使用 Squid box 作為預設閘道;然後將以下內容新增到魷魚配置中:

# port configuration
http_port  3126 intercept
https_port 3127 intercept ssl-bump generate-host-certificates=on dynamic_cert_mem_cache_size=4MB cert=/opt/qlproxy/etc/myca.pem
http_port  3128 ssl-bump generate-host-certificates=on dynamic_cert_mem_cache_size=4MB cert=/opt/qlproxy/etc/myca.pem

最後使用 iptables 重定向來自連接埠 80 -> 3126、443 -> 3129 的傳入流量:

# redirect all HTTP(tcp:80) traffic coming in through eth0 to 3126
iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3126

# redirect all HTTPS(tcp:443) traffic coming in through eth0 to 3127
iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 3127

啟用 NAT,一切順利。更多資訊請訪問http://blog.diladele.com/2014/04/10/transparent-ssl-https-filtering-on-centos/

更簡單的方法是在 CentOS 7 上使用 FirewallD,網址為http://docs.diladele.com/tutorials/transparently_filtering_https_centos/index.html

相關內容