Skip to content

Commit 688cbe3

Browse files
committed
Add check that natpmpc is installed for ProtonVPN port forwarding
1 parent d1c1967 commit 688cbe3

File tree

5 files changed

+15
-3
lines changed

5 files changed

+15
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "vopono"
33
description = "Launch applications via VPN tunnels using temporary network namespaces"
4-
version = "0.10.7"
4+
version = "0.10.8"
55
authors = ["James McMurray <[email protected]>"]
66
edition = "2021"
77
license = "GPL-3.0-or-later"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ lynx all running through different VPN connections:
4343

4444
\*\*\* For ProtonVPN you can generate and download specific Wireguard config
4545
files, and use them as a custom provider config. See the [User Guide](USERGUIDE.md)
46-
for details. [Port Forwarding](https://protonvpn.com/support/port-forwarding-manual-setup/) is supported with the `--protonvpn-port-forwarding` argument for both OpenVPN and Wireguard (with `--provider custom --custom xxx.conf --protocol wireguard` ), note for OpenVPN you must generate the OpenVPN config files appending `+pmp` to your OpenVPN username, and you must choose servers which support this feature (e.g. at the time of writing, the Romania servers do). The assigned port is then printed to the terminal where vopono was launched - this should then be set in any applications that require it.
46+
for details. [Port Forwarding](https://protonvpn.com/support/port-forwarding-manual-setup/) is supported with the `--protonvpn-port-forwarding` argument for both OpenVPN and Wireguard (with `--provider custom --custom xxx.conf --protocol wireguard` ). `natpmpc` must be installed. Note for OpenVPN you must generate the OpenVPN config files appending `+pmp` to your OpenVPN username, and you must choose servers which support this feature (e.g. at the time of writing, the Romania servers do). The assigned port is then printed to the terminal where vopono was launched - this should then be set in any applications that require it.
4747

4848

4949
\*\*\*\* Cloudflare Warp uses its own protocol. Set both the provider and

USERGUIDE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,8 @@ $ vopono -v exec --provider custom --custom testwg-UK-17.conf --protocol wiregua
479479

480480
Port forwarding can be enabled with the `--protonvpn-port-forwarding` argument, but requires using a server that supports port forwarding.
481481

482+
`natpmpc` must be installed e.g. via the `libnatpmp` package on Arch Linux.
483+
482484
Note for OpenVPN you must generate the OpenVPN config files appending `+pmp` to your OpenVPN username (i.e. what will be written to `~/.config/vopono/proton/openvpn/auth.txt`)
483485

484486
Note the usual `-o` / `--open-ports` argument has no effect here as we only know the port number assigned after connecting to ProtonVPN.

vopono_core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "vopono_core"
33
description = "Library code for running VPN connections in network namespaces"
4-
version = "0.1.7"
4+
version = "0.1.8"
55
edition = "2021"
66
authors = ["James McMurray <[email protected]>"]
77
license = "GPL-3.0-or-later"

vopono_core/src/network/natpmpc.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ impl Natpmpc {
2323
pub fn new(ns: &NetworkNamespace) -> anyhow::Result<Self> {
2424
let gateway_str = PROTONVPN_GATEWAY.to_string();
2525

26+
if let Err(x) = which::which("natpmpc") {
27+
log::error!(
28+
"natpmpc not found. Is natpmpc installed and on PATH? (e.g. libnatpmp package)"
29+
);
30+
return Err(anyhow::anyhow!(
31+
"natpmpc not found. Is natpmpc installed and on PATH?: {:?}",
32+
x
33+
));
34+
}
35+
2636
// Check output for readnatpmpresponseorretry returned 0 (OK)
2737
// If receive readnatpmpresponseorretry returned -7
2838
// Then prompt user to choose different gateway

0 commit comments

Comments
 (0)