d4rkcat / pia

Private Internet Access VPN Linux bash client
GNU General Public License v2.0
92 stars 18 forks source link

Port Forwarding Germany (DE_Berlin, DE_Frankfurt) not working #15

Open timmyfromspace opened 5 years ago

timmyfromspace commented 5 years ago

Hey,

thank you for your script, great work.

I have one problem with it:

sudo pia -ps 10

sudo pia -ps 11

will trigger:

[X] Port forwarding is only available at: Netherlands, Switzerland, CA_Toronto, CA_Montreal, CA_Vancouver, Romania, Israel, Sweden, France and Germany.

You marked them green / as possible (being in Germany). Support article says too. And they are working for me with the offical app.

Could fix those please?

Thanks in advance.

Cheers Tim

tannenzaepfle commented 5 years ago

https://www.privateinternetaccess.com/helpdesk/kb/articles/how-do-i-enable-port-forwarding-on-my-vpn has an updated list of servers that support port forwarding; the Czech server also is new (it says "last updated 2019-02-14).

I submitted a pull request last year that would have fixed this bug but it hasn't been merged into master; my fix is now outdated anyway. You can fix this locally, though; I don't actually know how to code but still figured it out.

tannenzaepfle commented 5 years ago

If you've already installed the script, you can locate the binary using "which pia" and you'll get output something like "/usr/bin/pia". Just open it in vim (or whatever) and scroll down to line 450ish. You'll find a block of text that looks like this:

                case $SERVERNAME in
                        "CA_Toronto") fforward;;
                        "CA_Montreal") fforward;;
                        "Czech_Republic") fforward;;
                        "DE_Berlin") fforward;;
                        "DE_Frankfurt") fforward;;
                        "Romania") fforward;;
                        "Israel") fforward;;
                        "Spain") fforward;;
                        "Switzerland") fforward;;
                        "Sweden") fforward;;
                        "France") fforward;;
                        "CA_Vancouver") fforward;;
                        *) NOPORT=1;;>

This is from my locally updated version that contains all of the current forwarding-enabled servers; you'll want to edit yours accordingly.

The script checks the name of your selected server ("DE_Berlin") against this list, and if it's on it, it sets up port forwarding. Hope this helps.

(Also: you can do the same thing around line 225 if you want the correct servers to display in bold on the list, but this has no impact on whether the ports forward or not.)

nanodva commented 5 years ago

I've updated the servers name in my fork https://github.com/TaigaSan/pia