libtuntap
libtuntap copied to clipboard
Error: Permission denied On Mac OS
Why I got permission denied?
OS
uname -a
Darwin unix 19.4.0 Darwin Kernel Version 19.4.0: Wed Mar 4 22:28:40 PST 2020; root:xnu-6153.101.6~15/RELEASE_X86_64 x86_64
Step to reproduce
# vim app.c
#include <stdio.h>
#include <tuntap.h>
int main() {
int ret;
struct device *dev;
ret = 0;
dev = tuntap_init();
if (tuntap_start(dev, TUNTAP_MODE_TUNNEL, TUNTAP_ID_ANY) == -1)
ret = 1;
tuntap_destroy(dev);
return ret;
}
# gcc app.c -o app -ltuntap
$ brew cask install tuntap
# ./app
Error: Permission denied
Hello,
In recent macOS releases Apple killed the kernel extension feature which we rely one to configure tun and tap devices. Also an alternative tun driver named utun
appeared I never finished implementing it in libtuntap.
One day perhaps, depending on my motivation.
Regards.
how to solve it?I have the same question!
To solve it one has to implement support for the utun
driver. You can either do that yourself or pay me.