Stephen Becker
Occasional Visitor
Short question: what is the best script to run the modprobe tun command to ensure tun devices are setup after reboot? It does not appear to work correctly when included in services-start
Long version with background:
I am using fastd to setup an IP tunnel to another Asus-Merlin router, but ran into an issue where the service does not start correctly after a reboot. The error says "could not open TUN/TAP device file: No such file or directory"
The command modprobe tun creates /dev/tun and /dev/net/tun allowing the service to start, however, only when I run the command manually. I have tried adding that command to /jffs/scripts/services-start before Entware is called, but it does not work. It creates /dev/tun but not /dev/net/tun.
I suspect either a kernel mod has not yet loaded, or the firmware does something shortly after boot that resets network devices.
Any advice on how to fix this? I could probably have the script sleep an arbitrary amount of time before running modprobe and starting Entware, but I would like a more graceful solution. Also not entirely sure if the services-start script blocks anything else on the router that may make sleeping just postpone the same issue.
Long version with background:
I am using fastd to setup an IP tunnel to another Asus-Merlin router, but ran into an issue where the service does not start correctly after a reboot. The error says "could not open TUN/TAP device file: No such file or directory"
The command modprobe tun creates /dev/tun and /dev/net/tun allowing the service to start, however, only when I run the command manually. I have tried adding that command to /jffs/scripts/services-start before Entware is called, but it does not work. It creates /dev/tun but not /dev/net/tun.
I suspect either a kernel mod has not yet loaded, or the firmware does something shortly after boot that resets network devices.
Any advice on how to fix this? I could probably have the script sleep an arbitrary amount of time before running modprobe and starting Entware, but I would like a more graceful solution. Also not entirely sure if the services-start script blocks anything else on the router that may make sleeping just postpone the same issue.