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

opening TAP device failed #3

Closed
jazzdd86 opened this issue Mar 20, 2017 · 6 comments
Closed

opening TAP device failed #3

jazzdd86 opened this issue Mar 20, 2017 · 6 comments
Assignees

Comments

@jazzdd86
Copy link

I configured the image with cap_add: ALL, --privileged and net=host. But it still doesn't start correctly, and exits with:

opening sockets...
   IPv4/UDP: ok.
opening TAP device...
   failed.
error: The TAP device could not be opened! This might be caused by:
- a missing TAP device driver,
- a blocked TAP device (try a different name),
- insufficient privileges (try running as the root/administrator user).
@mjuenema
Copy link
Owner

Thanks for reporting the problem.

What happens if you run the example in the README (just replace the 10.0.2.15 with the IP address of the docker0 interface - I should probably clarify this in the README)?
Then log into either of the two containers and try to ping the other one, e.g. ping 172.16.1.2.

I wonder whether the problem you are experiencing is specific to my Docker image or a general Docker problem. What version of Docker are you running and what's your OS? For reference I run Docker 1.12.3 on Fedora Linux. I haven't tested the image with any other versions of Docker so I'd be curious to know if this may cause problems.

Regards

Markus

@jazzdd86
Copy link
Author

Hi, nope was also a host issue. I don't know why but my Linux was running on an old kernel but did not have /lib/modules for that kernel - and therefore no TUN module. An update and reboot of the server did the trick.

@mjuenema
Copy link
Owner

Great, I am glad that you found the cause of the problem. And thanks for your interest in docker-alpine-peervpn. It is always nice to see when others show interest in one's projects on Github :-)

@mjuenema
Copy link
Owner

I now encounter the issue when I try to change from running the container --privileged to setting specific capabilities, i.e. --cap-add .... I am re-opening the issue because you might be interested in the eventual solution. See the Travis-CI job for details.

@mjuenema mjuenema reopened this May 30, 2017
@mjuenema
Copy link
Owner

The solution is to create the /dev/net/tun device from inside the running container (docker-entrypoint.sh) and not in the Dockerfile.

Tested on Travis-CI.

@jazzdd86
Copy link
Author

Thanks for working on this, I changed my docker compose file to use the specific capability. Great image btw.

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

No branches or pull requests

2 participants