Create Anonymous Squid Proxy For Iranian Election Protestors

By | 2009/06/18

As I’m sure is the case with the rest of you (particularly if you use Twitter), I’ve been hearing more and more about the Iranian Election and the difficulties the people there are having in getting connectivity outside of the country. Without getting too detailed, it sounds like the incumbent president has cut off internet access to most major social networking sites. Sites that the protestors were trying to use to organize peaceful rallies and request recounts on the polls.

If you are interested in helping them fight to have their voices heard you can setup a Squid Proxy which will allow them to anonymously access Facebook, Twitter, YouTube and other such sites in order to organize and move forward. I have already personally setup and volunteered two proxies. The more that are available the better chance these people will have to continue to communicate with the outside world. If you would like to help out, please keep reading for instructions on how to setup a proxy and securely communicate the details to supporters inside Iran.

Note: please only configure and volunteer proxies for servers and internet connections that you own. Please do not run these on corporate or educational internet connections unless you have express permission.

Installing Squid

By following these instructions you should be able to have a Squid proxy available for use within just a few minutes. Even if you have setup Squid in the past, please make note of these customized instructions. The include access control restrictions to disallow Iranian government offices, and have logging disabled for anonymity.

To install squid use the command (or click on the link):

sudo aptitude install squid

Finding Your Public IP Address

You will need to document your public IP address for the configuration and for use by the protestors. You can find your public IP address by visiting the site: Make note of the address as you will need it for the configuration below.

Configuring Squid

We’ll now customize three things within the squid configuration.

  1. Select a random port other than the default of 3128
  2. Define access control list to allow Iranian subnets
  3. Disable logging for anonymity of Iranian users

Open your squid configuration file, which is found in /etc/squid/squid.conf and search for the line “http_port 3128”. Change the port number to a different, random port. Do not use the following port numbers: 81/8080/8181/9090/3218. These are globally blocked within the country.

Next we’ll define the access control restrictions. What this will do is allow proxy access to the Iranian residential address ranges but not include the government offices. It will also block all other use of your proxy.

Search for the line beginning with “# INSERT YOUR OWN RULE(S)” and add the following on the next blank line:

acl TRUSTED src

http_access allow TRUSTED
http_access deny all

access_log none
cache_store_log none

visible_hostname <your public IP>

Once you have saved these changes run the following two commands to activate things:

sudo squid -z
sudo /etc/init.d/squid start

If you don’t see any errors you should be ready to go. You can now submit your public IP address and random port to the following email addresses for secure propagation within Iran.

[email protected] andΒ [email protected]

I hope you are able to volunteer toward this cause. The stories that I have read and the videos and images I have seen show a real injustice is going on in that country. There are many young people who are trying to vote in a real Democratic election, yet their votes are being ignored and their voices are being silenced. If you believe that Freedom is something we all deserve, get involved.

You can find more information and inside updates here here and here.

29 thoughts on “Create Anonymous Squid Proxy For Iranian Election Protestors

  1. Anon

    you brought tears to my eyes. thank you! thank you! thank you!

  2. dflock

    Presumably I would I need to do something with port forwarding on my NAT router to make this squid proxy available to the outside world?

  3. BhiWallace

    Please keep this Ubuntu away from this. Or, at least verify facts before getting involved. What “real injustice”, what “votes being ignored”? There are many thousands of Iranian students living all around the world, and a fair number of Iranian expatriates, who can shed much light on the dark mobs in Tehran. Look, it was only a few days ago that Obama finally admitted in public that the US paid for the 1950s mobs in Iraq. Is it not obvious that this is the same in 2009? Anyway, please keep Ubuntu out of it.

  4. lmn

    GREAT tutorial! I am in the process of making one for Iranian protesters. I was wondering is there a way to make it https? Cuz I heard that https can not be blocked (is it true?). Also the part that you said we have to paste those subnets, does that mean only IPs from Iran can access the proxy? And how/where did you gather all the subnets for Iran only?

    Tnx again for this GREAT tutorial. πŸ™‚

    1. Christer Edwards Post author

      A Squid proxy will transparently manage https sites, but it is not a feature (at least one that I'm aware of) to make Squid itself https. Yes, the acl TRUSTED section of the article will only allow Iranian addresses to use your proxy (as opposed to the entire world), and those addresses were taken from other sites sharing similar proxy instructions. There are public sites out there where you can find which internet subnets are assigned to which countries however. I'm sure that data was pulled from there.

  5. G-A-C

    Just a thought, is this not similar to what TOR is supposed to do? I'm not in a situation to offer a proxy (the only machine I have only has 256mb of RAM so not much use for a Squid proxy as well as the other little bits it does), but if people downloaded something like TORPark or similar then this should offer them end-to-end encryption (everything's encrypted until it leaves a TOR exit node, I believe) meaning that it's more likely to make it out of the country (surely they could put pressure on ISPs to block these anonymous proxies as they crop up since they would in theory be able to track which IPs are being used as proxies).

    Unless of course they just put a blanket ban on encrypted traffic leaving the country altogether πŸ™

  6. G-A-C

    Apparently this is the replacement for TorPark; runs over the onion network for the browser and also provides a local SOCKS proxy to run other things over it such as IM clients. Maybe people could also run exit nodes as well as proxies and help in this way?

  7. a bit anonymous

    is there a way to get to know when people are using it?

  8. jefri

    thanks but right now , when I write this message many people kill by police in Enghelab street , please seed this news

  9. Nima

    Thank you very much.
    But they've implemented some mechanisms that block sites even if you use http proxies after some freely browsing! Some firewalls monitor the content of packets and mangles encrypted packets. Therefore we can't even connect via ssh to our servers out of Iran! No HTTP tunneling, No VPN s, No HTTP Proxies, those simply don't work. We constantly get timeouts after connecting to a vpn/ssh server! πŸ™

  10. Shad

    Can anybody send me the already configured file (squid.conf.default) to [email protected] ? Thank you for your help and support for Iranian people

  11. farz

    is the above mentioned change incorporated to the instructions above?

  12. A user

    A big problem. The filters used by the Iranian government are actually clever enough to realize the proxy request to 'blocked' sites and filter them out before it reaches the proxy server. A new method to encrypt the communication is needed!

  13. NativeSonKY

    I have been trying to use TOR/Vidalia on WinXP but my ISP ( will not allow open communication – am getting a lot of *Warning* lines in the Message Log…am I helping? I sure wish I could but my ISP support says "No Open Ports" for residential connections in its TOS Agreement, so they have me over a barrell. Anyone with tips which can help me please do.

    NativeSonKY at Twitter

  14. Needs Help

    How do we run the two comands at the bottom? I'm a little confused. And does this work on a wirless computer becuase somewhere I heard it didn't?

  15. aliasghar

    Some one from Iran.
    Great to whom concern about Freedom.
    You all have your share hold in moving freedom toward.

  16. James Matthew

    "If only you had presented the tutorial without editorial comments, as simple knowledge available to all freely! One wonders those who do not energetically protest stolen elections elsewhere such as in the USA 2000 and 2004, are so obsessed with Iran … so obsessed, as to simply ignore all verifiable facts let alone the desires of Iranians as a people, in favor of a smear campaign presented without a shred of evidence."

    Your prose reads the way Rush Limbaugh's talks.. *shudder*..
    you ought to try a little harder, Wallace, you'll convince no one here with such a pithy effort

  17. James Matthew

    I have heard this no where else.. could you elaborate?

  18. Ubuntu

    Do you think it is anonymous proxy.I think this is a transparent proxy.Correct me if I am wrong

  19. Ronko


    Is there no risk there are proponents of the old Shah’s regime among these protesters? They were ousted, after all. You would not want to let them use your proxy. Maybe it is better tol og the traffic after all, in case police come knocking on your door

  20. furniture

    I agree, about the Iranian government is actually clever enough to realize the proxy request to 'blocked' sites and filter them out before it reaches the proxy server. We need a new method to encrypt the communication.

  21. sam

    somebody give me a proxy i am filterd

  22. vahid

    I’m from Iran and would like to thank all the people who care about us.

    I believe internet censorship in Iran is even worst than China, the government puts many levels of filtering and even packet inspection and logging on traffic. It’s getting worse and worse everyday. They want people to hear just only what they say and nothing else.

    I appreciate all efforts on internet freedom.
    Thank you.

  23. hesam

    I need proxy site.please help me

  24. David Nerd

    can u send me a proxy
    this school that im in doesnt want any student on facebook but thats the only way i can communicate with my family so since ive been in this school i havent talk to my family in a year

Comments are closed.