pia-foss / manual-connections

Scripts for manual connections to Private Internet Access
MIT License
620 stars 170 forks source link

[enhancement] Chose local port for wireguard port forwarding. #116

Closed Cwavs closed 3 years ago

Cwavs commented 3 years ago

This may already be possible and I've just missed it, but I was wondering if it was possible to add the ability to chose the local port used for port forwarding, like in the desktop client. It would be pretty handy for something like Plex, where the local port cannot be changed by the user, instead expecting you to change the port forwarding on the router to forward said port. Other than that great scripts so far.

g00nix commented 3 years ago

Are you sure that you can choose the port on the desktop client? Cause the servers currently do not offer this possibility...

Cwavs commented 3 years ago

Yes, unless I am mistaken you can see the option in the screenshot below: MU5P2DTC 1 Also I don't think the servers would need to support it, considering its the local port I want to change, not the public facing one. I am nowhere near an expert at this though so I could be wrong about that.

g00nix commented 3 years ago

That must be doing some tricks at the client level, for example redirecting connections from one port to another. The PF API on the servers doesn't allow you to specify the port. Maybe you can do the an iptables trick from bash for your system, to redirect incoming connections on whatever port you get from the PF API to the port that you actually have on your system.

Cwavs commented 3 years ago

Ah ok, how would I go about doing that? Is it similar to setting up port forwarding on a router? You pick a local port and an external one and it handles the rest?

faireOwl commented 3 years ago

This is a place for reporting bugs with the expected functionality of the current scripts. If you want to learn more about networking and Linux configurations you would need to seek external resources dedicated to that topic.

Cwavs commented 3 years ago

Ah ok, fair enough then