pia-foss / manual-connections

Scripts for manual connections to Private Internet Access
MIT License
645 stars 168 forks source link

Script doesn't seem to work on Ubuntu 24.04.1 LTS - Wireguard tools v1.20210914 #195

Open benhbell opened 1 month ago

benhbell commented 1 month ago

Fresh install of ubuntu and trying to get my wireguard and PIA command running.

sudo PIA_PF=false PIA_USER=xxxxxx PIA_PASS=xxxxxx PIA_DNS=true DISABLE_IPV6=yes AUTOCONNECT=false MAX_LATENCY=1 PREFERRED_REGION=nl_amsterdam PIA_PF=true VPN_PROTOCOL=wireguard ./run_setup.sh

The script ends in a failure.

IA_USER=xxx

PIA_PASS input received.

Checking login credentials...OK!

PIA_TOKEN=xxxx

This token will expire in 24 hours, on Mon 28 Oct 2024 02:32:59 PM EDT.

Do you want to use a dedicated IP token ([N]o/[y]es): n

DIP_TOKEN=none

PIA_PF=true

The variable DISABLE_IPV6=yes, does not start with 'n' for 'no'.
Defaulting to yes.

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1

IPv6 has been disabled, you can enable it again with: 
sysctl -w net.ipv6.conf.all.disable_ipv6=0
sysctl -w net.ipv6.conf.default.disable_ipv6=0

Region input is : nl_amsterdam

Getting the server list...OK!

The selected region is Netherlands.

The script found the best servers from the region you selected.
When connecting to an IP (no matter which protocol), please verify
the SSL/TLS certificate actually contains the hostname so that you
are sure you are connecting to a secure server, validated by the
PIA authority. Please find below the list of best IPs and matching
hostnames for each protocol:
Meta Services 181.214.206.4 -     amsterdam431
WireGuard     181.214.206.132   -     amsterdam431
OpenVPN TCP   181.214.206.151   -     amsterdam431
OpenVPN UDP   181.214.206.155   -     amsterdam431

Using existing token xxx

VPN_PROTOCOL=wireguard

PIA_DNS=true

Getting the server list...OK!

Using existing token xxxx

The ./get_region.sh script got started with
VPN_PROTOCOL=wireguard, so we will automatically connect to WireGuard,
by running this command:

$ PIA_TOKEN=xxx \
WG_SERVER_IP=181.214.206.132 WG_HOSTNAME=amsterdam431 \
PIA_PF=true ./connect_to_wireguard_with_token.sh

Trying to connect to the PIA WireGuard API on 181.214.206.132...
Server did not return OK. Stopping now.

I attempted to run use the GUI and set it to wireguard, and I notice that I get an error in the wg log

Unable to access interface wgpia0: Operation not permitted

But I successfully connect and I see that in wireguard

$ sudo wg show
interface: wgpia0
  public key: XXXXX
  private key: (hidden)
  listening port: 37803
  fwmark: 0x3213

peer: XXX
  endpoint: 181.214.206.221:1337
  allowed ips: 0.0.0.0/0
  latest handshake: 31 seconds ago
  transfer: 376.19 KiB received, 225.90 KiB sent
  persistent keepalive: every 25 seconds

I saw this ticket for arch-linux, and wondered if it was related, but I cant tell what is wrong from here: https://bbs.archlinux.org/viewtopic.php?id=288747

$ sudo wg show
interface: wgpia0
  public key: RZLjonZE6AzpgT5hSbuoju5TvVHdzRG7EENtwxBc/WU=
  private key: (hidden)
  listening port: 37803
  fwmark: 0x3213

peer: QTiyka/tQkQlq+zNEeEJ+D7ywMJJKYMsB1PeqUn14GQ=
  endpoint: 181.214.206.221:1337
  allowed ips: 0.0.0.0/0
  latest handshake: 31 seconds ago
  transfer: 376.19 KiB received, 225.90 KiB sent
  persistent keepalive: every 25 seconds