Get all HTTP traffic with a proxy

cisco-asaPROXY

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:

enter image description here

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?

Best Answer

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.