OpenVPN start up fails- no tun device
root@boromir:/etc/openvpn# openvpn server.conf
Fri Mar 25 07:47:22 2011 OpenVPN 2.1.0 x86_64-pc-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] [MH] [PF_INET6] [eurephia] built on Jul 12 2010
Fri Mar 25 07:47:22 2011 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
Fri Mar 25 07:47:22 2011 Diffie-Hellman initialized with 2048 bit key
Fri Mar 25 07:47:22 2011 /usr/bin/openssl-vulnkey -q -b 2048 -m <modulus omitted="">
Fri Mar 25 07:47:23 2011 TLS-Auth MTU parms [ L:1542 D:138 EF:38 EB:0 ET:0 EL:0 ]
Fri Mar 25 07:47:23 2011 ROUTE default_gateway=74.207.232.1
Fri Mar 25 07:47:23 2011 Note: Cannot open TUN/TAP dev /dev/net/tun: No such device (errno=19)
Fri Mar 25 07:47:23 2011 Note: Attempting fallback to kernel 2.2 TUN/TAP interface
Fri Mar 25 07:47:23 2011 Cannot allocate TUN/TAP dev dynamically
Fri Mar 25 07:47:23 2011 Exiting</modulus>
To confirm the module cannot be found:
root@boromir:/etc/openvpn# modprobe tun
FATAL: Module tun not found.
How to I install this module or set it up correctly? I have tried a few things I've found googling but nothing has worked thus far.
Thanks!
12 Replies
~ # uname -r
2.6.38-x8664-linode17
~ # zgrep CONFIGTUN /proc/config.gz
CONFIG_TUN is not set
````
I thought the linode kernels had the TUN device built-in, but it appears not to be - do the 32-bit kernels include TUN?
You can:
1) Run your distro kernel with pv-grub
2) Download the linode kernel source
3) Ask linode to include the TUN driver in their kernel
# pwd
/tmp/2.6.35.7-linode29
# grep CONFIGTUN .config
CONFIGTUN=y
````
Yep - the 32-bit kernels have the TUN device built-in, while the 64-bit don't. I'd probably file a support ticket on this one, I doubt linode meant it to be this way.
Do they typically not include the tun module, or was it dropped by accident?
-Chris
Cheers.
My openvpn implementation was working well until I rebooted this morning and I'm experiencing this issue.
Mon Mar 18 15:02:22 2013 us=742824 OpenVPN 2.2.1 i686-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] [eurephia] [MH] [PF_INET6] [IPv6 payload 20110424-2 (2.2RC2)] built on Mar 30 2012
Mon Mar 18 15:02:22 2013 us=743036 NOTE: OpenVPN 2.1 requires '–script-security 2' or higher to call user-defined scripts or executables
Mon Mar 18 15:02:22 2013 us=747934 Diffie-Hellman initialized with 1024 bit key
Mon Mar 18 15:02:22 2013 us=748734 TLS-Auth MTU parms [ L:1542 D:138 EF:38 EB:0 ET:0 EL:0 ]
Mon Mar 18 15:02:22 2013 us=748796 Socket Buffers: R=[163840->131072] S=[163840->131072]
Mon Mar 18 15:02:22 2013 us=748938 ROUTE default_gateway=69.164.196.1
Mon Mar 18 15:02:22 2013 us=748989 Note:
Mon Mar 18 15:02:22 2013 us=749015 doifconfig, tt->ipv6=0, tt->didifconfigipv6setup=0
Mon Mar 18 15:02:22 2013 us=749060 /sbin/ifconfig 10.8.0.1 pointopoint 10.8.0.2 mtu 1500
SIOCSIFADDR: No such device
: ERROR while getting interface flags: No such device
SIOCSIFDSTADDR: No such device
: ERROR while getting interface flags: No such device
SIOCSIFMTU: No such device
Mon Mar 18 15:02:22 2013 us=765084 Linux ifconfig failed: external program exited with error status: 1
Mon Mar 18 15:02:22 2013 us=765186 Exiting
I looked and
Update: kernel reports CONFIG_TUN=y so there's no module to load and I'm seeing "tun: Universal TUN/TAP device driver, 1.6
tun: (C) 1999-2004 Max Krasnyansky <
I observed the same thing last weekend. I am on Ubuntu 12.04 LTS (32 bit). My OpenVPN TUN server was working fine, until I rebooted to pick up kernel 3.7.10. That was last weekend. The /dev/tun device disappeared. I asked about it in IRC; and someone mentioned the udev possibility. However, I'm not that familiar with it. I think something in the new kernel caused the issue.
How to fix it:
linode:~$ cd /dev
linode:~$ sudo MAKEDEV tun
linode:~$ sudo openvpn --mktun --dev tun0
I thought that doing that and then an openvpn restart would have been enough. But I ended up with a tun1 instead of a tun0. This might have been because I had an existing installation. So I rebooted again, and tun0 came up and worked fine.
I hope this helps.
@fuzzman442:
jphelps,
I observed the same thing last weekend. I am on Ubuntu 12.04 LTS (32 bit). My OpenVPN TUN server was working fine, until I rebooted to pick up kernel 3.7.10. That was last weekend. The /dev/tun device disappeared. I asked about it in IRC; and someone mentioned the udev possibility. However, I'm not that familiar with it. I think something in the new kernel caused the issue.
How to fix it:
linode:~$ cd /dev linode:~$ sudo MAKEDEV tun linode:~$ sudo openvpn --mktun --dev tun0
I thought that doing that and then an openvpn restart would have been enough. But I ended up with a tun1 instead of a tun0. This might have been because I had an existing installation. So I rebooted again, and tun0 came up and worked fine.
I hope this helps.
I've tried a few things but your comment has definitely helped me, thanks.
An apt-get update/upgrade cycle showed udev needing updates however doing so didn't help, nor did rebooting.
So I tried MAKEDEV tun though I'm skeptical that does anything meaningful with udev. No help there.
However
openvpn --mktun --dev tun0
showed expected output and
/etc/init.d/openvpn start
immediately afterward worked normally. I rebooted and openvpn had started normally.
sudo udevadm trigger
There was no need to manually create the /dev entry.