Host: Darwin Kernel Version 25.1.0
The code is as follows:
fn main() -> anyhow::Result<()> {
let mut config = tun::Configuration::default();
config
.address((10, 0, 0, 9))
.netmask((255, 255, 255, 0))
.destination((10, 0, 0, 1))
.up();
let mut dev = tun::create(&config)?;
let mut buf = [0; 4096];
loop {
let amount = dev.recv(&mut buf)?;
println!("{:?}", &buf[0..amount]);
}
Ok(())
}
Executing as a normal user results in the following error:
Error: Operation not permitted (os error 1)
I could imagine it might work when running as root but I am a bit scared of doing so; however, the documentation is not making any statements about the required privileges.
Host:
Darwin Kernel Version 25.1.0The code is as follows:
Executing as a normal user results in the following error:
I could imagine it might work when running as root but I am a bit scared of doing so; however, the documentation is not making any statements about the required privileges.