idlab-discover / easy-openvpn-server

Plug-and-play OpenVPN server which generates server and client config files for you
https://snapcraft.io/easy-openvpn-server
GNU Affero General Public License v3.0
69 stars 9 forks source link

Error: please connect interfaces #13

Open execut opened 2 years ago

execut commented 2 years ago

Hello! Run script failed with error:

# easy-openvpn-server.openvpn 
Error: please connect interfaces

Here the script is checked files of interfaces, but it does not exist: https://github.com/IBCNServices/easy-openvpn-server/blob/9f5ca4d0145b729ceb4ac2ac36b251e2572558b5/scripts/run.sh#L9

Files are really not existed, but snap interfaces and connections exist:

# snap connections 
Interface         Plug                                  Slot               Notes
firewall-control  easy-openvpn-server:firewall-control  :firewall-control  -
network           easy-openvpn-server:network           :network           -
network-bind      easy-openvpn-server:network-bind      :network-bind      -
network-control   easy-openvpn-server:network-control   :network-control   -
# lsb_release -ir
Distributor ID: Ubuntu
Release:        21.10

Help, please. How fix this error?

merlijn-sebrechts commented 2 years ago

You do not need to use the command openvpn. This command is only for testing and debugging purposes. The VPN server should start automatically in the background after installation.

execut commented 2 years ago

Launching in the usual way also does not work and also gives this error. Here is the output of the system log after running the easy-openvpn-server setup command with the same error:

Jan 10 12:06:56 sd-123 systemd[3126]: Started snap.easy-openvpn-server.easy-openvpn-server.2d76a712-d495-44c0-8b15-652b56af983d.scope.
Jan 10 12:06:57 sd-123 kernel: [138526.999716] audit: type=1400 audit(1641812817.035:114): apparmor="DENIED" operation="open" profile="snap.easy-openvpn-server.easy-openvpn-server" name="/proc/1620495/mounts" pid=1620495 comm="python3" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
Jan 10 12:06:57 sd-123 kernel: [138527.330508] audit: type=1400 audit(1641812817.363:115): apparmor="DENIED" operation="capable" profile="snap.easy-openvpn-server.easy-openvpn-server" pid=1620495 comm="python3" capability=3  capname="fowner"
Jan 10 12:06:57 sd-123 systemd[1]: Stopping Service for snap application easy-openvpn-server.tcp-server...
Jan 10 12:06:57 sd-123 systemd[1]: snap.easy-openvpn-server.tcp-server.service: Deactivated successfully.
Jan 10 12:06:57 sd-123 systemd[1]: Stopped Service for snap application easy-openvpn-server.tcp-server.
Jan 10 12:06:57 sd-123 systemd[1]: Started Service for snap application easy-openvpn-server.tcp-server.
Jan 10 12:06:57 sd-123 easy-openvpn-server.tcp-server[1620592]: Error: please connect interfaces
Jan 10 12:06:57 sd-123 systemd[1]: Stopping Service for snap application easy-openvpn-server.udp-server...
Jan 10 12:06:57 sd-123 systemd[1]: snap.easy-openvpn-server.udp-server.service: Deactivated successfully.
Jan 10 12:06:57 sd-123 systemd[1]: Stopped Service for snap application easy-openvpn-server.udp-server.
Jan 10 12:06:58 sd-123 systemd[1]: Started Service for snap application easy-openvpn-server.udp-server.
Jan 10 12:06:58 sd-123 kernel: [138528.096424] audit: type=1400 audit(1641812818.131:116): apparmor="DENIED" operation="open" profile="snap.easy-openvpn-server.easy-openvpn-server" name="/etc/iproute2/rt_scopes" pid=1620666 comm="ip" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
Jan 10 12:06:58 sd-123 easy-openvpn-server.udp-server[1620631]: Error: please connect interfaces
Jan 10 12:06:58 sd-123 systemd[3126]: snap.easy-openvpn-server.easy-openvpn-server.2d76a712-d495-44c0-8b15-652b56af983d.scope: Succeeded.
execut commented 2 years ago

The following commands solved the problem, and the VPN started working fine:

cd ~/snap/easy-openvpn-server/101;
touch internal.network-control-connected;
touch internal.firewall-control-connected;
easy-openvpn-server setup;

Why did you do this check? Why is it my case these files do not exist?