amuck-landowner

TUN / TAP OpenVPN Ubuntu Fix

ArenaHosts

New Member
If you try to use a VPN program like OpenVPN or Hamachi on your VPS, You will likely receive this error:

Note: Cannot open TUN/TAP dev /dev/net/tun: Permission denied (errno=13)
Note: Attempting fallback to kernel 2.2 TUN/TAP interface
Cannot open TUN/TAP dev /dev/tun0: No such file or directory (errno=2)

The TUN/TAP device is not set up by default on your VPS. Instructions will vary with your virtualization platform.
 

OpenVZ Platform
  1. Enter mkdir -p /dev/net
  2. Enter mknod /dev/net/tun c 10 200
  3. Enter chmod 600 /dev/net/tun
  4. Enter cat /dev/net/tun to test whether the TUN/TAP device is available:
    • If you receive the message cat: /dev/net/tun: File descriptor in bad state your TUN/TAP device is ready for use
    • If you receive the message cat: /dev/net/tun: No such device the TUN/TAP device was not successfully created.
Please note that the TUN/TAP device will be removed if you reinstall your operating system template.

Xen Platform
Please ensure you have installed the kernel modules which your software requires to use the TUN/TAP device.
 

MannDude

Just a dude
vpsBoard Founder
Moderator
Thanks for sharing. I don't have an Ubuntu VM with OpenVPN running to test this, so I'll just have to take your word for it.

Welcome to vpsBoard too, by the way.
 
Top
amuck-landowner