How to load tun module in linux

kernel-modulevpn

I cannot manage to load the tun module in my ArchLinux box. I’m trying
to connect with OpenVPN, but the log says:

nm-openvpn[6662]: Note: Cannot open TUN/TAP dev /dev/net/tun: No such device (errno=19)

lsmod | grep tun

Returns nothing:

If I run:

sudo modprobe tun

It returns failure, but no error message, and lsmod still has no tun. The module seems to exist, as there is a tun.ko.gz in /lib/modules/.

I really dont know what else to try.

Best Answer

This answer is probably a bit late, but I ran into the problem, exactly as described, myself.

Running OpenVPN would produce:

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

And running tunctl would produce:

Failed to open '/dev/net/tun' : No such file or directory

And this command had no output:

lsmod | grep tun

When attempting to add the tun module via:

modprobe tun

modprobe would exit with a failure error code (1), and nothing changed.

I found an alternate way of activating the tun module via insmod. First locate the module with this command:

find /lib/modules/ -iname 'tun.ko.gz'

Then use insmod with the returned path (I only got one match), for example:

insmod /lib/modules/3.6.9-1-ARCH/kernel/drivers/net/tun.ko.gz

For me, running that command worked, and tunctl and OpenVPN worked okay afterwards.