You are not logged in.

#1 2024-03-28 22:00:22

p2a
Member
Registered: 2024-03-28
Posts: 2

Private_Internet_Access wiki page outdate / non-inclusive of preferred

Was really excited when I found the Private Internet Access wiki page (https://wiki.archlinux.org/title/Privat … net_Access). It seemed very thorough, but there is a very bad fork in the road at Section 2 and specifically "2.3 Packages".

If you look at the first seeming recommended - and official - method of using `piavpn-bin` (https://aur.archlinux.org/packages/piavpn-bin) it seems crystal clear that this is the right way to proceed. The second option of using the https://aur.archlinux.org/packages/priv … access-vpn is well outdated and from May 2023.

When I proceed with `yay piavpn-bin` it seems to install ok (except for the missing iproute2 messages:

cp: cannot stat '/usr/lib/iproute2/rt_tables': No such file or directory
awk: fatal: cannot open file `/etc/iproute2/rt_tables' for reading: No such file or directory
grep: /etc/iproute2/rt_tables: No such file or directory

)

But when I get to the next part "3 Installation" the folder `/etc/private-internet-access` is missing.

Then when you step into Section "5 Usage" and beyond, the continuing references to this are all invalid yet still.

PIA's client usage has gotten to the point where it is critical to use since it is required for some functionality like Dedicated IP and some other things and using an out of date client or an OpenVPN or WireGuard client without it being the native PIA client is not an option.

Can someone who is experienced in the PIA provided client setup on Arch chime in and rework the wiki entry so that it is correct or help me to get it working so that it starts properly and connects at system startup?

I have seen some commentary where this systemd service is needed to activate login after service activation and I just don't see where this is being done in the Arch setup:

[Unit]
Description=Connecting VPN via PIA
Wants=piavpn.service
After=piavpn.service
StartLimitIntervalSec=0

[Service]
Type=forking
ExecStartPre=/bin/bash -c 'while [ "$(systemctl is-active piavpn.service)" != "active" ]; do sleep 1; done'
ExecStart=/bin/bash -c '\
  /opt/piavpn/bin/piactl connect && \
  while true; do \
    connection_state=$$(/opt/piavpn/bin/piactl get connectionstate); \
    if [ "$$connection_state" == "Connected" ]; then \
      echo "PIA - Connected"; \
      break; \
    else \
      echo "Waiting for connection..."; \
      sleep 5; \
    fi; \
  done; \
  while true; do \
    if [ "$$(/opt/piavpn/bin/piactl get connectionstate)" == "Connected" ]; then \
      echo "PIA - Still Connected"; \
      sleep 15; \
    else \
      echo "PIA - Disconnected; broken"; \
      exit 1; \
    fi; \
  done'
ExecStop=/bin/bash -c '\
  /opt/piavpn/bin/piactl disconnect && \
  while true; do \
    if [ "$$(/opt/piavpn/bin/piactl get connectionstate)" == "Disconnected" ]; then \
      echo "PIA - Disconnected"; \
      exit 0; \
    else \
      echo "PIA - Still Connected"; \
      sleep 5; \
    fi; \
  done'
Restart=always
RemainAfterExit=yes

[Install]
WantedBy=default.target

I'm afraid I don't see this kind of logic anywhere so far in the setup being done on Arch. I don't see where the login credential file and the dedicated IP token file should go either.

The only configuration information I see is at `/opt/piavpn/etc` and the bin at `/usr/local/bin/piactl` is a symlink to `/opt/piavpn/bin/piactl`. There is a log at `/opt/piavpn/var/daemon.log` and at `~/.local/share/privateinternetaccess/cli.log`.

Offline

#2 2024-03-29 10:54:25

-thc
Member
Registered: 2017-03-15
Posts: 529

Re: Private_Internet_Access wiki page outdate / non-inclusive of preferred

When you encounter problems with AUR packages it's good practice to read the latest comments on the AUR page.

p2a wrote:

When I proceed with `yay piavpn-bin` it seems to install ok (except for the missing iproute2 messages:

cp: cannot stat '/usr/lib/iproute2/rt_tables': No such file or directory
awk: fatal: cannot open file `/etc/iproute2/rt_tables' for reading: No such file or directory
grep: /etc/iproute2/rt_tables: No such file or directory

The latest comment mentions the solution: Uninstall and reinstall piavpn-bin. Verify that "/etc/iproute2/rt_tables" exists and contains the pia* lines.

p2a wrote:

But when I get to the next part "3 Installation" the folder `/etc/private-internet-access` is missing.

Because part "3 Installation" begins with "Install private-internet-access-vpn(AUR)". That conflicts with "piavpn-bin" and from this point on you are on your own. IMHO it's not the Wiki's job to explain the configuration of "piavpn-bin" - that's PIA's job.

I tried to make sense of PIA's configuration and binaries.

Enable and start the "pia-daemon":

systemctl enable piavpn
systemctl start piavpn

The daemon is now started at every boot.

By default the daemon will only be active as long as the client (GUI) is running.
The daemon accepts no command line arguments - everything must be done via "piactl".

Enable background operation:

piactl background enable

Start the client (GUI), configure your VPN and connect to it. If you exit the client, verify that the daemon holds the connection. I hope that the daemon uses the same configuration files as the client.

Since there seems to be no "connection autostart" parameter for the daemon either the connection simply works after every boot or you have to issue the

piactl connect

command.

Offline

Board footer

Powered by FluxBB