I live in a country where wireguard, openvpn and other vpn protocols have been blocked. Tailscale and Cloudflare Tunnels don’t wok either. I do have a public ip and my router supports DMZ and port forwarding. For security concerns I’m not willing to forward ports. Is there any other method to use my VPS to forward traffic to my home server?
Maybe you can give Outline a try. It is based on shadowsocks a proxy tunnel with enough obfuscation to fly even under the radar of the GFW of Communist China.
Some time ago I’ve done a “public IP implementation” on my VPS when I was on mobile network (no public IP).
Basically set up IPSec/Wireguard on VPS and connect your router to it. Then setup EoIP over VPN between VPS and your router. Then add EoIP tunnel to your LAN’s bridge in your router.
Then setup all ports forwarding (using iptables) from your VPS to your router on LAN, so if you connect to your VPS using tcp80, it will be simply forwarded (NAT’ed) to your router. Except tcp22, for SSH to your VPS obviously…
And now you have yet another public IP lol.
This is not something you asked, but might give you some ideas.
So that setup effectively gives you an all-ports available connection (except 22) from your mobile device and anything that connects through it, like a laptop? The exit node would be the VPS.
Could I skip the home router and EoIP+VPN directly between mobile and VPS, for instance?
I am in a situation (restrictive firewall on ethernet/wifi, prefer personal mobile connection but it’s cgnat or something equally crap) this could be very useful for me.
Technically like this:
Anyone -tcp80-> vps -tcp80-> router -tcp80-> homeserver.
Exit of homeserver-originated traffic would be your router, not vps. Unless you specify custom routes in your router, then yeah, might be possible.
Also you don’t need EoIP tunnel at all, since it’s all in Layer4.
I’m surprised they block WireGuard, especially with a preshared key. That makes it essentially pure randomness over UDP. I’d assume they block popular VPN providers and tunneling services which makes it easier to block by blocking the setup process which is usually just HTTPS.
Have you tried a basic plain WireGuard between your home and your VPS, with a preshared key and using some other protocol’s port? Maybe like UDP on port 443 so it looks like QUIC?
Wireguard is not meant to bypass detection of any kind of Deep Packet Inspection technology. It’s also stated by the project website, under the Known Limitations sections.
https://www.wireguard.com/known-limitations/
There are many characteristics (except the handshake) which can make it stand out as a P2P or VPN(-ish) traffic, and then get blocked.
I haven’t tried this. Will do. When wireguard still worked i used to use this script to set it up.
Quick glance at the script shows it does randomize the port (but in the upper end of the space), but does not do preshared keys.
The PSK can hide the protocol better by not looking like a key handshake. Although I’m not sure ISPs have quite reached that level yet.
If you’re in China, there’s been some recent research showing that they block things that looks encrypted based on the entropy of the bits in a packet. I couldn’t find the bypass software anymore but that might help you as well.
If you’re not in China something like the XRay/v2ray proxy or shadowsocks might help as well.
Although honestly, port forwarding with a firewall only allowing your VPS IP should honestly be fairly sufficient security-wise. You could also try inverting the WireGuard connection and have the VPS connect to your home through port forwarding, traffic analysis is usually on egress not ingress.
If you live in a country with the regular vpn protocols being blocked, you will need to be more specific with a vpn that obfuscates the network connection. Something like Astril or expressvpn will both have tunnel obfuscation. At that point it’s less about hiding your activity, and more about gaining access to other sites because I wouldn’t vouch for the privacy on those two vpns.
ExpressVPN used to work but it got blocked too. I need a personal VPN solution to host on my own server. Currently we use Xray/V2ray to access restricted websites but they’re proxies, not proper VPNs.
Does ssh works? If yes, you can use autossh
to create persistent ssh tunnel to your VPS.