How to bypass VPN restrictions
Intro
I as you know have a VPS where i self-host most of services i use (https://en.esmailelbob.xyz/src/pages/services.html also feel free to donate so i can keep the server running https://en.esmailelbob.xyz/src/pages/donate.html) and i installed pihole for personal use and as you know i need a VPN connect so i do not be open resolver online and ANYONE use my dns server and living in a country like mine with lots and lots of internet filters and most of VPN companies along side tor browser and of course wireguard and openvpn themselves blocked too. It's basically impossible to use pihole and vpn (ideally pivpn) to connect to my pihole server. So first as you might now i used udp2raw which is a great application and it worked with me but for a week or two then i noticed i really can't use it anymore so i had to ask more and search more (mostly chinese of course) and if you know me i got bad English language so imagine my Chinese one. So thanks on kind redditors and for u/SodaWithoutSparkles i started to try new applications including v2ray, shadowsocks and wireguard. I first found a script which done an amazing job to install 3 of them but i found out that i do not need all of them actually, i just need shadowsocks so yup as always i get a problem so i search for it then i find more than one article so i try to glue them then i write my own article in hope it helps someone else! and if you are the unlucky one who my article did not help. Cheer up! you are the next me who is going to take an adventure online to find your own articles and glue them together and who knows maybe you write your own and add my blog as sources in your article 😀___
Setup – Shadowsocks – Server side!
We first need to install shadowsocks and i will assume you are using Debian 11 OS so simply run:
sudo apt install shadowsocks-libev
Then create a
json
file (not Jason) so I will create a config.json
in /etc/shadowsocks-libev/
sudo nano /etc/shadowsocks-libev/config.json
And paste:
{
"server":["::0","0.0.0.0"],
"server_port":8388,
"method":"chacha20-ietf-poly1305",
"password":"MY BIG FAT PASSWORD",
"mode":"tcp_and_udp",
"nameserver":"127.0.0.1",
"fast_open":false
}
server
: Not sure what it means but i think on server side it means listen to all portsserver_port:
Port number we will connect to, Feel free to change it in case this port blocked in your countrymethod
: What encryption we are using, not sure why we chose this so here you go: https://gfw.report/blog/ss_tutorial/en/#q-why-do-you-use-chacha20-ietf-poly1305password
: our password so we can connect to our shadowsocks server – Use something complex. Maybe run openssl rand -base64 16
to get good passwordmode
: not sure but i think we can accept both tcp and udp by thisnameserver
: our dns server, if you are using pihole on same VPS with shadowsocks then you can set it to localhost (127.0.0.1)
fast_open
: not sure what it does so: https://gfw.report/blog/ss[i]tutorial/en/#q-why-do-you-disable-fastopen[/i]Firewall
If you are using firewall (which is really something you should use to protect your server) like ufw
you need to unblock same port used for shadowsocks in our case it's 8388
sudo ufw allow 8388
SOYSTEMD
Now we are done and we can enable shadowsocks as systemd service
sudo systemctl enable shadowsocks-libev
sudo systemctl start shadowsocks-libev
Setup – Shadowsocks – Client Side (your computer)
This step really changes from different systems and OSes of course but as i right now using Artix (btw) i will use v2ray desktop
because it got gui and it's kinda simple to use.
So if you are on arch linux, install v2ray desktop:
yay -S v2ray-desktop
Yes i use yay shutup, i like to type yay each time
Then we go to servers
tab on left sideThen click on Add new server
And select Shadowsocks from drop menu aboveThen fill data as it's described in photo (and click on Add new server
button):Then right click and click connect:At the end, go to settings tab and make sure to set dns to 127.0.0.1
it's not required but it's a protective measure!
Then at system tray of v2ray desktop you need to right click and check socks proxy and global proxy options and then you can set proxy of your applications as you like. The IP will be 127.0.0.1
the port will be 1080
(defualt) and select socks 5 (or http if you would like but select it from v2ray menu first!)
After everything is set you should see 'You can access the free internet':___
Conclusion
At the end, if you get any weird problems you can check looks in v2ray desktop
at logs tab
I still looking into a way to use split tunnling just like i did with wireguard so i do not need to use my VPS's IP address all the time and use VPN when i need VPN but most of time i use it for DNS only so i'm still looking into this to only query DNS and nothing more and i will update this blog onces i find the way!
Sources ❤
- https://gfw.report/blog/ss_tutorial/en/ i recommend to keep an eye for this for updates!
- https://upcloud.com/community/tutorials/install-shadowsocks-libev-socks5-proxy/
How to install Shadowsocks-libev SOCKS5 proxy server
Shadowsocks-libev is a lighter and faster open-source port of the Shadowsocks SOCKS5 proxy ideal to protect privacy on the Internet.UpCloud
Lo, thar be cookies on this site to keep track of your login. By clicking 'okay', you are CONSENTING to this.
Esmail EL BoB :dinosaur:
in reply to Blog • • •