Script to set up PIA wireguard on FreshTomato
Example setup:
scp -O piascript.sh root@<ROUTER_IP>:
pia_user='<REDACTED>' pia_pass='<REDACTED>' ./piascript.sh
Example output:
Setting up WireGuard kernel module...
RTNETLINK answers: File exists
pia_vpn not set, defaulting to ca (Montreal, Canada)
Downloading PIA certificate...
Setting up PIA region...
Generating PIA token...
Generating WireGuard keys...
Warning: writing to world accessible file.
Consider setting the umask to 077 and trying again.
Authenticating to PIA...
Configuring WireGuard...
Configuring routes...
Configuring NAT...
Requesting port forward...
Setting up port with NAT...
{
"status": "OK",
"message": "port scheduled for add"
}
Writing out pia_refresh script for port rebinding...
Done.