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'm having trouble with getting local subnet traffic sent through a proxy. I've got some mobile testing devices on a subnet 192.168.0.0 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 192.168.0.2 to the webserver 192.168.0.3) 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 192.168.0.1:8080

Eventually I will limit this rule to source & destination network 192.168.0.0

I'm using an intermediary box (192.168.0.1) 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

1 Answer 1

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

 
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.