Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot open TUN/TAP #46

Closed
CooperBarrett opened this issue Dec 22, 2015 · 12 comments
Closed

Cannot open TUN/TAP #46

CooperBarrett opened this issue Dec 22, 2015 · 12 comments

Comments

@CooperBarrett
Copy link

I am French, I use google translation

Hello,

I have a Qnap ts253pro.

That's the problem I have:

Tue Dec. 22 2015 2:24:22 p.m. [vpnsvc] Peer Connection Initiated with [AF_INET] 95.211.195.84:443
Tue Dec. 22 2015 2:24:25 p.m. ERROR: Can not open TUN / TAP dev / dev / net / tun: No such file or directory (errno = 2)
Tue Dec. 22 2015 2:24:25 p.m. Exiting due to fatal error

The problem is that /dev/net/ tun is present in my Qnap.

I saw some problems that resembled mine but I did not find satisfesante answer.

Would you have an idea of the problem?

Thank you in advance for your assistance.


Bonjour,

Je possède un Qnap ts253pro.

Voilà le problème que je rencontre :

Tue Dec 22 14:24:22 2015 [vpnsvc] Peer Connection Initiated with [AF_INET]95.211.195.84:443                                                                                                                 
Tue Dec 22 14:24:25 2015 ERROR: Cannot open TUN/TAP dev /dev/net/tun: No such file or directory (errno=2)                                                                                                   
Tue Dec 22 14:24:25 2015 Exiting due to fatal error

Le problème est que /dev/net/tun est bien présent dans mon Qnap.

J'ai vu quelques problèmes qui ressemblaient au miens mais je n'ai pas trouvé de réponse satisfesante.

Auriez vous une idée du problème ?

Merci d'avance pour votre aide.

@haugene
Copy link
Owner

haugene commented Dec 22, 2015

Hello,

When the container starts it tries to open a vpn connection through a tun/tap device that isn't present on your system. OpenVPN is installed inside the container but it requires this device to open a connection.

You need to set up such a device, and this is what's described for a Synology NAS in issue #41.
The easiest solution for you is probably to install openvpn on your NAS as well, this should create a tun/tap device that the container will use when it's connecting.

@CooperBarrett
Copy link
Author

Thank you for your answer.

My problem is that OpenVPN is already activated on my NAS.

So I have already /dev/net/tun :

capture d ecran 2015-12-23 a 00 07 23

OpenVPN is preinstalled, I simply activated via the control panel:
capture d ecran 2015-12-23 a 00 07 57

I'm sorry, I started and I confess not to understand my problem.

Thank you


Merci pour ta réponse.

Mon problème est que OpenVpn est déjà activé sur mon NAS.

J'ai donc bien /dev/net/tun :

(Voir Image au dessus)

OpenVPN est préinstallé, je l'ai simplement activé via le panneau de controle :

(Voir Image au dessus)

Je suis désolé, je débute et j'avoue ne pas comprendre mon problème.

Merci

@haugene
Copy link
Owner

haugene commented Dec 23, 2015

Hmm. From your first logs it says: "Cannot open TUN/TAP dev /dev/net/tun: No such file or directory" so that should imply that it's not present. But then you activated the VPN server and now you have it?

If you deacivate OpenVPN will the dev/net/tun device disappear? If it was installed/configured the first time you activated OpenVPN you should then be able to deactivate your OpenVPN server and then start the container?

@CooperBarrett
Copy link
Author

That's my problem, it tells me "Can not open TUN/TAP dev /dev/net/tun: No such file or directory" when it is present ...

In addition, OpenVPN works fine when I connect myself to my PC via Viscosity (same tunnelblick).

It's really going crazy ...

As against what is weird is that if I disables OpenVPN via the control panel, "/dev/net/tun" is always present. (and I still have the same error)

Thank you for your help

@haugene
Copy link
Owner

haugene commented Dec 23, 2015

Well, it makes sense that the /dev/net/tun is still there as that interface is probably set up when OpenVPN is installed/activated for the first time. Also note that the service you're enabling/disabling is just a OpenVPN server shipped with your NAS, not all of the OpenVPN capabilities. If you don't plan to host your own OpenVPN server I would keep it disabled...

As for your problem, the "No such file or directory" error will also come if there are permission issues. Are you running the container with the --privileged flag?

@CooperBarrett
Copy link
Author

Hello,

In fact I use the "Container Station" Qnap in which is "Docker".

Once your package installed, I have to go to "Advanced Settings"

capture

Can I return my data:

capture 2

If I do not go through there and I go directly into the terminal after you install your container, I have this error:
capture 3

I have changed on the highlighted data

That's where I am, a little lost.

@haugene
Copy link
Owner

haugene commented Dec 23, 2015

Hmm. I'm not sure why the qnap container station isn't working, but there should be a choice to run the container in privileged mode. Somewhere in the advances settings?

For the terminal example you have a "" between -d and -v there. That's probably why it thinks it should load v:latest image which doesn't exist. The \ symbols are only used for multi-line commands. You don't need them if you write it all on one line...

@CooperBarrett
Copy link
Author

Ah we advance!

Indeed there was a good way "with privilege" check that I had not seen AND I had the damn "" too much in my line terminal !!!

So it connects with both methods BUT disconnects after a few seconds (20 / 30sec). here is what I have in the logs:

capture 4

Port opening problems?
I have no log at the time of disconnection

Thank you for your help, I feel a glimpse of the end of the tunnel ...

@haugene
Copy link
Owner

haugene commented Dec 24, 2015

Nah, that looks correct. The port updating is just a custom script for the PIA provider that asks for an open port and sets it to transmission every hour. You're supposed to get that message if you're using another provider.

What do you mean by disconnect? The container stops? Never seen that before...

@CooperBarrett
Copy link
Author

Thank you for your answer, sorry for the wait (Christmas ...).

Yes, it is that OpenVPN disconnected.

I do not understand the connection but it is disconnected between 10 and 20 seconds later ...
(The problem does not come from VPN because it works well on the PC via OpenVPN and PPTP on the NAS.)

I just tested on the OpenVPN Nas and I have the same problem so this comes from my side and not your container.

So you can close my issue in my case.

Thank you for your time and your help.

PS: If you have an idea for my problem, I'm still ...

@victoere
Copy link

Have the same issue "Can not open TUN/TAP dev /dev/net/tun: No such file or directory" I saw the reference the "Privilege" check in advanced setting in Container Station. I'm gong to take a closer look at this tonight but wondering if you can elaborate on where you found that? Maybe a screenshot of the advanced settings.

@ratabora
Copy link

ratabora commented May 14, 2017

@victoere I'm working on a QNAP 251+ and ran into the same issue. I simply had to enable privileged mode and everything worked!

screenshot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants