transmission-remote --auth rpc_user:rpc_pass' -p $port
/usr/local/etc/openvpn/test.sh: line 5: 24493 Segmentation fault transmission-remote -n 'rpc_user:rpc_pass' -p 12345 > output.txt
printf "UUUUUUUU\nPPPPPPPPPP\n" > pass.txt
chmod 400 pass.txt
sed -i .bak 's/auth-user-pass/auth-user-pass pass.txt/' US\ West.ovpn
sed -i .bak 's/auth-user-pass/auth-user-pass pass.txt\\ auth-nocache/' US\ West.ovpn
ifconfig: groups: bad value
http://localhost:9091/transmission/rpc/) timeout was reached
jls jexec [JAILID] tcsh cd /tmp fetch https://gist.githubusercontent.com/jed-frey/6d475dcc34c710f62a7c/raw/fcf18484225b0676fe0c556e7798cc08cdc7a631/pia.sh chmod +x pia.sh ./pia.sh
Transmission Port Forward 2018-08-08-00:02:01 Connection to google.com 80 port [tcp/http] succeeded! VPN connection up Closed port detected Loading port forward assignment information... Please install shasum or sha256sum, and make sure it is visible in your $PATH
Reminder, port forwarding is only available on the following gateways or you will get the error "Port forwarding is already activated on this connection, has expired, or you are not connected to a PIA region that supports port forwarding".
- CA Toronto
- CA Montreal
- CA Vancouver
- Netherlands
- Switzerland
- Sweden
- France
- Germany
- Romania
- Israel
Loading port forward assignment information... {"error":"bad client_id"}
Port forwarding is already activated on this connection, has expired, or you are not connected to a PIA region that supports port forwarding
sha265
seems to do something but the script still fails.Final Port script that work. Above there was an error.
Code:#!/usr/local/bin/bash # Cronable port forwarding script for PIA/transmission running on FreeNAS # # Requires bash, jq (JSON parser) and curl # pkg install -y jq bash curl # # Export path for when you use this in cron export PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/root/bin" # echo date/time for logging echo "Transmission Port Forward $(date +%Y-%m-%d-%H:%M:%S)" get_new_port( ) { echo 'Loading port forward assignment information...' # Check if curl is installed if ! [ -x /usr/local/bin/curl ]; then echo "Curl not installed/not executable" exit 1 fi # dynamically figure out the tunnel adapter name tunnel_adapter=`ifconfig | grep "tun" | cut -d ":" -f1` local_ip=$(ifconfig $tunnel_adapter | grep "inet " | cut -d\ -f2) # client_id seems to want shasum/sha256sum data client_id_file="/usr/local/etc/openvpn/pia_client_id" if [ ! -f "$client_id_file" ]; then if hash shasum 2>/dev/null; then head -n 100 /dev/urandom | shasum -a 256 | tr -d " -" > "$client_id_file" elif hash sha256sum 2>/dev/null; then head -n 100 /dev/urandom | sha256sum | tr -d " -" > "$client_id_file" else echo "Please install shasum or sha256sum, and make sure it is visible in your \$PATH" exit 1 fi fi # port_forward_assignment client_id=`cat "$client_id_file"` json=$(curl --interface $tunnel_adapter "http://209.222.18.222:2000/?client_id=$client_id" 2>/dev/null) if [ "$json" == "" ]; then json='Port forwarding is already activated on this connection, has expired, or you are not connected to a PIA region that supports port forwarding' fi # trim VPN forwarded port from JSON port=$(echo $json | awk 'BEGIN{r=1;FS="{|:|}"} /port/{r=0; print $3} END{exit r}') # test to make sure that the port is actually a number if ! [[ $port =~ ^[0-9]+$ ]]; then echo $json exit 1 fi transmission-remote -p $port echo 'Port forward successful' echo $local_ip:$port exit 1 } is_port_forwarded( ) { # -pt tests for open port. json=$(transmission-remote -pt) if [[ $json == "Port is open: No" ]]; then echo "Closed port detected" get_new_port elif [[ $json == "Port is open: Yes" ]]; then echo "Open port detected" exit 1 fi } check_for_connectivity( ) { if nc -zw 1 google.com 80; then echo "VPN connection up" is_port_forwarded else echo "VPN connection down" exit 1 fi } check_for_connectivity is_port_forwarded exit 1
root@transmission:/etc # bash portforward.sh Transmission Port Forward 2018-08-17-10:39:40 Connection to google.com 80 port [tcp/http] succeeded! VPN connection up Unexpected response: <h1>401: Unauthorized</h1>Unauthorized User Unexpected response: <h1>401: Unauthorized</h1>Unauthorized User
root@transmission_1:/usr/ports/security/openvpn # make install clean
===> Building/installing dialog4ports as it is required for the config dialog
===> Cleaning for dialog4ports-0.1.6
===> Skipping 'config' as NO_DIALOG is defined
/!\ ERROR: /!\
Ports Collection support for your FreeBSD version has ended, and no ports are
guaranteed to build on this system. Please upgrade to a supported release.
No support will be provided if you silence this message by defining
ALLOW_UNSUPPORTED_SYSTEM.
*** Error code 1
Stop.
make[3]: stopped in /usr/ports/ports-mgmt/dialog4ports
*** Error code 1
Stop.
make[2]: stopped in /usr/ports/ports-mgmt/dialog4ports
===> Options unchanged
/!\ ERROR: /!\
Ports Collection support for your FreeBSD version has ended, and no ports are
guaranteed to build on this system. Please upgrade to a supported release.
No support will be provided if you silence this message by defining
ALLOW_UNSUPPORTED_SYSTEM.
*** Error code 1
Stop.
make[1]: stopped in /usr/ports/security/openvpn
*** Error code 1
Stop.
make: stopped in /usr/ports/security/openvpn
This broke for me updating from 11.2 Beta 3 to RC1. Seems like I can ping the web from the jail but not able to connect to peers.
Edit: also my traffic isn't being routed through the VPN. Still getting my own WAN IP. Investigating...
I followed your guide and everything works. I failed at the Reddit steps #3/4 and I was wondering once I am setup how do you switch PIA servers? Can you write in your own words how to do the step 3/4 and changing the PIA server once configured?