netbird icon indicating copy to clipboard operation
netbird copied to clipboard

Feature: switching between multiple profiles (one being active)

Open mlsmaycon opened this issue 10 months ago • 11 comments

See https://github.com/netbirdio/netbird/issues/446 for supporting multiple networks/accounts simultaneously


Current Default Configuration:

  • We’ve been planning to move the configuration to a user path, which will allow us to move to a more secure structure, especially for shared user computers. With this, we see the following paths for profiles: Default and setup-key activated keys: /etc/netbird/profiles/default.json User profiles: /home/user/.config/netbird/profiles.

Creating a New Profile with CLI:

  • Running netbird profiles new <profile_name> will create a memory placeholder for the new profile. This will allow us to define the place to store the configuration depending on the user input when login in.

  • After running netbird up, the profile file is created. If the users used a setup key, the file is saved in the /etc/netbird/profiles directory, otherwise it will be saved in the user's directory.

Creating a New Profile with GUI:

  • We can create the profile and leave it in memory, or, as GUI activation is usually user-bound, we can create the profile on disk already since we know the user.

Storing selected profile Storing Profile State:

  • The most recently selected profile should be stored in a state file located at /var/lib/netbird or another designated user profile state path (to be determined). So, on system boot or daemon restart, we have the last profile.

Switching Profiles and Side Effects Profile Switching Commands:

  • netbird profiles select <profile_name> - Selects the specified profile.

  • netbird up --profile <profile_name> - Brings up the VPN with the selected profile.

  • netbird login --profile <profile_name> - Logs in using the selected profile.

Side Effect:

  • Switching profiles will disconnect the current running process.
  • Switching profile will immediately start the connection with the other profile unless a --skip-concect flag is passed

Behavior on netbird Commands On netbird down:

  • The CLI should display the current profile when the netbird down command is executed.

On netbird up:

  • The CLI should display the current profile when the netbird up command is executed.

On netbird service restart:

  • The last selected profile should be reloaded from the state stored in /var/lib/netbird or the user profile state path (to be determined).

Compatibility with Existing Installations Handling Existing Installs:

The current profile will be copied into /etc/netbird/profiles/default.json.

Graphical User Interface (GUI) changes Profile Display:

  • The GUI will show the current profile between the “Connected” and “Connect” options. Display order: Connected ===================== FancyProfile > Add profile ===================== Connect FancyProfile > Select Disconnect Delete → warning box

Profile Management:

  • A submenu will list all profiles with options to create new profiles. Each profile will have options to select or delete it.

  • The GUI settings menu will switch to the selected profile settings.

Profile Loading on Restart:

  • Upon restarting, the application will load the current profile from the stored state using the daemon.

mlsmaycon avatar Feb 03 '25 08:02 mlsmaycon

I'd like to see this, but would have a few requests/concerns:

Would there be a way to set a 'default' profile prior to user login? Basically, we love to use netbird to provide line of sight to a DC for offsite machines.

Could the Netbird service disconnect from the user session when a user logs out, and connect back to this 'default'?

1nerdyguy avatar Feb 03 '25 14:02 1nerdyguy

Could the Netbird service disconnect from the user session when a user logs out, and connect back to this 'default'?

This would be a handy feature because selecting things takes time...

Also abou whole concept of this thing I think its OK, disconnecting when switching profiles is natural for me because I think the concept is not built on handling 2 different networks.

Looking forward to test this out.

Oriann avatar Feb 21 '25 18:02 Oriann

This feature would be awesome! Hope to see it soon!

Regarding the profiles, i'd love to have another button to directly jump to the file explorer. Also an import/export function would be great.

arnehude avatar Mar 11 '25 10:03 arnehude

Is there a timeline for this? this feature would be extremely helpful.

StefanEger avatar Mar 19 '25 13:03 StefanEger

I would propose that it should be possible to be connected to multiple networks at the same time. E.g. a private/personal network and a work network.

Also there could be peer-servers which should be accessable from multiple networks.

easyjoh avatar Apr 19 '25 09:04 easyjoh

@easyjoh

How do you propose we handle conflicts, if allowing multiple networks to be connected at once?

If Network A is allowed access to Resource 1, but Network B disallows access to Resource 1, which wins?

I'd prefer to have both a 'fallback' network, such as something that allows access to an extremely limited resource pool, and then have it connect to a network based on user login with credentials. This also follows SASE principles of identification and authorization to access resources.

1nerdyguy avatar Apr 19 '25 16:04 1nerdyguy

I would propose that it should be possible to be connected to multiple networks at the same time. E.g. a private/personal network and a work network.

see https://github.com/netbirdio/netbird/issues/446

nazarewk avatar May 06 '25 14:05 nazarewk

Would love to see this happen soon! It's blocking me from using for multiple work related networks right now.

👍 upvote

zerobearing2 avatar May 20 '25 13:05 zerobearing2

Love to see this as your competitors have this

saguarobrian avatar May 20 '25 16:05 saguarobrian

Would be amazing to have a list of configuration files to switch between. e.g. a config option which has the list of your configs. When you click one config, and you then click on (disconnect and) connect, the server configured in that config file will be connected to. It doesn't even need to be a simultanious connection to multiple servers, one at a time is indeed plenty in most cases.

rickiewars avatar May 22 '25 15:05 rickiewars

Looking forward to this.

netandreus avatar Jun 27 '25 05:06 netandreus

Definitely another vote for this. I am in the situation of having two netbird networks, one for work and one for home. I would suggest tabling the "two networks connected simultaneously" issue, that seems like a second level feature. Simply being able to create separate profiles and have a well-established mechanism to switch between them would be very welcome.

rearden888 avatar Jul 15 '25 13:07 rearden888

ZeroTier has a menu option and can be connected to multiple networks at the same time and enable or disable the connections.

saguarobrian avatar Jul 15 '25 14:07 saguarobrian

Also waiting for this would be very useful!

sh00t3r avatar Jul 15 '25 15:07 sh00t3r

Hey folks, you can track the progress here: https://github.com/netbirdio/netbird/pull/3980, some of the binaries are also available in the release workflows if you want to try it before. But be aware that a few things will change with this release, like config file location.

mlsmaycon avatar Jul 15 '25 16:07 mlsmaycon

We have released v0.52.0, which introduced this feature. This is an MVP that we plan to quickly build upon with user experience improvements.

I am closing this feature request. Please report any problems you encounter and feedback you might have in separate follow-up issues. Linking back to this feature request would help with quicker identification and addressing of those.

nazarewk avatar Jul 30 '25 08:07 nazarewk