Forum

Full Version: no TUN device
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi

I updated my Xbian version today, which solved some issues with regards to autostrating (thanks for that :-)
But now I want to start my OpenVPN service, which refuses to do so with the following error:

Note: Cannot open TUN/TAP dev /dev/net/tun: No such file or directory (errno=2)

What changed with the previous version(s), I dont know which verison I was, but I just updated today ///

Thx

SS
I tried this:

$ sudo mkdir /dev/net
$ sudo mknod /dev/net/tun c 10 200


but dont really know what happened when I started openvpn, casue I lost connectiopn.
When connection came back, the /dev/net directory was gone again ...

strange my IPtables config ius gone as well ...
iptables -L
libkmod: ERROR ../libkmod/libkmod.c:554 kmod_search_moddep: could not open moddep file '/lib/modules/3.18.8+/modules.dep.bin'
iptables v1.4.14: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
What the hell happened when I upgraded?

apparently a problem with kmod version 20. How do I fix this?
Anyone?

can someone move this into the right subforum, I now noticed I opened this in cuboxi , iso RPI2
I doubt I am the only one with this problem?
great, now I am just talking to myself
Ok, got the tun device working again:

sudo mkdir -p /dev/net
sudo mknod /dev/net/tun c 10 200
sudo chmod 600 /dev/net/tun

And strangly my IPTABLES also works again now ...
(11th Apr, 2015 10:43 PM)supahfly Wrote: [ -> ]Ok, got the tun device working again:

sudo mkdir -p /dev/net
sudo mknod /dev/net/tun c 10 200
sudo chmod 600 /dev/net/tun

And strangly my IPTABLES also works again now ...

Thanks for posting this, similar problem here.
Do you still have it working after restart?

I added those lines in rc.local, but without the sudo part and I still have some problems.
I will add sudo now and see what happens.
Thanks again
@mborkp

What do you want to do?

1) Start an OpenVPN server at your RPi [1] or
2) establish a connection to a foreign OpenVPN server

But anyway, I assume that rc.local is executed too late

[1] For testing I installed OpenVPN server some month ago on a RPi2 from here (it's in German)
And yes, I forgot: You have to load tun module first

Simply add tun to /etc/modules so this module will loaded automatically when system starts, so your mkdir blah and mknod blah is not needed Smile
(8th Mar, 2016 10:31 PM)Nachteule Wrote: [ -> ]And yes, I forgot: You have to load tun module first

Simply add tun to /etc/modules so this module will loaded automatically when system starts, so your mkdir blah and mknod blah is not needed Smile

Thanks a lot for input. I spent few days on that and still having problems.
Basically, I like to use remote vpn server (torguard) to connect to.

I don't get tun error anymore but this:

Tue Mar 8 23:51:45 2016 OPTIONS IMPORT: timers and/or timeouts modified
Tue Mar 8 23:51:45 2016 OPTIONS IMPORT: --ifconfig/up options modified
Tue Mar 8 23:51:45 2016 OPTIONS IMPORT: route options modified
Tue Mar 8 23:51:45 2016 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
Tue Mar 8 23:51:45 2016 ROUTE_GATEWAY 192.168.9.254/255.255.255.0 IFACE=eth0 HWADDR=b8:27:eb:6e:42:c9
Tue Mar 8 23:51:45 2016 TUN/TAP device tun7 opened
Tue Mar 8 23:51:45 2016 TUN/TAP TX queue length set to 100
Tue Mar 8 23:51:45 2016 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Tue Mar 8 23:51:45 2016 /sbin/ip link set dev tun7 up mtu 1500
Tue Mar 8 23:51:45 2016 /sbin/ip addr add dev tun7 local 10.9.0.10 peer 10.9.0.9
Tue Mar 8 23:51:47 2016 /sbin/ip route add 188.116.37.186/32 via 192.168.9.254
Tue Mar 8 23:51:47 2016 /sbin/ip route add 0.0.0.0/1 via 10.9.0.9
Tue Mar 8 23:51:47 2016 /sbin/ip route add 128.0.0.0/1 via 10.9.0.9
Tue Mar 8 23:51:47 2016 /sbin/ip route add 10.9.0.1/32 via 10.9.0.9
RTNETLINK answers: File exists
Tue Mar 8 23:51:47 2016 ERROR: Linux route add command failed: external program exited with error status: 2

my route command gives me this:

Destination Gateway Genmask Flags Metric Ref Use Iface
default 10.9.0.9 128.0.0.0 UG 0 0 0 tun7
default home 0.0.0.0 UG 0 0 0 eth0
10.9.0.1 10.9.0.5 255.255.255.255 UGH 0 0 0 tun0
10.9.0.5 * 255.255.255.255 UH 0 0 0 tun0
10.9.0.5 * 255.255.255.255 UH 0 0 0 tun3
10.9.0.9 * 255.255.255.255 UH 0 0 0 tun7
10.9.0.9 * 255.255.255.255 UH 0 0 0 tun6
10.9.0.25 * 255.255.255.255 UH 0 0 0 tun4
10.9.0.37 * 255.255.255.255 UH 0 0 0 tun2
10.9.0.45 * 255.255.255.255 UH 0 0 0 tun1
10.9.0.69 * 255.255.255.255 UH 0 0 0 tun5
104.129.28.210 home 255.255.255.255 UGH 0 0 0 eth0
104.223.94.122 home 255.255.255.255 UGH 0 0 0 eth0
128.0.0.0 10.9.0.9 128.0.0.0 UG 0 0 0 tun7
168.1.24.89 home 255.255.255.255 UGH 0 0 0 eth0
168.1.99.232 home 255.255.255.255 UGH 0 0 0 eth0
185.2.137.220 home 255.255.255.255 UGH 0 0 0 eth0
188.116.37.186 home 255.255.255.255 UGH 0 0 0 eth0
192.168.9.0 * 255.255.255.0 U 0 0 0 eth0
209.95.51.102 home 255.255.255.255 UGH 0 0 0 eth0

Don't know, did lot's of reading updates and that what I got now.
It all started when I tried to set up Openvpn plugin http://brianhornsby.com/blog/how-to-setup-your-vpn-client

Thanks again

EDIT: did the change you suggested it loads ok but the above problem still persists.
Quote:BTW, how do I set tun in /etc/modules ?

Thanks again

EDIT: ok added tun in modules. Should be just tun or tun c 10 200?
And what about those lines in rc.local should I remove them all?

mkdir /dev/net
mknod /dev/net/tun c 10 200
chmod 660 /dev/net/tun

Simply add the line to the file /etc/modules

Code:
tun

And don't forget a <return> at the end of the line
Hi,
some progress here, it runs now from the console if the demon is stopped and then command
openvpn --verb 3 --config /etc/openvpn/TheFile.conf is isussed.

Still Does not work with OpenVpn plugin thou, the plugin log gives me:
ERROR: Cannot ioctl TUNSETIFF tun: Operation not permitted (errno=1)

But we getting somewhere....
ok,
I think I got it running from within the plugin, great!
I had to set up "run as sudo" and had to enable the password, both in plugin settings. Pain in the neck to put it every time you want to change country.
I wander if that can be changed somehow ?
Thanks
What (Kodi ?) plugin are you using?
Hi,
as posted before, http://brianhornsby.com/blog/how-to-setup-your-vpn-client for Kodi.
As per sudo/pass issue I suspect it is privileges issue, but not sure which part rights should be elevated.
Thanks
Pages: 1 2
Reference URL's