2

Previously I've already been able to connect to my server with openVPN. Now I've set up a new one with the same configuration, if I remember correctly, and on a client when trying to connect I get this:

ERROR: Cannot open TUN/TAP dev /dev/net/tun: No such device (errno=19)
Exiting due to fatal error

I run it as "sudo openvpn client.ovpn".

1
  • Have you compiled the tun module? modprobe tun;lsmod |grep tun Nov 16, 2016 at 6:40

4 Answers 4

3

Enable TUN/TAP device driver support in kernel.

  1. Open kernel menuconfig.
  2. Enable Device Drivers -> Network device support -> Universal TUN/TAP device driver support
  3. Compile and load the kernel again.

It will work!

1
  • 1
    Yes, it works for me. Just don't forget to load tun via modprobe tun if it didn't load automatically.
    – Ruslan
    May 12, 2020 at 13:24
1

This seems a permission issue. I was getting similar problem on my Docker instance, and I solved it using --privileged option while executing the docker run command

1

If the other tricks don't work (in other words, you've already installed the kernel modules, etc), make sure that the line

alias char-major-10-200 tunode_tunnel

is in /lib/modules/.../modules.alias.

0

Sometimes answer is easier than you think. Nowadays rarely (even with systemd), but sometimes you have to simply reboot the machine to get things working. Today it happened to me 3rd time and took me another 3 minutes of my life to remind myself about solution. So I'm leaving this note as a reminder to the "mankind" and so that I finally remember that:

if kernel was upgraded and OpenVPN shouts with the error mentioned by OP, reboot the machine and OpenVPN should work.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .