I want to use the internet of my school on my Android, the problem is they have a Squid proxy, and many applications on my phone don't use the proxy at all.
The obvious solution is to install a transparent proxy on my Android to force all applications to connect through it. The problem is that I need to root the phone to make it work, and I don't want to do it because it's not really my phone and rooting is a little risky-
Another solution, which is safer, is to make my computer run as a gateway, so I put my Ubuntu IP in the gateway parameter of the phone.
I'm running a small proxy on my ubuntu (cntlm), so I redirect the Android traffic to it. I did it with "iptables" as follows:
iptables -t nat -A PREROUTING -s 10.0.1.118 -p tcp -j REDIRECT --to-ports 8888 iptables -t nat -A PREROUTING -s 10.0.1.118 -p udp -j REDIRECT --to-ports 8888
10.0.1.118 is the IP of the phone, 8888 is the port of cntlm (proxy on my PC).
Now, on the phone: When I enter
www.google.com on the navigator I get nothing (web site not found, error message of Firefox).
But, when I enter
http://18.104.22.168 (IP of Google) I get an error message from the school proxy (so it worked in some way – my PC redirected the traffic of the phone to the Squid proxy).
The error message is :
The requested URL could not be retrieved
while trying to process the request
get / http/1.1
I think the problem is in the "GET" header,it should be
GET 22.214.171.124 HTTP/1.1. But I don't understand what's happening, and I'm a certified CCNA.