netavark icon indicating copy to clipboard operation
netavark copied to clipboard

Potentially avoid round-robin routing among default gateways

Open mheon opened this issue 1 year ago • 7 comments

Presently, when a container is connected to multiple networks, Netavark adds each network's default route to the container's routing table. The kernel then automatically round-robins between these routes, as they are identical aside from their destinations.

However, this behavior may not be desirable for all users; having a single exit point for all traffic leaving the container could be desirable for writing firewall rules or similar.

We could only add a single default route, but this would make connecting and disconnecting networks much more difficult (we'd have to determine if a default was already present and create if not). Alternatively, we could use route priority to prefer one of the default gateways, but this runs into similar difficulties.

mheon avatar Aug 09 '22 17:08 mheon