How To Hide Your VPN Connections In China, Iran, United Arab Emirates, Oman and Pakistan

Best VPN Iran

There are several countries around the world that heavily censor the internet (China, Iran, UAE, Oman, Pakistan, etc.). Typically, they block the internet using two techniques:

  • Firewall Blocks (simple rules that block traffic to particular websites (e.g. YouTube, Twitter)
  • Deep Packet Inspection (examining the traffic leaving your computer, in order to detect if you are using a VPN for example)

Let’s examine how to avoid these two censorship techniques:

Avoiding Firewall Blocks

You can avoid simple Firewall Blocks by making use of a VPN (virtual private network). This is the simplest and most reliable method of hiding your internet traffic. You may need to be creative about which protocols to use. In many cases OpenVPN will be blocked, but you can use a protocol like L2TP instead.

Here are the VPNs I recommend: The Best VPN Providers.

Your may find that your VPN connections are being blocked — in these cases you may be up against a more sophisticated firewall.

Avoiding Deep Packet Inspection

“Deep Packet Inspection” is usually done at the ISP (internet service provider) level, on behalf of a government. A “packet” is a chuck of computer data that is sent over a network. Packet Inspection involves examining your internet traffic and trying to determine what you are doing (for example using a VPN).

To avoid Deep Packet Inspection, you must hide the fact that you are using a VPN. One of the simplest way to do this is to forward your OpenVPN traffic through port 443. OpenVPN uses port 80 by default, and this port is usually heavily monitored by firewalls. When you switch to port 443 your traffic will be camouflaged. This is because 443 is the default port for HTTPS, and this protocol is heavily used by web browsers for secure connections. Whenever you see “https” in a web browser address (for example while access an online bank or access web-based email) your browser is using a HTTPS connection on port 443.

So using port 443 makes a lot of sense, because it is very difficult to detect your traffic amongst all the other secure traffic on this port.

However, some governments (China, Iran) are now using methods to detect the difference between “normal” SSL encryption and VPN encryption. In cases like this you will need more sophisticated cloaking techniques (see below).

Avoiding Advanced Deep Packet Inspection

There are several ways to avoid advance deep packet inspection, but they will probably require co-operation from your VPN providers, and they will slow down your internet connection.

Commonly used techniques include:

  • Using the Obfsproxy tool
  • Using OpenVPN through an SSL tunnel
  • Using OpenVPN through an SSH tunnel

Using Obsfsproxy

Obfsproxy is a tool designed to make VPN connections difficult to detect. It was created by the Tor network when China started blocking Tor nodes — but it can be used outside of the Tor network to mask VPN connections.

To use Obfsproxy, you must install it on your computer, and it must be installed on the VPN server you are connecting to. In most cases, you’ll have to ask your VPN provider to set it up.

Obfsproxy does not encrypt your traffic, but it also does not require much overhead, so if it is useful in countries where bandwidth is limited (e.g. Syria or Ethiopia).

There are instruction for setting up Obsfproxy with OpenVPN on this page.

Using OpenVPN through a SSL tunnel

Another method of avoiding Advance Deep Packet Inspection, is use OpenVPN through a SSL tunnel, to wrap you data in another layer of encryption. This makes your OpenVPN traffic virtually indistinguishable from regular SSL traffic, because Deep Packet Inspection cannot penetrate this addition layer of encryption.

Typically, you’ll want to install stunnel application, and get your VPN provider to install the stunnel application too.

One provider — AirVPN does this by default, they state:

We offer OpenVPN on ports 80 TCP / UDP, 443 TCP / UDP and 53 TCP / UDP. Additionally, every Air server supports directly OpenVPN over SSH and OpenVPN over SSL. This means that even the most brutal techniques of monitoring, censorship, throttling and traffic shaping will fail against AirVPN, because your ISP and your government will see only TCP or UDP traffic (as you prefer) on a unique port.

Please not that using a SSL tunnel will slow down your internet connections.

OpenVPN through an SSH tunnel

Using OpenVPN with a SSH tunnel is very similar to using it with a SSL tunnel. The difference is that you wrap your OpenVPN traffic with SSH encryption instead of SSL encryption. SSH is the “secure shell” software used to make connections to shell accounts in Unix. You can find SSH clients for most operating systems — see PuTTY for example.

VPN.AC and  AirVPN also supports SSH tunneling by default.


  1. rm says

    hi again, sorry for commentfailure, i have a quastion aboout another software, i have an vpn privider which offer 3 connectionclient, i can use openvpn shrew and cisco anyconnect, the last option cisco anyconnect uses tls over 443, if i use this software to connect to the vpn servers in countries like iran or china, which shape would see my isp from my traffic, will he see that im using vpn ? and i have another quastion about anyconnect itself, this software uses rc4 to encrypte the traffic, is this option still safe or is it broken ? and if its broken, what can i do to still use anyconnect with a safe configuration ? thanks a lot ! :-)

  2. Brad says

    have a question for you. I’m looking for a Vpn service that will work in Iran where censorship is strong. has recommended Xor obfuscation for openvpn and airvpn has recommended openvpn through SSH and SSL tunneling. Which scenario is going to work better in a country with heavy censorship?


    • web master says

      Both of those methods could potentially work — OpenVPN via SSL/SSH can be more covert. The idea is to make VPN traffic appear like regular traffic, as much as possible.

  3. someone says

    In my practical experience, I think China has no ability to detect OpenVPN protocol, because I am using OpenVPN, our own servers.

    I’ve noticed that damm China might be able to detect your OpenVPN by using their new FBBH( Fiber to the Home) modem. This modem is also a router. For example, we are using( or assigned ) HG8245C

    When we are assigned by the HG8245C, our OpenVPN is quickly detected and blocked soon, and then we change the IP. Soon, sometimes in 1 day, they block it again.

    Then, I telnet into the HG8245C and decrypt the super password. Then, I login HG8245C as super admin. I’ve noticed there is a weird Vlan called TR069. Delete it, then your OpenVPN will work!!

    • Courtney says

      This is exactly what I was trying to find. I just moved a we house, and before I moved my interior fine and fast. The day he came to install my internet, I noticed that modem, which I never had before, and ever since then, my internet has been slow and my vpn has not be able to connect or maintain a stable connection. I want to throw this modem out the window. I knew it wasn’t my vpn that was the problem, I knew it had to be that stupid modem. Could you please tell me how you did what you did to get your internet working normally again?

      • Courtney says

        I have logged into the modem through telnet. I’m trying to obtain the superuser and superpassword and that is where I’m stuck. I thought I could grep the xml file to obtain them but I don’t know what to type in. Could you please help? Thank you so much!

  4. says

    Great article and very educational. I’m in China and having a very tough time finding a reliable VPN. I’m going to try AirVPN or VPN.AC, thanks to your help. I hope one of them works!

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>