Closed netixx closed 2 months ago
Thanks for contributing. LGTM in general. But I think we should make this configurable to avoid confusion for those who accidentally start multiple instances they didn't intent to.
ok, I added an option on the BGP server itself.
Maybe it would be better to push a list of options in the ListenAddrsPerVRF
, so that we could set that per listener, but that is breaking change in terms of API.
( Instead of map[string][]string we would need a
map[string]struct{
listenAddr []string
reusePort bool
}
)
Let me know if you would prefer that option :)
Enable SO_REUSEPORT on the TCP socket,
This enables multiple instances of the BGP server to be started on the same machine, binding to the same TCP port.
The kernel will load-balance the incoming connections to all listening instances. Instances that have the correct BGP peers configured will take the connection, and those who don't will reject it, letting another instance have a try when the router restarts the connection.