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

Make multiple Netbird client instances cooperate on the ip route table level on Linux (possibly other OS too?) #2023

Open
nazarewk opened this issue May 21, 2024 · 1 comment

Comments

@nazarewk
Copy link
Contributor

nazarewk commented May 21, 2024

Is your feature request related to a problem? Please describe.
While debugging issue with missing routes (turned out to work just fine, but uses additional table I was not aware of) and digging into the setup I have discovered my multiple Netbird instances at some point started interfering with each other's ip route tables.

Basically the last instance started seem to take over the 7120 aka netbird route table deleting all entries not owned by it, seems to happen here:

func (m *DefaultManager) Init() (peer.BeforeAddPeerHookFunc, peer.AfterRemovePeerHookFunc, error) {
if nbnet.CustomRoutingDisabled() {
return nil, nil, nil
}
if err := cleanupRouting(); err != nil {
log.Warnf("Failed cleaning up routing: %v", err)
}

Describe the solution you'd like
either of:

  1. The simple fix is to make those 2 values configurable:
    // NetbirdVPNTableID is the ID of the custom routing table used by Netbird.
    NetbirdVPNTableID = 0x1BD0
    // NetbirdVPNTableName is the name of the custom routing table used by Netbird.
    NetbirdVPNTableName = "netbird"
  2. The longer fix would be to use the same routing table, but don't interfere with network interfaces owned by other instances (having other interfce names)

Describe alternatives you've considered
see above

Additional context
I am running 2 Netbird instances (private and work-related) at the same time on NixOS (Linux) through NixOS/nixpkgs#287236

@nazarewk nazarewk changed the title make the route table ID and Name configurable on Linux (and other too?) make the route table ID and Name configurable on Linux (and other systems too?) May 21, 2024
@nazarewk nazarewk changed the title make the route table ID and Name configurable on Linux (and other systems too?) Make multiple Netbird client instances cooperate on the ip route table level on Linux (possibly other OS too?) May 21, 2024
@mlsmaycon
Copy link
Collaborator

Thanks for the request @nazarewk, we will discuss it and give you an feedback soon

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

2 participants