client error when loading a large number of routes #1705

Closed
opened 2025-11-20 06:05:06 -05:00 by saavagebueno · 2 comments
Owner

Originally created by @galiev on GitHub (Mar 13, 2025).

Originally assigned to: @nazarewk on GitHub.

I have a self hosted Netbird, I want to advertise a default route but subtract from the routing the subnets to which clients must use their own connection, but unfortunately there are too many networks and the client is not able to load it

2025-03-08T08:43:21Z WARN management/client/grpc.go:171: disconnected from the Management service but will retry silently. Reason: rpc error: code = ResourceExhausted desc = grpc: received message larger than max (11684977 vs. 4194304)

for example:
https://stat.ripe.net/data/country-resource-list/data.json?v4_format=prefix&resource=de

from netaddr import IPSet

reserved_ip_addresses = [
    "0.0.0.0/8",
    "10.0.0.0/8",
    "100.64.0.0/10",
    "127.0.0.0/8",
    "169.254.0.0/16",
    "172.16.0.0/12",
    "192.0.0.0/24",
    "192.0.2.0/24",
    "192.88.99.0/24",
    "192.168.0.0/16",
    "198.18.0.0/15",
    "198.51.100.0/24",
    "203.0.113.0/24",
    "224.0.0.0/4",
    "233.252.0.0/24",
    "240.0.0.0/4",
    "255.255.255.255/32"
]

default_route = IPSet(['0.0.0.0/0'])

for network in reserved_ip_addresses:
    default_route.remove(network)

for network in netbird_ip_addresses:
    default_route.remove(network)

for network in de_ipv4_addresses:
  default_route.remove(network)

print("number of networks {0}".format(len(list(default_route.iter_cidrs()))))
>> number of networks 24240

I understand that such a number of routes is not standard, if there are options to solve my problem, please let me know, I'll be happy to try

Originally created by @galiev on GitHub (Mar 13, 2025). Originally assigned to: @nazarewk on GitHub. I have a self hosted Netbird, I want to advertise a default route but subtract from the routing the subnets to which clients must use their own connection, but unfortunately there are too many networks and the client is not able to load it ```bash 2025-03-08T08:43:21Z WARN management/client/grpc.go:171: disconnected from the Management service but will retry silently. Reason: rpc error: code = ResourceExhausted desc = grpc: received message larger than max (11684977 vs. 4194304) ``` for example: https://stat.ripe.net/data/country-resource-list/data.json?v4_format=prefix&resource=de ```python from netaddr import IPSet reserved_ip_addresses = [ "0.0.0.0/8", "10.0.0.0/8", "100.64.0.0/10", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24", "192.0.2.0/24", "192.88.99.0/24", "192.168.0.0/16", "198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "224.0.0.0/4", "233.252.0.0/24", "240.0.0.0/4", "255.255.255.255/32" ] default_route = IPSet(['0.0.0.0/0']) for network in reserved_ip_addresses: default_route.remove(network) for network in netbird_ip_addresses: default_route.remove(network) for network in de_ipv4_addresses: default_route.remove(network) print("number of networks {0}".format(len(list(default_route.iter_cidrs())))) ``` ``` >> number of networks 24240 ``` I understand that such a number of routes is not standard, if there are options to solve my problem, please let me know, I'll be happy to try
saavagebueno added the management-service label 2025-11-20 06:05:06 -05:00
Author
Owner

@nazarewk commented on GitHub (Mar 13, 2025):

11 megabytes of routing configurations indeed seems very unusual. Are you sure an operating system can even handle this volume?

@nazarewk commented on GitHub (Mar 13, 2025): 11 megabytes of routing configurations indeed seems very unusual. Are you sure an operating system can even handle this volume?
Author
Owner

@galiev commented on GitHub (Mar 13, 2025):

Thank you, to be honest, I'm not sure about all client devices anymore, only about my linux routers)
I guess I need to come up with a different architecture so that traffic to German addresses doesn't go through my nodes, I think this issue can be closed, sorry.

@galiev commented on GitHub (Mar 13, 2025): Thank you, to be honest, I'm not sure about all client devices anymore, only about my linux routers) I guess I need to come up with a different architecture so that traffic to German addresses doesn't go through my nodes, I think this issue can be closed, sorry.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#1705