jamesmcm / vopono

Run applications through VPN tunnels with temporary network namespaces
GNU General Public License v3.0
889 stars 46 forks source link

Failed to extract remotes from config file #141

Closed brauliobo closed 2 years ago

brauliobo commented 2 years ago

Hi, first time user here. I'm trying to use vopono with vpnunlimited and getting the error/output below:

 ❯❯❯ LANG=en vopono exec --custom ~/openvpn/brauliobo@gmail.com_us-la_7E4B0.ovpn --protocol openvpn "telegram-desktop"
 2022-02-26T22:31:28.098Z INFO  vopono::util > Calling sudo for elevated privileges, current user will be used as default user
 2022-02-26T22:31:28.271Z INFO  vopono::netns > Created new network namespace: vopono_c_S1gqpJuTiRA
STATE      CONNECTIVITY  WIFI-HW  WIFI      WWAN-HW  WWAN    
connected  full          enabled  disabled  enabled  enabled 
 2022-02-26T22:31:28.364Z INFO  vopono::netns > IP address of namespace as seen from host: 10.200.1.2
 2022-02-26T22:31:28.364Z INFO  vopono::netns > IP address of host as seen from namespace: 10.200.1.1
 2022-02-26T22:31:28.386Z INFO  vopono::openvpn > Launching OpenVPN...
 2022-02-26T22:31:28.386Z INFO  vopono::netns   > Shutting down vopono namespace - as there are no processes left running inside
Error: Failed to extract remotes from config file: /home/braulio/openvpn/brauliobo@gmail.com_us-la_7E4B0.ovpn

Running with -v doesn't give any other detail.

The ovpn file does have a remote, below is an excerpt of the file used:

client
dev tun
reneg-sec 0
persist-tun
persist-key
ping 5
ping-exit 30
nobind
comp-lzo adaptive
remote-random
ns-cert-type server
route-metric 1
remote us-la.vpnunlimitedapp.com
proto udp
<ca>
-----BEGIN CERTIFICATE-----

Anything else should I provide to debug the issue?

This config works fine when imported through network-manager

jamesmcm commented 2 years ago

Add the port to the remote in the OpenVPN config file like:

remote us-la.vpnunlimitedapp.com 1194
brauliobo commented 2 years ago

thanks @jamesmcm

I now get this error log error, even when running with sudo:

braulio@phoenix ~ ❯❯❯ LANG=en vopono exec --custom ~/openvpn/brauliobo@gmail.com_us-mia_7E4B0.ovpn --protocol openvpn "ping kernel.org"
 2022-03-01T10:13:16.696Z INFO  vopono::util > Calling sudo for elevated privileges, current user will be used as default user
 2022-03-01T10:13:16.972Z INFO  vopono::netns > Created new network namespace: vopono_c_2uQ2rTp2Yuo
STATE      CONNECTIVITY  WIFI-HW  WIFI      WWAN-HW  WWAN    
connected  full          enabled  disabled  enabled  enabled 
 2022-03-01T10:13:17.064Z INFO  vopono::netns > IP address of namespace as seen from host: 10.200.1.2
 2022-03-01T10:13:17.064Z INFO  vopono::netns > IP address of host as seen from namespace: 10.200.1.1
 2022-03-01T10:13:17.094Z INFO  vopono::openvpn > Launching OpenVPN...
Bind /etc/netns/vopono_c_2uQ2rTp2Yuo/openvpn.log -> /etc/openvpn.log failed: No such file or directory
Bind /etc/netns/vopono_c_2uQ2rTp2Yuo/openvpn.log -> /etc/openvpn.log failed: No such file or directory
Bind /etc/netns/vopono_c_2uQ2rTp2Yuo/openvpn.log -> /etc/openvpn.log failed: No such file or directory
Bind /etc/netns/vopono_c_2uQ2rTp2Yuo/openvpn.log -> /etc/openvpn.log failed: No such file or directory
Bind /etc/netns/vopono_c_2uQ2rTp2Yuo/openvpn.log -> /etc/openvpn.log failed: No such file or directory
Bind /etc/netns/vopono_c_2uQ2rTp2Yuo/openvpn.log -> /etc/openvpn.log failed: No such file or directory
Bind /etc/netns/vopono_c_2uQ2rTp2Yuo/openvpn.log -> /etc/openvpn.log failed: No such file or directory
Bind /etc/netns/vopono_c_2uQ2rTp2Yuo/openvpn.log -> /etc/openvpn.log failed: No such file or directory
Bind /etc/netns/vopono_c_2uQ2rTp2Yuo/openvpn.log -> /etc/openvpn.log failed: No such file or directory
Bind /etc/netns/vopono_c_2uQ2rTp2Yuo/openvpn.log -> /etc/openvpn.log failed: No such file or directory
Bind /etc/netns/vopono_c_2uQ2rTp2Yuo/openvpn.log -> /etc/openvpn.log failed: No such file or directory
Bind /etc/netns/vopono_c_2uQ2rTp2Yuo/openvpn.log -> /etc/openvpn.log failed: No such file or directory
 2022-03-01T10:13:24.448Z INFO  vopono::exec    > Application ping kernel.org launched in network namespace vopono_c_2uQ2rTp2Yuo with pid 2285305
Bind /etc/netns/vopono_c_2uQ2rTp2Yuo/openvpn.log -> /etc/openvpn.log failed: No such file or directory
 2022-03-01T10:13:24.479Z INFO  vopono::netns   > Shutting down vopono namespace - as there are no processes left running inside
jamesmcm commented 2 years ago

Could you run it with the -v flag and run something that will stay up (like firefox with no other firefox instances open?)

LANG=en vopono -v exec --custom ~/openvpn/brauliobo@gmail.com_us-mia_7E4B0.ovpn --protocol openvpn firefox

I'm pretty sure ping will only ping once and silently if it thinks it isn't an interactive terminal.

brauliobo commented 2 years ago

thank you again @jamesmcm ! it worked with both firefox and telegram-desktop, it was indeed a problem with ping.

closing this