There is another approach to your problem, if you do not want to involve the kernel/iptables even though it is *THE* cleanest solution, you may consider proxies. Apache with a modules & Squid. You can create rules to rewrite part of the query or to route it where ever you want. The only drawback is that the client application need to support HTTP proxy and only TCP connection is supported (yes even non web traffic via 'CONNECT') The second proxy standard is sock v4 or v5 and support UDP traffic. You can install a sockify application on the client end if this one does not support sock. Rewriting all the packets on the fly using scapy would be the best solution for this even if I would be really interested to know if it's running on the n900.