Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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(         Transparent Proxy (eth0,
       |                   |
  |         |         |         |
Comp1(     Comp2(     Comp3(     Comp4(


share|improve this question

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. provides a reasonable guide.

share|improve this answer

Your Answer


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.