Page 1 of 1

/dev/net/tun disappears

Posted: Fri May 06, 2022 5:47 pm
by mouldy

Ok, to run easytether on EasyOS, I need /dev/net/tun. I have run across this in couple Puppies and other distributions. But running this solves that:

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

However in easy, once I shut it down and reboot this has to be run again, unique to easy, most distributions and some Puppies dont require it at all and others its a one time deal.

Now I run a script to start easytether so adding these two lines to script means its not a big deal. And its on desktop so one click and easytether is connected and I am tethered to my phone.

But I was just wondering why easyOS is different? Assume it doesnt remember changes made to /dev???


Re: /dev/net/tun disappears

Posted: Fri May 06, 2022 7:10 pm
by mouldy

Same deal using Azilink, needed /dev/net/tun. Azilink is similar but older open souce tethering app. There is an Azilink apk you sideload to phone, then works with any computer that has openvpn and adb installed. Really made cause early Android didnt come with native tethering. Then the phone companies decided to stiff people using their own data and charge extra to tether so locked the native Android tethering app unless customers paid ransom. Azilink and Easytether two workarounds.

So was curious if Azilink worked in EasyOS. Oops apparently very limited package repositories so cludged it statically copying openvpn binary plus libraries it needs from my MX19 install. Openvpn is very forgiving of such. Not first time, Manjaro is only distribution I found that comes out of box with both openvpn and adb. EasyOS already has adb installed. Anyway yea no problem, Azilink script (uses openvpn) works. I am tethered using Azilink now.

I gotta say I like EasyOS a lot, it runs fast. Boy if it only had apt-get.


Re: /dev/net/tun disappears

Posted: Fri May 06, 2022 10:24 pm
by OscarTalks

It is a kernel module. I am not sure exactly how it works but the system tries to load only the modules which it detects are needed. The command modprobe tun will load it (including creation of /dev/net).

Try using Menu > System > Boot Manager > Click here to add a new module
Move the tun module across to the right pane (it must not be loaded at the time when you do this)

Otherwise you could create a simple script in /root/Startup to check if /dev/net/tun exists and if not - load it.
That would run whenever X starts, so tun should always be there.
Name it something like "tun_module" or whatever you like

Code: Select all

#!/bin/sh
if [ ! -f /dev/net/tun ]; then
modprobe tun
fi

Others may have better ideas but I think either of those should help.


Re: /dev/net/tun disappears

Posted: Sat May 07, 2022 1:56 am
by BarryK

Yes, /dev starts as a clean slate at every bootup. This operation is performed during bootup:

Code: Select all

mount -t devtmpfs devtmpfs /dev

which causes the kernel to automatically create all the device nodes under /dev