2009-04-20 16:08:52     Cannot allocate TUN/TAP dev dynamically

Document created by Aaronwu Employee on Aug 15, 2013
Version 1Show Document
  • View in full screen mode

2009-04-20 16:08:52     Cannot allocate TUN/TAP dev dynamically

blue hash (UNITED STATES)

Message: 72907   

 

Hi,

I am trying out openvpm on the bf537. 2008R1.5-RC3

 

I followed the following guide, which is very good

http://www.vpx.nu/dokuwiki/doku.php?id=vpn_solutions&s=tar

 

In the above guide node /dev/net/tun is added in the device_table.txt file

/dev/net        d       755     0       0       -       -       -       -       -

/dev/net/tun    c       640     0       0       10      200     0       0       -

 

However on boot, these do not get created and I get the following error.

 

 

Mon Apr 20 15:36:10 2009 OPTIONS IMPORT: timers and/or timeouts modified

Mon Apr 20 15:36:10 2009 OPTIONS IMPORT: --ifconfig/up options modified

Mon Apr 20 15:36:10 2009 OPTIONS IMPORT: route options modified

Mon Apr 20 15:36:10 2009 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified

Mon Apr 20 15:36:10 2009 Note: Cannot ioctl TUNSETIFF tun: Invalid argument (errno=22)

Mon Apr 20 15:36:10 2009 Note: Attempting fallback to kernel 2.2 TUN/TAP interface

Mon Apr 20 15:36:10 2009 Cannot allocate TUN/TAP dev dynamically

Mon Apr 20 15:36:10 2009 Exiting

 

 

Do I have to add anything to the board resource file?

 

I do see the following on boot:

 

SMSC LAN83C185: Registered new driver

tun: Universal TUN/TAP device driver, 1.6

tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>

QuoteReplyEditDelete

 

 

2009-04-20 18:36:10     Re: Cannot allocate TUN/TAP dev dynamically

Mike Frysinger (UNITED STATES)

Message: 72911   

 

there is nothing that needs to be added to your board resources.  you simply need to make sure you've enabled the TUN/TAP driver under the networking driver options in your kernel configuration.

 

same goes for /dev -- do not try to create the device nodes yourself at all

QuoteReplyEditDelete

 

 

2009-04-21 12:19:30     Re: Cannot allocate TUN/TAP dev dynamically

blue hash (UNITED STATES)

Message: 73007   

 

HI Mike, thanks for clearing up my text mess. I had the driver enabled in config, but for some reason couldnt see it in /dev/net. I'm aware that post 2008R1 releases create nodes dynamically by scanning /sys. Just for the heck, when I created /dev/net tun through mknod /dev/net/tun 10 200, the error went away.

 

I know I shouldnt do this but it worked. Could it be a bug? Thanks.

 

 

QuoteReplyEditDelete

 

 

2009-04-22 12:10:14     Re: Cannot allocate TUN/TAP dev dynamically

Mike Frysinger (UNITED STATES)

Message: 73068   

 

if you delete the node and run `mdev -s`, does it show up again ?

QuoteReplyEditDelete

 

 

2009-10-27 05:17:22     Re: Cannot allocate TUN/TAP dev dynamically

Øyvind Kaurstad (NORWAY)

Message: 81774   

 

This thread is a few months old, but I'm seeing the same issue, and I wonder why.

 

For some reason, the tun device node is default created at /dev/tun, not /dev/net/tun which OpenVPN seems to expect by default.

 

I did some experimenting, and by either explicitly telling OpenVPN that it should use /dev/tun (by using the --dev-node option) or manually creating /dev/net and setting a symlink to /dev/tun it works. It is also possible to create /dev/net and then use mknod to set up the tun device, but that's not the correct way I presume.

 

I have been trying to figure out why tun is at /dev/tun and not /dev/net/tun, but my lack of experience is shining through. Could someone please enlighten me here?

 

I'm using the 2009R1, btw.

 

Regards

 

-Øyvind

QuoteReplyEditDelete

 

 

2009-10-27 05:23:48     Re: Cannot allocate TUN/TAP dev dynamically

Mike Frysinger (UNITED STATES)

Message: 81775   

 

mdev only creates devices in /dev/ without subdirs unless there is a rule for it.  so there probably needs a line added to mdev.conf that says tun should be placed under net/.

QuoteReplyEditDelete

 

 

2009-10-28 09:56:03     Re: Cannot allocate TUN/TAP dev dynamically

Øyvind Kaurstad (NORWAY)

Message: 81813   

 

Thanks for answering.

 

I added the following line to mdev.conf:

 

tun[0-9]* 0:0 0660 =net/

 

..and that moves the tun device to /dev/net, which makes a default OpenVPN happy.

 

-Øyvind

Attachments

    Outcomes