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

Need a script that sets up TUN/TAP dev if it isn't present. (ie; Synology) #43

Closed
stevepet opened this issue Nov 25, 2015 · 11 comments
Closed

Comments

@stevepet
Copy link

Kristian,
Thanks for building this container and for looking into a resolution to this Synology problem.

I have included your comments from Docker Hub to refresh your memory on this topic.

"On a host system the TUN/TAP device will probably be created/verified on installing the OpenVPN client. As we're here starting a container where it is already installed it will expect the TUN/TAP device to be present. I could try to create a script that sets up the device if it isn't present. But on my machine I already have it so I would have to do some virtualization and stuff. "

@hamlynt
Copy link

hamlynt commented Jan 5, 2016

@stevepet it works for me on Synology, do you have the VPN Server package installed?

@stevepet
Copy link
Author

stevepet commented Jan 5, 2016

No, I do not use the VPN Server. I understand it will mask the issue. I was hoping for a solution and not a work around.

@hamlynt
Copy link

hamlynt commented Jan 5, 2016

I just meant have the package installed, even if not in use. I didn't have an issue running on a Synology and thought that might be one possible difference. 

On Mon, Jan 4, 2016 at 10:09 PM -0800, "stevepet" [email protected] wrote:

No, I do not use the VPN Server. I understand it will mask the issue. I was hoping for a solution and not a work around.


Reply to this email directly or view it on GitHub.

@haugene
Copy link
Owner

haugene commented Feb 16, 2016

Might have stumbled across a solution for this one. Been inactive for a while, but will hopefully have some time to do some hacking in the week to come :)

@gaeldevo
Copy link

gaeldevo commented Mar 2, 2016

I have the same problem and i'm working on it

by default the error message was :

ERROR: Cannot open TUN/TAP dev /dev/net/tun: No such file or directory (errno=2)

I updated the /openvpn/start.sh script with :

#/dev/net/tun
mkdir -p /dev/net
mknod /dev/net/tun c 10 200
chmod 600 /dev/net/tun

and now i have this error :

ERROR: Cannot open TUN/TAP dev /dev/net/tun: No such device (errno=19)

it's maybe the right way to solve this ...

remarks : my synology has 2 ethernet ports; need i to configure a "dev tun1" instead of "dev tun0" in ovpn files ?

@rolandb5
Copy link
Contributor

rolandb5 commented Mar 9, 2016

Also installed VPN server on DSM5, but still get the TUN/TAP error. Any other ideas how I can circumvent this issue?

@stevepet
Copy link
Author

stevepet commented Mar 9, 2016

See issue #41. The script listed there seems to work around the issue.

@haugene
Copy link
Owner

haugene commented Apr 2, 2016

And with that I'm closing this one. Synology-related discussions goes in the other issue.

@haugene haugene closed this as completed Apr 2, 2016
@bjeanes
Copy link

bjeanes commented May 9, 2016

I am playing with another Docker image similar to this one and it worked on my Synology, I believe due to creating the container with the following:

docker create \
  ... \
  --cap-add=NET_ADMIN \
  --device=/dev/net/tun

(and the fact that it does the mknod stuff as per above)

@haugene
Copy link
Owner

haugene commented May 9, 2016

Hmm, I don't use a Synology myself so I can't test it. But you're saying that if the container is run with --device=/dev/net/tun there won't be a need to use the TUN.sh script described in the readme?

Right now we're running in privileged mode, so I would think that we had access to the device from before?

@bjeanes
Copy link

bjeanes commented May 10, 2016

Honestly, I don't know. I thought that was the magic step, but now several days later my synology is giving me:

Error response from daemon: Cannot start container 703399471a203d28a9b374809f6f625c31b8b636c494311593bab68fef76c21e: error gathering device information while adding custom device "/dev/net/tun": lstat /dev/net/tun: no such file or directory

I must have somehow had a /dev/net/tun without realising which has since been removed (maybe after a restart). It's a mystery to me at the moment.

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

6 participants