DominusPi
Posts: 39
Joined: Mon Nov 18, 2013 5:31 pm

Need help to use RPi as proxy

Sun Mar 16, 2014 7:18 pm

Hey guys,

My situation is farily simple : In my high school we have wifi, but they block like everything. What I'd like to do is to use my RPi as a personal proxy using my personal home internet, so the ywon't notice it like they do for web proxys.
The thing is I have no idea how to start/where to look etc

So if you could redirect me to any tutorial adapted to my problem, that would really be great !

Thank you !
Cheers !

HiroProtagonist
Posts: 212
Joined: Sat Jun 29, 2013 9:45 am

Re: Need help to use RPi as proxy

Sun Mar 16, 2014 11:53 pm

DominusPi wrote:My situation is farily simple : In my high school we have wifi, but they block like everything. What I'd like to do is to use my RPi as a personal proxy using my personal home internet, so the ywon't notice it like they do for web proxys.
The thing is I have no idea how to start/where to look etc

So if you could redirect me to any tutorial adapted to my problem, that would really be great !
You have two main problems to overcome:
1) Configuring the pi as a proxy
2) Connecting to your proxy from an external address.

For 1) tinyproxy would be ideal. You could install a caching proxy such a squid, but that's probably overkill.

For 2) you'll need to ensure your pi has a static address on your LAN, and a suitable port is forwarded to your pi by your router. Finally, you'll need some way to reliably determine your external IP address [such as dynamic DNS].

lazarus78
Posts: 236
Joined: Thu Jul 25, 2013 5:16 pm

Re: Need help to use RPi as proxy

Mon Mar 17, 2014 5:24 pm

HiroProtagonist wrote:
DominusPi wrote: For 2) you'll need to ensure your pi has a static address on your LAN, and a suitable port is forwarded to your pi by your router. Finally, you'll need some way to reliably determine your external IP address [such as dynamic DNS].
The LAN IP is unlikely to change often. If the Pi is left on, it will never change, and since it uses less power then charging your phone all day, there is really no downside to this.

The external IP is also unlikely to change unless you request a new one from your ISP or they refresh your connection for whatever reason, which they (should) never do unless on request. but given the intended purpose here, this is of little issue. One day of not being able to bypass school filters won't kill the kid.

Also note, most schools can expel you immediately if found to be bypassing school filters, as per the paper you most likely signed (Or your parents) at the beginning of the year. God I don't miss the millions of papers needing to be signed...

DominusPi
Posts: 39
Joined: Mon Nov 18, 2013 5:31 pm

Re: Need help to use RPi as proxy

Mon Mar 17, 2014 8:52 pm

My local Pi ip is already static, so that's not a problem
I can easily forward a port
My external ip never changes so I only need it once (right ?)

My school is stupid, it would never see I'm doing it and even if they catch me i'll just tell them their filter sucks and doesn't allow me to do the needed stuff (which is true, even teachers complain)

+I never signed such paper (I always read everything I sign)

Let's just concentrte on the pi as proxy thing :D
Cheers !

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: Need help to use RPi as proxy

Mon Mar 17, 2014 8:56 pm

What are you using to access the school network i.e. a laptop or Android phone / tablet??

Richard S.

DominusPi
Posts: 39
Joined: Mon Nov 18, 2013 5:31 pm

Re: Need help to use RPi as proxy

Mon Mar 17, 2014 9:10 pm

Most likely iPhone
redhawk wrote:What are you using to access to the school network i.e. a laptop or Android phone / tablet??

Richard S.
Cheers !

DominusPi
Posts: 39
Joined: Mon Nov 18, 2013 5:31 pm

Re: Need help to use RPi as proxy

Mon Mar 17, 2014 9:47 pm

I'm trying tinyproxy but having some issues setting it up, wouldn't mind help haha
Won't be back until tomorrow night though
Cheers !

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: Need help to use RPi as proxy

Mon Mar 17, 2014 9:56 pm

I use an Android app called SSH Tunnel I'm sure there is an equivalent for the iPhone ssh tunnelling isn't exactly rocket science.
To use your Pi as a ssh proxy just have Raspbian running and make sure your home router has a port forwarding rule created otherwise the Pi cannot receive incoming connections.
For security purposes you should change the pi default password and use an uncommon port number for ssh like 94, 89 (22, 1080, or 8080 is likely to to flag suspicions activity).

Change / add port number: sudo nano /etc/ssh/sshd_config and add line: port 89 (save and restart the Pi).
Next change pi default password with: passwd
Next make port forward rule on your router with TCP 89 pointing to your Pi's IP local address.
Next make a note of your external IP address and bung this into the iPhone app with username: pi and password: (whatever it is).
Now try and access websites with the iPhone your LNK light on the Pi should blink rapidly which would indicate traffic is being re-routed.
The nice this about SSH proxy it's encrypted so no chance of stealing data or know what sites you're visiting except for knowing the IP address of your Pi.
If at school you find that it doesn't work then your school probably has strict port filtering and 89 cannot pass though.

If anyone asks "how are you're doing that" just blame the 3G connectivity. :D

Richard S.

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: Need help to use RPi as proxy

Mon Mar 17, 2014 10:38 pm

Hmm it seems Apple are not kind to iPhone users I keep forgetting they're not as open and user friendly as Android - http://www.naic.edu/~astro/remote_ios.html
If this article is to be believed then ssh tunnelling is probably not going to work on your iPhone without jail breaking.

Richard S.

DominusPi
Posts: 39
Joined: Mon Nov 18, 2013 5:31 pm

Re: Need help to use RPi as proxy

Wed Mar 19, 2014 8:06 pm

Thanks for your help !
I will look into that :D
Cheers !

Return to “Networking and servers”