libtuntap icon indicating copy to clipboard operation
libtuntap copied to clipboard

Error: Permission denied On Mac OS

Open ardikars opened this issue 4 years ago • 3 comments

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

ardikars avatar Jul 11 '20 23:07 ardikars

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.

tleguern avatar Jul 15 '20 15:07 tleguern

how to solve it?I have the same question!

km1562 avatar Jul 31 '21 13:07 km1562

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

tleguern avatar Aug 02 '21 09:08 tleguern