20 June 2012

use freegate on macbook from ipad/iphone: a rough guide

First you have to get freegate working on your mac, which I now realize I never wrote an entry for and was another day-long process. I'll do that later, but for now let's assume that you got it working. All you need to do is type one command in terminal. Yours may differ slightly, but here's something similar to what I entered:

sudo ipfw add fwd 127.0.0.1,8580 tcp from any to 192.168.0.100 8580

this assumes one important thing: you can run commands as a superuser. see sudo. and props to serverfault for giving me the answer i needed.

you really only have to change one part "192.168.0.100" to get this working. simply change the 192.168.x.x to the ip address of the computer that is RUNNING freegate. you probably want to change "any" for security reasons, but you don't have to for it to work correctly.

ipfw - the command to call ipfw where your computer's firewall and port forwarding rules are. you can have it list what rules your computer currently applies with "ipfw list" or as we do here, you can add rules.

add fwd 127.0.0.1,8580 - this simply forwards requests to port 8580 of server 127.0.0.1 which is what freegate sets as its default address for the proxy server.

tcp - is the protocol. you dont have to worry about this.

from any - defines who or what devices (i.e. your ipad/iphone) your computer will allow to communicate with freegate. if you want to restrict those who access freegate, you may want to change "any" to something like "192.168.0.0/16" which is most likely someone within your home network. by the way, that 192.168.0.0/16 is CIDR notation whose meaning took me forever and a half to find.

to 192.168.0.100 8580 - again, this is the ip of the computer that is running freegate, whatever it may be for you. 8580 is the port it is accepting connections over.

finally, go into your ipad or iphone's wireless settings and setup manual HTTP proxy. in the server portion, just enter the ip of the computer that is running freegate. in my case it is "192.168.0.100" and in the port enter "8580". that should do it for you.

final thoughts: this literally took me all night to figure out, but the free App Store options were dismal so I had no other choice. for someone with more networking knowledge, this would have taken about five minutes. i spent a considerable amount of time mucking around with apache settings and reading a lot of man pages, then messing around with many other programs. it turns out that it was all way more complicated than necessary. i did stumble across WaterRoof and IceFloor which turned out to be exactly what I need but I wanted something more simple.

i didn't even know how to go about looking for what 192.168.x.x/24 meant at first, so guess i learned quite a bit about OS X's ipfw and networking.

No comments:

Post a Comment