[OpenVPN home] [Date Prev] [Date Index] [Date Next]
[OpenVPN mailing lists] [Thread Prev] [Thread Index] [Thread Next]
Google
 
Web openvpn.net

[Openvpn-users] Cannot open TUN/TAP dev /dev/net/tun: Permission denied (errno=13)


  • Subject: [Openvpn-users] Cannot open TUN/TAP dev /dev/net/tun: Permission denied (errno=13)
  • From: Jay S <jay6002@xxxxxxxxxx>
  • Date: Thu, 31 May 2007 18:56:48 -0500

I'm running Linux 2.6.9-023stab043.1-enterprise CentOS 4.5 i686 on a Virtuozzo VPS and  OpenVPN 2.0.9 compiled from source on this server.


I am trying to set up OpenVPN with ethernet bridging, and I have gotten to the point in the How-To where I build and run the bridge-start script, but when I try to run it from an SSH command line as root, I get the error “Cannot open TUN/TAP dev /dev/net/tun: Permission denied (errno=13)”. The complete error looks like this:


root@server [/etc/openvpn]# ./bridge-start

Thu May 31 19:49:54 2007 Note: Cannot open TUN/TAP dev /dev/net/tun: Permission denied (errno=13)

Thu May 31 19:49:54 2007 Note: Attempting fallback to kernel 2.2 TUN/TAP interface

Thu May 31 19:49:54 2007 Cannot open TUN/TAP dev /dev/tap0: No such file or directory (errno=2)

Thu May 31 19:49:54 2007 Exiting

add bridge failed: Operation not permitted

interface eth0 does not exist!

interface tap0 does not exist!

SIOCSIFADDR: No such device

tap0: unknown interface: No such device

tap0: unknown interface: No such device

tap0: unknown interface: No such device

SIOCSIFADDR: No such device

eth0: unknown interface: No such device

eth0: unknown interface: No such device

eth0: unknown interface: No such device

SIOCSIFADDR: No such device

br0: unknown interface: No such device

SIOCSIFNETMASK: No such device

SIOCGIFADDR: No such device

SIOCSIFBROADCAST: No such device

SIOCSIFBRDADDR: No such device

br0: unknown interface: No such device


The bridge-start script is:


#******************************** start script **************************

# Define Bridge Interface

br="br0"


# Define list of TAP interfaces to be bridged,

# for example tap="tap0 tap1 tap2".

tap="tap0"


# Define physical ethernet interface to be bridged

# with TAP interface(s) above.

eth="eth0"

eth_ip="127.0.0.1"

eth_netmask="255.255.255.255"eth_ip="127.0.0.1"

eth_netmask="255.255.255.255"

eth_broadcast="0.0.0.0"


for t in $tap; do

openvpn --mktun --dev $t

done


brctl addbr $br

brctl addif $br $eth


for t in $tap; do

brctl addif $br $t

done


for t in $tap; do

ifconfig $t 0.0.0.0 promisc up

done


ifconfig $eth 0.0.0.0 promisc up


ifconfig $br $eth_ip netmask $eth_netmask broadcast $eth_broadcast


#***************************** end script ***********************************




I have confirmed that the file /usr/include/linux/if_tun.h exists. I have created /dev/net/tap0 using:

mknod /dev/net/tap0 c 10 200

modprobe tap0


The permissions for /dev are: drwxr-xr-x 4 root root

For /dev/net they are: drwxr-xr-x 2 root root

For /dev/net/tap0 they are: crw-r--r-- 1 root root


I tried setting the permissions for /dev/net/tap0 to “crwxrwxrwx”, but it made no difference; I still got the same error. I'm also confused as to why the error that is returned refers to /dev/net/tun, when the bridge-start script is set up to use tap0.


I have searched the archives and Googled, finding a bunch of posts regarding this error. I tried the solutions I found but so far nothing has worked and I have spent the past two days working on it. I have a sneaking suspicion that I am making a bonehead error that will be obvious to someone who knows what they are doing. I would REALLY appreciate some guidance in terms a Linux/OpenVPN newb would understand.


Thanks