Bypassing Censorship with OpenWRT and Zapret
By Taha • 4 minutes read •
- Censorship has become a major issue affecting Internet freedom worldwide in today’s digital age. Various tools and techniques have been developed to counteract these restrictions and allow users to access blocked content. One of these tools is Zapret. It is an independent DPI bypass tool written to combat the censorship imposed by Roskomnadzor in Russia.
How to Install Zapret
- This guide will show you how to install and configure Zapret on your OpenWRT router to bypass censorship and access blocked content. If you are not using OpenWRT, you can follow the this guide to install Zapret on your computer.
Step 1: Install Required Packages
- Open to your OpenWRT router’s web interface and navigate to the
System
tab. Click onSoftware
and search for the following packages:git
git-http
ncat
vim
Step 2: Connect to Your Router via SSH
Open your terminal and connect to your OpenWRT router via SSH using the following command:
Step 3: Clone the Zapret Repository
I recommended to clone the Zapret repository with the
--depth=1
flag to reduce the download size. First, navigate to the/opt
directory and clone the repository using the following commands:
Step 4: Change DNS Server Settings
Some ISPs use DNS poisoning in combination with DPI bypass to block access to certain websites. To bypass this, you need to change your DNS server settings to a healthy alternative. To change your DNS server settings, run the following command:
Press
i
to enter insert mode and convert all lines to comment lines. Add the following line to the last line.This is what the file should look like when you’re done.
Save and exit the file by pressing
Esc
and typing:wq
.
Step 5: Run the install_prereq.sh Script to Install Prerequisites
After cloning the repository and changing the DNS server settings, you need to install the prerequisites for Zapret. Run the following command to install the prerequisites:
OpenWRT uses nftables by default. Select nftables in firewall questions.
Step 6: Get the Required Compatible Binaries and Extract Them
Get the required compatible binaries from the Zapret GitHub repository. Copy the link of the latest release.
Then, run the following command to download and extract the binaries:
Then move the binaries to
/opt/zapret/binaries
directory:Then remove the temporary directory:
Step 7: Run the install_bin.sh Script to Install the Required Compatible Binaries
Run the following command to install the required compatible binaries:
Step 8: Run the blockcheck.sh script to Find the Appropriate Zapret Parameters
Run the following command to get the best parameters for your ISP:
The blockcheck.sh script asks for the address of a blocked site. Discord is blocked in my country, so I enter the address of a blocked subdomain. Enter the address and leave the other questions with their default answers.
The script will give us the following parameters when the scan is finished. I have to censor these. Note the last line parameter.
Step 9: Run the install_easy.sh Script to Install the Zapret Services
Run the following command to install the Zapret services:
OpenWRT uses nftables, so we choose nftables here
We activate nfqws
Press Y to change the default nfqws parameters.
Delete the selected fields and paste the parameter from step 6.
If you set it right, you should see this.
Conclusion
- Well Done! If you have followed all the steps correctly, you have successfully installed and configured Zapret on your OpenWRT router. You can now bypass censorship and access blocked content with ease.