大网数据广告活动
服务器运维问答

Get all HTTP traffic with a proxy

· 52CE 我爱测

I’d like to setup a proxy server that get all HTTP traffic on my network. I think to use Squid installed on Debian. Below the network diagram: I don’t want to setup a proxy server on my LAN because I can’t configure a proy server…

问题原文

原帖链接 · Julien · CC BY-SA 3.0

I’d like to setup a proxy server that get all HTTP traffic on my network. I think to use Squid installed on Debian.

Below the network diagram:

I don’t want to setup a proxy server on my LAN because I can’t configure a proy server on each computers.

Can someone tell me what’s the best way to do this?

已采纳解答

原帖链接 · yagmoth555 · CC BY-SA 3.0

Your best bet is to setup squid in transparent mode, but your network diagram would change. As the proxy server would NAT, that would replace your cisco as a router too. (and while at it, why not remove your ISP router to not double NAT ?? as if someday you want to create some VPN, you can't in double-NAT)

See a tutorial there; http://xmodulo.com/squid-transparent-web-proxy-centos-rhel.html

There a bit of detail from the tutorial that show how he did it;

Squid Installation

To set up a transparent proxy with Squid, we start by adding necessary iptables rules. These rules should help you get started, but please make sure that they do not conflict with any of the existing configuration.

iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT--to-port 3128

The first rule will cause all outbound packets from eth1 (WAN interface) to have the source IP address of eth1 (i.e., enable NAT). The second rule will redirect all incoming HTTP packets (destined to TCP 80) from eth0 (LAN interface) to Squid listening ort (TCP 3128), instead of forwarding it out to WAN interface right away.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-07-04)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。