/dev/net/tun disappears

Moderator: BarryK

Post Reply
User avatar
mouldy
Posts: 441
Joined: Tue Dec 08, 2020 3:53 pm
Has thanked: 27 times
Been thanked: 110 times

/dev/net/tun disappears

Post 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???

User avatar
mouldy
Posts: 441
Joined: Tue Dec 08, 2020 3:53 pm
Has thanked: 27 times
Been thanked: 110 times

Re: /dev/net/tun disappears

Post 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.

User avatar
OscarTalks
Posts: 603
Joined: Tue Jul 14, 2020 10:11 pm
Location: London UK
Has thanked: 1 time
Been thanked: 227 times

Re: /dev/net/tun disappears

Post 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.

User avatar
BarryK
Posts: 2273
Joined: Tue Dec 24, 2019 1:04 pm
Has thanked: 93 times
Been thanked: 564 times

Re: /dev/net/tun disappears

Post 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

Post Reply

Return to “EasyOS”