Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Fri Mar 25, 2011 8:01 am 
Offline
Newbie

Joined: Fri Mar 25, 2011 7:50 am
Posts: 2
I am trying to set up an OpenVPN server on Ubuntu 10.10 64 bit and am using the community guide as reference. I have gone through the guide several times but I am still having an issue. When I attempt to start opevpn I get the following error:

Code:
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


To confirm the module cannot be found:

Code:
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!


Top
   
 Post subject:
PostPosted: Fri Mar 25, 2011 10:23 am 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
You installed udev?


Top
   
 Post subject:
PostPosted: Fri Mar 25, 2011 11:31 am 
Offline
Senior Member

Joined: Fri Dec 07, 2007 1:37 am
Posts: 385
Location: NC, USA
Code:
 ~ # uname -r
2.6.38-x86_64-linode17
 ~ # zgrep CONFIG_TUN /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 and build the module yourself

3) Ask linode to include the TUN driver in their kernel


Top
   
 Post subject:
PostPosted: Fri Mar 25, 2011 11:36 am 
Offline
Senior Member

Joined: Fri Dec 07, 2007 1:37 am
Posts: 385
Location: NC, USA
Code:
 # pwd
/tmp/2.6.35.7-linode29
 # grep CONFIG_TUN .config
CONFIG_TUN=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.


Top
   
 Post subject:
PostPosted: Fri Mar 25, 2011 2:31 pm 
Offline
Newbie

Joined: Fri Mar 25, 2011 7:50 am
Posts: 2
Thanks for the help! I thought that was the case but wasn't 100% sure. I'll open a support ticket for tun to be included in 64 bit kernel.


Top
   
PostPosted: Sat Mar 16, 2013 4:13 pm 
Offline
Senior Newbie

Joined: Wed Jan 06, 2010 2:49 pm
Posts: 6
Website: http://tarasis.net
Location: Buchholz, Germany
I'm trying to run OpenVPN on Ubuntu 12.10 with the latest 32bit kernel (3.7.10-linode49) and running into this.

Do they typically not include the tun module, or was it dropped by accident?


Top
   
PostPosted: Sat Mar 16, 2013 7:09 pm 
Offline
Linode Staff
User avatar

Joined: Tue Apr 15, 2003 6:24 pm
Posts: 3090
Website: http://www.linode.com/
Location: Galloway, NJ
This thread is old, and so is the kernel it references :). TUN is compiled into all our modern kernels. "zgrep TUN /proc/config.gz" to see. No need to load it. Just use it. Sometimes dumb scripts expect it to be a module and fail when they can't modprobe it (again, no need to since it's already compiled in).

-Chris


Top
   
PostPosted: Sun Mar 17, 2013 11:37 am 
Offline
Senior Newbie

Joined: Wed Jan 06, 2010 2:49 pm
Posts: 6
Website: http://tarasis.net
Location: Buchholz, Germany
Thanks Chris, after OpenVPN complained about not finding TUN I did a search and found this thread.

Cheers.


Top
   
PostPosted: Mon Mar 18, 2013 4:17 pm 
Offline
Senior Newbie

Joined: Tue Sep 22, 2009 11:54 pm
Posts: 6
I'm experiencing this outcome though as Chris noted it's likely to be a different cause than the original solution indicated. For instance, my kernel hasn't changed and it should have TUN support included. I hate to start a new thread when the issue appears to be the same, no tun device so ..

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: Cannot open TUN/TAP dev /dev/net/tun: No such file or directory (errno=2)
Mon Mar 18 15:02:22 2013 us=749015 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=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 /dev/net is missing so presumably any reference to /dev/net/tun is sure to fail. That's where I'm at right now, looking around further though.

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 <maxk@qualcomm.com>" at boot so I'm at a loss as to why this problem has surfaced after rebooting. Could this be a linode kernel issue or perhaps related to an Ubuntu 12.04 update?


Top
   
PostPosted: Wed Mar 20, 2013 11:19 pm 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
Since you're seeing the TUN/TAP boot message, I'd suggest that it's probably not the kernel but more likely a problem of udev not creating the proper entry in /dev.


Top
   
PostPosted: Thu Mar 21, 2013 9:06 am 
Offline
Junior Member

Joined: Sat Mar 07, 2009 1:21 pm
Posts: 25
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:

Code:
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.


Top
   
PostPosted: Thu Mar 21, 2013 7:21 pm 
Offline
Senior Newbie

Joined: Tue Sep 22, 2009 11:54 pm
Posts: 6
fuzzman442 wrote:
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:

Code:
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
Code:
openvpn --mktun --dev tun0
showed expected output and
Code:
/etc/init.d/openvpn start
immediately afterward worked normally. I rebooted and openvpn had started normally.


Top
   
PostPosted: Sat Nov 16, 2013 1:29 am 
Offline
Senior Newbie

Joined: Sat Sep 18, 2010 12:24 pm
Posts: 6
Website: http://nil.mx/
I was having the same problem (no /dev/net/tun) after upgrading from Ubuntu 10.04 to 12.04. In my case it was fixed by running

Code:
sudo udevadm trigger


There was no need to manually create the /dev entry.

Sorry for posting on a old thread. I just found this thread while trying to solve the same issue.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group