Jack Moore

Email: jack(at)jmoore53.com
Project Updates

OpenVPN with PIA

22 Jan 2021 » system configuration, meta, homelab

OpenVPN with PIA

OpenVPN Shell Script:

#!/bin/sh
route del -net 10.0.0.0 netmask 255.255.255.0 dev tun0
route del -net 10.0.1.0 netmask 255.255.255.0 dev tun0
route del -net 10.0.2.0 netmask 255.255.255.0 dev tun0
route del -net 10.0.3.0 netmask 255.255.255.0 dev tun0
route add -net 10.0.0.0 gw 10.0.1.254 netmask 255.255.255.0 dev eth0
route add -net 10.0.1.0 gw 10.0.1.254 netmask 255.255.255.0 dev eth0
route add -net 10.0.2.0 gw 10.0.1.254 netmask 255.255.255.0 dev eth0
route add -net 10.0.3.0 gw 10.0.1.254 netmask 255.255.255.0 dev eth0
openvpn --config /etc/openvpn/pia.conf

PIA Config:

client
dev tun
remote ip.address.here 1198 udp
remote ip.address.here 502 tcp
resolv-retry infinite
nobind
persist-key
persist-tun
cipher aes-128-cbc
auth sha1
crl-verify /etc/openvpn/crl.rsa.2048.pem
ca /etc/openvpn/ca.rsa.2048.crt
remote-cert-tls server
auth-user-pass /etc/openvpn/creds.conf
auth-nocache
comp-lzo
verb 1
reneg-sec 0
disable-occ
push "redirect-gateway local"
push "route 10.0.0.0 255.255.255.0 net_gateway"
push "route 10.0.1.0 255.255.255.0 net_gateway"
push "route 10.0.2.0 255.255.255.0 net_gateway"
route 10.0.0.0 255.255.255.0
route 10.0.1.0 255.255.255.0
route 10.0.2.0 255.255.255.0

Where creds.conf is 400 owned by root:

username
password

Daemon

sudo systemctl start openvpn@pia
sudo systemctl status openvpn@pia

Useful Commands

curl ipinfo.io/ip

https://medium.com/@cubxi/connect-to-private-internet-access-pia-vpn-with-openvpn-on-ubuntu-3f8091d61f24

© Jack Moore - This site was last built Fri 30 Aug 2024 12:31:24 PM EDT