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'm having trouble with getting local subnet traffic sent through a proxy. I've got some mobile testing devices on a subnet and a web server on that also. For dev purposes, I need to inject some code. I'm using a proxy to do this. However the traffic that is local to the subnet (i.e. from a device, say to the webserver is not passing through the proxy server. All other requests get the code injected correctly.

My current iptables is configured using the following command:

iptables -t nat -A PREROUTING -p tcp -m tcp -i eth1 --dport 80 -j DNAT --to-destination

Eventually I will limit this rule to source & destination network

I'm using an intermediary box ( with a dumb wifi access point as a router; running ubuntu 12.04.

The proxy is Apache configured as a forward proxy, listening on port 8080.

I know that the traffic is not being sent to the proxy because when I take down Apache proxy the local sites are still served. However any outbound sites are then unavailable.

I don't understand why this rule is not applying to completely local-to-the-subnet traffic.

I there something I am missing? Or is it likely that my WiFi access point, despite being configured NOT to route, is routing this traffic, and thus it never reaches my iptables?

share|improve this question
up vote 0 down vote accepted

After a while I decided that this wasn't possible, and I made sure that the devices and the web server were to be on different subnets, with the proxy server machine routing between the two.

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.