Background
The current CNI Static IPAM plugin does not explicitly define or document support for ECMP (Equal-Cost Multi-Path) routing when multiple routes with the same destination prefix are provided.
I would like to clarify and formally support ECMP route configuration as part of the plugin behavior.
Proposal
I think two possible approaches:
Option 1: Implicit ECMP via multiple routes
Allow users to define multiple routes with the same destination prefix but different gateways, and install them as ECMP routes inside the Pod.
"routes": [
{ "dst": "0.0.0.0/0", "gw": "10.0.0.1" },
{ "dst": "0.0.0.0/0", "gw": "10.0.0.2" }
]
Note:
- This is closer to a bug fix for the current inconsistency between IPv4 and IPv6 behavior than to a completely new feature.
This behavior already works for IPv6 in practice. (ref: https://github.com/torvalds/linux/blob/v6.19/net/ipv6/ip6_fib.c#L1152-L1162) This was misleading. Sorry. Although this behavior currently works in IPv6, it does not appear to be intentionally supported.
We propose to extend and standardize this behavior for IPv4 as well. This was misleading. Sorry. I want to implement that plugin handles this way of writing and intentionally inserts ECMP route in both v4 and v6.
- I think this should be clearly documented as supported behavior.
Option 2: Explicit ECMP syntax
Introduce a dedicated syntax in the routes field to explicitly define ECMP routes.
This could improve clarity and avoid ambiguity in interpretation.
However, this approach would require extending the current API/schema.
Use case
Our use case is as follows:
- In an OpenStack environment, we create multiple routers connected to the same L2 network.
- This network is attached to worker VMs.
- Inside the VM, we attach an additional interface to Pods using ipvlan (as a secondary interface).
- For this interface, we want to configure ECMP routes where multiple OpenStack routers act as gateways.
This requires the ability to define multiple equal-cost default routes in the CNI configuration.

Background
The current CNI Static IPAM plugin does not explicitly define or document support for ECMP (Equal-Cost Multi-Path) routing when multiple routes with the same destination prefix are provided.
I would like to clarify and formally support ECMP route configuration as part of the plugin behavior.
Proposal
I think two possible approaches:
Option 1: Implicit ECMP via multiple routes
Allow users to define multiple routes with the same destination prefix but different gateways, and install them as ECMP routes inside the Pod.
Note:
This behavior already works for IPv6 in practice. (ref: https://github.com/torvalds/linux/blob/v6.19/net/ipv6/ip6_fib.c#L1152-L1162)This was misleading. Sorry. Although this behavior currently works in IPv6, it does not appear to be intentionally supported.We propose to extend and standardize this behavior for IPv4 as well.This was misleading. Sorry. I want to implement thatpluginhandles this way of writing and intentionally inserts ECMP route in both v4 and v6.Option 2: Explicit ECMP syntax
Introduce a dedicated syntax in the
routesfield to explicitly define ECMP routes.This could improve clarity and avoid ambiguity in interpretation.
However, this approach would require extending the current API/schema.
Use case
Our use case is as follows:
This requires the ability to define multiple equal-cost default routes in the CNI configuration.