As of recently, politics in countless countries decided to track everyone, willing to access whatever website they deem dangerous in the name of "protecting the children", as usual sigh.
Such websites include adult-content creation, but in some countries this extends to (or will be extended to) social media, some video games, and even this very website, GitHub.
Note
Most VPNs, like NordVPN, GhostVPN, Mullvad, etc are in reality proxies, as they do not offer a Virtual Network, tailscale on the other hand, works like your home router, but virtualized, meaning you get access to your own Virtual Private Network, VPN for short. But I digress...
The easy solution, is just to download a VPN, but this comes with some major drawbacks. First, you might want to choose a paid option, like NordVPN (not recommended), other bullshit company, or Mullvad (cheapest and safest), but this would be quite overkill if you just need to access a website a couple of times and for short periods. So instead, you might want to look at a free VPN, but those could be riskier, as they could sell your data, keep a traffic history, have ads, slow down your connection, forces you to use their sketchy app and more.
I've already given the solution in the title, but let me expend further on this.
You may or may not have heard of Tailscale, it's Virtual Private Network provider based on WireGuard. As the name implies, it allows you to connect devices from all over the world, and arrange them in a network, just like your home network, except it's virtualized. Lots of people, companies and others, uses it to put together their infrastructure, or access their home devices from everywhere in the world. For example, you may use tailscale to play a LAN only game with someone in another country, like minecraft LAN (so without hosting a server), you may also use it to access your NAS wherever you are, which is very useful when traveling. This obviously encrypts your connection in between, and has the benefit of giving you control on whoever can see and access your devices and resources, since you do not expose anything to the internet.
Another very cool feature of Tailscale, is its ability to route your traffic outside your Virtual Private Network, in laymen terms, it'll act as any other VPN service and proxy your connection through one of your nodes.
You may see where I am going with this, what if, we ran a tailscale node, on a free temporary VPS (Virtual Private Server), like Google Cloud's Console? Well, we get exactly what the title of this gist talks about, a temporary (as the Google cloud shell lasts for about 15 min after you disconnect) VPN (as in your connection gets proxied) which can help your access age restricted websites (Depending on where the Console is located, for me, it is in Belgium most of the time).
First you'll need a Tailscale account, and the client set up your machine, as well as a Google account.
- Once you have everything ready, open the Google cloud console, select or create a project if you don't have one already
- In the top right corner, click on the
Activate Cloud Shellbutton, to open a Google cloud console, a terminal should open at the bottom of your browser and allow you to type commands - Go to the tailscale admin console and click Add a new device → Linux server, make sure to make it ephemeral (that way it'll automatically go away after a few minutes once it disconnects) and to toggle use as exit node
Important
Make sure you toggled on use as exit node, since this is what is gonna proxy our connection and make it act as a regular VPN (see the first note)
- Click
generate install scriptand copy the end of the command, start after&&, it should look something like thissudo tailscale up --auth-key=tskey-auth-XXXXXX-XXXXXXXXXXXXXXXXXXXXXX --advertise-exit-node
Tip
On Windows and KDE plasma, you can press windows+V to enable the clipboard history, this will be very usefull later to copy paste multiple commands
-
Back in the Google Cloud console, copy and paste
curl -fsSL https://tailscale.com/install.sh | shin the terminal and press enter -
Do the same with
sudo tailscaled &>/dev/null &to start the daemon in the background
Note
For the techsavy out here, wondering why do that manually instead of running the systemD script, well google cloud console does not use systemd as it's init service, so we're stuck with running the deamon manually
-
Now you can paste back the end of the command we copied earlier in step 4 !
sudo tailscale up --auth-key=tskey-auth-XXXXXX-XXXXXXXXXXXXXXXXXXXXXX --advertise-exit-node, this will turn on our VPN :3 -
In your client (see the documentation here), you should now be able to use the Google cloud shell as exit node ! Its name should start with
cs-
Important
After this step, you'll get about 15 min of usage, as connecting to the exit node will cut your connection to the google cloud console
✨Congratulations !✨ You ran your very first VPN !
While it may seem daunting at first, be once you've done it a couple of times, you easily get the hang of it, furthermore, this is just the tip of the iceberg, you can do so much more with that newly acquired knowledge!! Instead of running your tailscale node on a temporary google cloud console, you could buy a Virtual Private Server and self-host your very own VPN, furthermore, this approach brings a few benefits:
- The tailscale client and server are free, and open source !
- Do not like the tailscale's control plane? Self-host your own with headscale, you can have the control over everything !
- No limit on devices ! That's right, tailscale allows free plans to have unlimited nodes in their tailnet (network), allowing you to connect all your devices to your VPN instance !
- And so much more ! File sharing, sharing your VPN to friends, protecting your infrastructure...
Nice tutorial !