diff options
author | Christian Cleberg <hello@cleberg.net> | 2024-04-29 14:18:55 -0500 |
---|---|---|
committer | Christian Cleberg <hello@cleberg.net> | 2024-04-29 14:18:55 -0500 |
commit | fdd80eadcc2f147d0198d94b7b908764778184a2 (patch) | |
tree | fbec9522ea9aa13e8105efc413d2498c3c5b4cd6 /content/blog/2023-01-23-random-wireguard.md | |
parent | d6c80fdc1dea9ff242a4d3c7d3939d2727a8da56 (diff) | |
download | cleberg.net-fdd80eadcc2f147d0198d94b7b908764778184a2.tar.gz cleberg.net-fdd80eadcc2f147d0198d94b7b908764778184a2.tar.bz2 cleberg.net-fdd80eadcc2f147d0198d94b7b908764778184a2.zip |
format line wrapping and fix escaped characters
Diffstat (limited to 'content/blog/2023-01-23-random-wireguard.md')
-rw-r--r-- | content/blog/2023-01-23-random-wireguard.md | 54 |
1 files changed, 26 insertions, 28 deletions
diff --git a/content/blog/2023-01-23-random-wireguard.md b/content/blog/2023-01-23-random-wireguard.md index 6100ea3..1b42a3f 100644 --- a/content/blog/2023-01-23-random-wireguard.md +++ b/content/blog/2023-01-23-random-wireguard.md @@ -7,18 +7,18 @@ draft = false # Mullvad Wireguard -If you\'re using an OS that does not support one of Mullvad\'s apps, -you\'re likely using the Wireguard configuration files instead. +If you're using an OS that does not support one of Mullvad's apps, you're +likely using the Wireguard configuration files instead. -If not, the first step is to visit Mullvad\'s [Wireguard configuration -files](https://mullvad.net/en/account/#/wireguard-config) page and -download a ZIP of the configuration files you want to use. +If not, the first step is to visit Mullvad's [Wireguard configuration +files](https://mullvad.net/en/account/#/wireguard-config) page and download a +ZIP of the configuration files you want to use. -Personally, I downloaded all configuration files across the world and -chose my connections using the script below. +Personally, I downloaded all configuration files across the world and chose my +connections using the script below. -Once the files are downloaded, unzip them and move them to your -preferred location: +Once the files are downloaded, unzip them and move them to your preferred +location: ```sh cd Downloads @@ -28,8 +28,8 @@ mkdir ~/mullvad && mv ~/Downloads/*.conf ~/mullvad/ ### Creating a Script to Connect to a Random Host -Once you have a folder of Wireguard configuration files from Mullvad, -you can create a script to randomly connect to any one of the locations. +Once you have a folder of Wireguard configuration files from Mullvad, you can +create a script to randomly connect to any one of the locations. Start by creating a shell script - mine is called `vpn.sh`. @@ -37,10 +37,9 @@ Start by creating a shell script - mine is called `vpn.sh`. nano ~/vpn.sh ``` -Within this script, you can paste the following info. Note that I -specify `us-*` in my script, which means that it will only -consider US-based VPN locations. You can alter this or simply change it -`*` to consider all locations. +Within this script, you can paste the following info. Note that I specify `us-*` +in my script, which means that it will only consider US-based VPN locations. You +can alter this or simply change it `*` to consider all locations. ```sh #!/bin/sh @@ -55,8 +54,8 @@ ls /home/$USER/mullvad/us-** |sort -R |tail -n 1 |while read file; do done ``` -Once you\'ve modified the script to your liking, add executable -permissions and run the script: +Once you've modified the script to your liking, add executable permissions and +run the script: ```sh chmod +x ~/vpn.sh @@ -76,21 +75,20 @@ Printing new IP info: You are connected to Mullvad (server country-city-wg-num). Your IP address is 12.345.678.99 ``` -That\'s all there is to it. You can see your new location and IP via the -`printf` and `curl` commands included in the -script. +That's all there is to it. You can see your new location and IP via the +`printf` and `curl` commands included in the script. You can also go to the [Connection Check \| -Mullvad](https://mullvad.net/en/check/) page to see if you are fully -connected to Mullvad and if any leaks exist. +Mullvad](https://mullvad.net/en/check/) page to see if you are fully connected +to Mullvad and if any leaks exist.  # Disconnecting from the Wireguard Connection -If you forget which connection you\'re using, you can execute the -following command to see where Wireguard is currently connected: +If you forget which connection you're using, you can execute the following +command to see where Wireguard is currently connected: ```sh wg show @@ -99,15 +97,15 @@ wg show This command will show you the Wireguard interfaces and should output a connection like so: `interface: us-lax-wg-104`. -Once you have this, just disconnect using that files\' full path: +Once you have this, just disconnect using that files' full path: ```sh wg-quick down /home/user/mullvad/us-lax-wg-104.conf ``` -I have a TODO item on figuring out how to easily export an environment -variable that contains the configuration file\'s full name, so that I -can just execute the following: +I have a TODO item on figuring out how to easily export an environment variable +that contains the configuration file's full name, so that I can just execute +the following: ```sh # Ideal situation if I can export the $file variable to the environment |