우분투 14.04 서버의 투명 오징어 프록시

우분투 14.04 서버의 투명 오징어 프록시

내 서버에 ubuntu 14.04 LTS 서버가 설치되어 있고 LAN 네트워크용 서버에 투명 프록시 서버를 설치하고 싶습니다. 도와주세요.

미리 감사드립니다.

답변1

이미 2개 이상의 NIC가 있는 Ubuntu 시스템이 있다는 점을 고려하면 이는 매우 간단합니다. 최신 Squid를 설치하면 됩니다. 네트워크의 모든 컴퓨터는 Squid 상자를 기본 게이트웨이로 사용해야 합니다. 그런 다음 오징어 구성에 다음을 추가하십시오.

# 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

관련 정보