Jump to content

Vpn

From postmarketOS Wiki

VPN

A VPN (Virtual Private Network) is a technology that creates a secure and encrypted connection over a less secure network, such as the Internet. VPNs are used to protect private web traffic from snooping, interference, and censorship.

There is an issue in ModemManger which will not route your GSM traffic through VPN, so VPN is only working over Wifi, carefully read the linked issue and test its solution. (Due a broken sim slot, i can not test this...please update this section after testing with sim/gsm).

Setup and Usage

OpenVPN

Via NetworkManager

1. Add your openvpn config to NetworkManager:

nmcli connection import type openvpn file ~/myconfig.ovpn

2. Add username to the imported config:

nmcli connection modify "myconfigname" +vpn.data username="myusername"

3. Launch it with asking for password:

nmcli connection up vpn "myconfigname" --ask

There is also the option to add the password directly to the config so we can enable vpn from sxmo networks menu (sometimes its a bit buggy!):

nmcli con modify "myconfigname" vpn.secrets "password=mypassword"

set the: cert-pass-flags=0 otherwise it will not work:

nmcli con mod "myconfigname" +vpn.data "password-flags=0"

OpenVPN

Via openvpn

Install OpenVPN support:

sudo apk add openvpn openresolv

if you trust protonvpn, install the dns leak fix (otherwise you have dns leaks and the vpn is worth nothing!):

sudo wget "https://raw.githubusercontent.com/ProtonVPN/scripts/master/update-resolv-conf.sh" -O "/etc/openvpn/update-resolv-conf"

sudo chmod +x "/etc/openvpn/update-resolv-conf"

There is another, yet untested dns leak fix.

Start vpn with configuration file:

sudo openvpn <config.ovpn>

Testing

To make sure your Vpn is doing what it should, visit ip.me and check your virtual location, visit vpntesting to check for dns leaks.

In Iran settings from here worked quite well... while the famous protonvpn was blocked.

Other Options

Wireguard

See this wiki page, keep in mind that wireguard is blocked by default in some networks e.g. Irancell

Tor

See this wiki page.

Yggdrasil

See here.