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

Infinite connect on Mac M3 | error creating tun device: Interface name must be utun[0-9]* #2741

Open
DyllasDek opened this issue Oct 15, 2024 · 8 comments

Comments

@DyllasDek
Copy link

Describe the problem

Trying to connect to vpn from Mac M3 but encounter error:
/var/log/netbird/client.log

2024-10-15T14:17:34+03:00 ERRO client/internal/connect.go:277: error while starting Netbird Connection Engine: create wg interface: error creating tun device: Interface name must be utun[0-9]*

To Reproduce

Steps to reproduce the behavior:

  1. Install pkg from dashboard
  2. Click on connect
  3. Log in with Oauth, see Login Successful
  4. See infinite connection in application, see error in logs

Expected behavior

Connection established

Are you using NetBird Cloud?

Self hosted Netbird

NetBird version

0.30.1 both on client and server side

Screenshots

image

Additional context

I know that for now Netbird doesn't support M3, but hope this issue will help to determine issue and add support for M3.

@DyllasDek
Copy link
Author

I see how to resolve this.
The problem in automatic interface name generation
If you run app - it generates interface name with my MacBook name, but it should be utun[0-9]*

Changing name of the interface solves the issue, but I think that should be fixed in app to not encounter such problem in future.
image

@DyllasDek DyllasDek changed the title Infinite connect on Mac M3 Infinite connect on Mac M3 | error creating tun device: Interface name must be utun[0-9]* Oct 15, 2024
@alex-ritter
Copy link

I have the same issue,

changing the name of the interface does not fix the issue for me.

@mlsmaycon
Copy link
Collaborator

Hello @alex-ritter and @DyllasDek by default the macOS client uses the correct interface name prefix. Can you clarify if you are getting the wrong name after just installing the client?

@alex-ritter
Copy link

Hi @mlsmaycon

Netbird I believe is selecting the right interface name (utun5) and used to work on my Mac. After updating to the new relay system all agents other then my mac fails to connect to netbird.

Netbird fails on my mac because it says that the interface is currently in use (utun5). Changing the name of the interface doesn't fix the issue. I'm tempted just to reinstall macos but this seems like a netbird issue.

@alex-ritter
Copy link

alex-ritter commented Oct 16, 2024

So I just reinstalled Mac OS. Confirmed that the default interface name is utun100 on a fresh install. Although it does work when utun is set to 100, and now I'm not getting the other issue where it says that the interface is in use.

image

Another thing that netbird needs improving on Mac OS is if there's a slightest issue with the VPN configuration within the system it is extremely hard to debug anything. Log files are extremely inaccurate and most of the time logs are not even generated. I think the Mac OS port of netbird needs another look before it can be used reliably in production cases. We can't be reinstalling Mac OS to fix issues with netbird.

I have not had any issues with netbird on Linux or Windows, I've only had issues with netbird on Mac OS after deleting the log files or modifying network settings within Mac OS for other interfaces. This could have been a issue with having multiple VPN's installed as well, I had Unifi's wifiman teleport installed to configure netbird's virtual machine on my proxmox instance to get netbird setup, and I had proton and nord vpn installed as well. But of corse I had none of these running at the same time with netbird.

I'll keep on using netbird for the next few weeks on this new install, if I find any issues I'll report back. I'm willing to contribute to netbird to help fix these issues if needed as well :)

@DyllasDek
Copy link
Author

Hello @alex-ritter and @DyllasDek by default the macOS client uses the correct interface name prefix. Can you clarify if you are getting the wrong name after just installing the client?

HI! I get wrong name on fresh install. I can't reproduce error because now it stores cache. From logs I found my init interface name: failed creating tunnel interface Danila-Mac

@DyllasDek
Copy link
Author

I found that it turns out that during the initial setup, I accidentally changed the name of the interface. This is my mistake, however, it seems to me that then there should be validation in the application for the interface name.

@alex-ritter
Copy link

Yeah Danila-Mac seems like it's a custom interface name... That should give an error 'Interface name must be utun[0-9]*'.

Seems like utun100 works for me after a fresh install of Mac OS and Netbird. Netbird on my last install started being unstable after removing the log file and config files to try to reinstall netbird during a different issue.

When I removed the log file and config files before, logs stop generating, it somehow still used the old configuration, and Netbird became extremely unstable afterwords with reinstalls not fixing either of those issues. This time i'm not touching those files because I don't want any issues lol

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

No branches or pull requests

3 participants