Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Background Info

I have rooted an android phone and installed droidwall to get access to iptables. The kernel version is 2.6.35.7-perf.

Objective

Test the efficiency of a proxy (on port 8080) from a comparison of the traffic flow with and without the proxy.

Method

I have creating a test website on a single IP address. I am using an application that monitors how many packets/bytes have been transmitted and recieved by the phone.

Problem

Due to unknown background traffic, unwanted packets are being sent and recieved.

Solution

Use iptables to only allow a connection to one website so I can properly monitor the traffic.

I am able to limit the connections soley to my desired website without the proxy with the rules from here.

In another test, I can move the unrestricted traffic through the proxy with these iptable rules:

iptables -t nat -A OUTPUT -p tcp --dport 80 -j ACCEPT -m owner --uid-owner root  
iptables -t nat -A OUTPUT -p tcp --dport 80 -j REDIRECT --to-port 8080

How could I integrate the two sets of rules to redirect the traffic from 1.2.3.4 (example) to port 8080 AND drop everything else.

share|improve this question

migrated from serverfault.com Aug 5 '12 at 18:32

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

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