Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

i have a ubuntu server which i want to use as a transparent proxy, (i have no issue setting up squid, just the iptables. The server only has one network interface. The server sits on the same subnet as the router which is the current gateway to the internet for clients, i want to simply set the gateway on the clients pointing at the transparent proxy which in turn forwards the requests to the router and off to the internet. See me diagram, can anybody offer to help with the iptables configuration to achieve this scenario?

subnet mask /22

     Router(10.4.12.1)         Transparent Proxy (eth0, 10.4.12.2)
       |                   |
  +----+----+---------+----+----+
  |         |         |         |
Comp1(10.4.12.6)     Comp2(10.4.12.5)     Comp3(10.4.12.4)     Comp4(10.4.12.3)

Thanks

share|improve this question
add comment

1 Answer

This is not possible to set up unless the router supports redirecting of all port 80 traffic to the server and then routing the traffic from squid back to the original computer.

It is far simpler and easier to set it up by adding another network interface to the server, and making that the gateway for the network.

With this setup, it is a dawdle to set up transparent proxying and I have set this up more times than I can remember.

http://www.cyberciti.biz/tips/linux-setup-transparent-proxy-squid-howto.html provides a reasonable guide.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.