Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nothing happening on macOS #53

Open
juliuswaldmann opened this issue Dec 22, 2022 · 2 comments
Open

Nothing happening on macOS #53

juliuswaldmann opened this issue Dec 22, 2022 · 2 comments

Comments

@juliuswaldmann
Copy link

juliuswaldmann commented Dec 22, 2022

Hello. I used the following code to set up a simple tun device and read from it:

  `let mut config = tun::Configuration::default();
    config.address((10, 2, 0, 1))
        .netmask((255, 255, 255, 0))
        .up();

    #[cfg(target_os = "linux")]
    config.platform(|config| {
        config.packet_information(true);
    });

    let mut dev = tun::create(&config).unwrap();
    let mut buf = [0; 4096];

    loop {
        let amount = dev.read(&mut buf).unwrap();
        println!("{:?}", &buf[0 .. amount]);
    }`

As you can see it is just the example code from the repository. of course i imported everything correctly. I don't get an error and it seems to work at first but nothing happens when i send a packet to the ip address of the interface.

Running ipconfig getiflist also doesn't show a utun device. I am using macOS 13.1 Ventuara btw.
Thank you for your help.

@yinheli
Copy link

yinheli commented Dec 27, 2022

Did you setup route?
For example https://github.com/yinheli/kungfu/blob/master/src/gateway/server.rs#L131

@juliuswaldmann
Copy link
Author

Did you setup route?

For example https://github.com/yinheli/kungfu/blob/master/src/gateway/server.rs#L131

No I didn't cause I didn't know I had to. I will try it out and report back if it worked. Thank you for your help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants