LaKabane / libtuntap

The portable Tun/Tap devices configuration utility
194 stars 63 forks source link

Error: Permission denied On Mac OS #31

Open ardikars opened 4 years ago

ardikars commented 4 years ago

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

tleguern commented 4 years ago

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.

km1562 commented 3 years ago

how to solve it?I have the same question!

tleguern commented 3 years ago

To solve it one has to implement support for the utun driver. You can either do that yourself or pay me.