Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
vpn_client [2020/07/28 23:40] – created lbrpdx | vpn_client [2024/01/28 00:57] (current) – add note in tailscale setup section to access resources behind a tailscale subnet router cs | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | =====OpenVPN client===== | + | ====== OpenVPN client |
You can easily connect your Batocera to a VPN, as we ship OpenVPN with the distribution. However, it requires some manual configuration, | You can easily connect your Batocera to a VPN, as we ship OpenVPN with the distribution. However, it requires some manual configuration, | ||
- | In this example here, I will be connecting a Batocera 5.27 client to a [[https:// | + | In this example here, I will be connecting a Batocera 5.27 client to a [[https:// |
- | ====OpenVPN configuration==== | + | ===== OpenVPN configuration |
* Create a new folder for your OpenVPN configuration with '' | * Create a new folder for your OpenVPN configuration with '' | ||
- | * If your VPN provider offers you pre-configured openVPN configuration files download them in that directory. With NordVPN, I can get access to those files with: | + | * If your VPN provider offers you pre-configured openVPN configuration files download them in that directory. |
+ | |||
+ | With NordVPN, I can get access to those files with: | ||
cd / | cd / | ||
Line 14: | Line 16: | ||
rm ovpn.zip | rm ovpn.zip | ||
- | * Then, you need to create a new authentication file ''/ | + | With PIA: |
- | {{ : | + | cd / |
+ | wget https:// | ||
+ | unzip openvpn.zip | ||
+ | rm openvpn.zip | ||
+ | |||
+ | |||
+ | * Then, you need to create a new authentication file ''/ | ||
+ | |||
+ | {{: | ||
* Select the VPN server you want to connect to, and find the associated openVPN configuration file. For example here, I want to connect to a VPN hosted in France, and will select the configuration file ''/ | * Select the VPN server you want to connect to, and find the associated openVPN configuration file. For example here, I want to connect to a VPN hosted in France, and will select the configuration file ''/ | ||
- | auth-user-pass / | + | auth-user-pass / |
* Save the file... and now your VPN configuration is done! To connect to the VPN, just launch the command line: | * Save the file... and now your VPN configuration is done! To connect to the VPN, just launch the command line: | ||
- | openvpn / | + | openvpn / |
+ | |||
+ | Similarly with PIA: | ||
+ | |||
+ | openvpn / | ||
+ | |||
+ | ===== Automatically launch the VPN when Batocera boots ===== | ||
+ | |||
+ | It is possible to turn on the VPN with Batocera' | ||
+ | |||
+ | Add the following file to ''/ | ||
+ | |||
+ | <file bash custom.sh> | ||
+ | # | ||
+ | |||
+ | if test " | ||
+ | then | ||
+ | exit 0 | ||
+ | fi | ||
+ | openvpn / | ||
+ | </ | ||
+ | |||
+ | where ''< | ||
+ | |||
+ | ===== Tips and tricks ===== | ||
+ | |||
+ | * You can verify that you are correctly connected to the VPN by checking your public IP address before and after '' | ||
+ | * If you want to start up your VPN connection every time Batocera boots, you can add the command '' | ||
+ | |||
+ | ===== Troubleshooting ===== | ||
+ | |||
+ | ==== It's not working! ==== | ||
+ | |||
+ | First thing is to just check that your script is running in the first place. This is easy, just put something like: | ||
+ | |||
+ | < | ||
+ | test line >> / | ||
+ | </ | ||
+ | |||
+ | in the script and then search for ''/ | ||
+ | |||
+ | === The script is running but the VPN is still not working! === | ||
+ | |||
+ | It could be that it's a problem with the VPN itself launching from the script. Even if the command works in SSH, running it from a script could be an entirely different story. In order to see the error code outputs from what the command would be doing (for example from openvpn): | ||
+ | |||
+ | <file bash custom.sh> | ||
+ | # | ||
+ | |||
+ | if test " | ||
+ | then | ||
+ | exit 0 | ||
+ | fi | ||
+ | |||
+ | (openvpn / | ||
+ | </ | ||
+ | |||
+ | Adapt the ''< | ||
+ | |||
+ | ==== My VPN works fine on my PC but not on my Raspberry Pi/other SBC! ==== | ||
+ | |||
+ | The ARM build of Batocera does not include the necessary ''/ | ||
+ | |||
+ | <file bash custom.sh> | ||
+ | # | ||
+ | |||
+ | if test " | ||
+ | then | ||
+ | exit 0 | ||
+ | fi | ||
+ | |||
+ | if [ ! -d /dev/net ]; then | ||
+ | mkdir -p /dev/net | ||
+ | mknod / | ||
+ | chmod 600 / | ||
+ | fi | ||
+ | |||
+ | openvpn / | ||
+ | </ | ||
+ | |||
+ | Adapt the ''< | ||
+ | |||
+ | ====== Tailscale VPN configuration ====== | ||
+ | |||
+ | While not packaged with Batocera by default, the Tailscale VPN service (which is essentially a fancy wrapper for Wireguard and has a free tier) can be added and functions on both the x86 and ARM-based versions of Batocera. This can provide you with benefits including [[netplay|Netplay with Retroarch cores]] and multiplayer on PPSSPP standalone without needing port forwarding, as well as the ability to SSH or SCP into your device from another network. There are some extra steps if you are on an ARM-based single-board computer, but it is confirmed working on Batocera versions as early as V31 and tested with both 32-bit and 64-bit boards (the Odroid XU4 and the Odroid N2L, respectively). You should have an account made with Tailscale ahead of trying this. | ||
+ | |||
+ | * Download a Tailscale build from the static binaries section (if using an SBC, grab the one that matches your CPU architecture. ARM for the tested XU4 and ARM64 for the N2L): https:// | ||
+ | * On your Batocera computer, create the directory / | ||
+ | * Create a file called " | ||
+ | |||
+ | <file bash custom.sh> | ||
+ | # | ||
+ | |||
+ | if test " | ||
+ | then | ||
+ | exit 0 | ||
+ | fi | ||
+ | / | ||
+ | </ | ||
- | ====Tips and tricks==== | + | * **IF YOU ARE ACCESSING RESOURCES BEHIND A TAILSCALE SUBNET ROUTER:** By default, Tailscale clients specifically for Linux do not accept routes advertised by subnet routers. If you wish to access resources in the subnet router' |
+ | * Using the above script block as a reference, the last line will look like this if you want to enable this feature: | ||
- | * You can verify that you are correctly connected to the VPN by checking your public IP address before and after '' | + | < |
- | * If you want to start up your VPN connection every time Batocera boots, you can add the command '' | + | /userdata/tailscale/tailscaled -state |
+ | </ | ||
+ | * **IF YOU ARE USING AN ARM SBC:** You need to use WinSCP or another program with this function to check that the tailscale and tailscaled files in / | ||
+ | * SSH to your Batocera computer with PuTTY or another program, or access Batocera' | ||
+ | < | ||
+ | / | ||
+ | </ | ||
+ | * Tailscale will present you with a web link in the terminal, which you need to type into a separate PC's browser. From there, you'll log into Tailscale' | ||
+ | * In the Tailscale web UI, click the " | ||
+ | * You should see the " | ||
+ | To add your friends to the same Tailscale network for multiplayer (who can be running non-Batocera versions of PPSSPP like Android for that use case), you can go through this process yourself and authenticate their devices by logging in as yourself, or you can invite them to join your Tailnet. Note that the free version of Tailscale only allows you to add two other people to your network, but if you sign in as yourself on all the devices, you can get as many as 100. |
- vpn_client.1595972433.txt.gz
- Last modified: 4 years ago
- by lbrpdx