-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Would like syntax to request a route to gateway IP #598
Comments
If I understood correctly, the problem is to add a route with a gateway that does not belong to any subnet of the interface being added. I see 2 ways to solve this problem by modifying the Route spec. The first one would be to add a route flag property, so The second one would be to add a route scope property, so
An extra route for 169.255.100.6/32 would be needed so 169.255.100.6 can be used as a gateway for the second route. I created a PR for this: #1068 This configuration would then work (route gateway 169.255.100.160 doesn't belong to 10.0.0.0/24 subnet, but scope 253 (link) allows the route to be created): {
"cniVersion": "1.0.0",
"name": "test-scope",
"master": "eth0",
"type": "macvlan",
"ipam": {
"addresses": [
{
"address": "10.0.0.1/24"
}
],
"routes": [
{
"dst": "0.0.0.0/0",
"gw": "169.255.100.160",
"scope": 253
}
],
"type": "static"
}
} |
Fixes: containernetworking#598 Signed-off-by: Lionel Jouin <[email protected]>
Thank you. I had forgotten about this issue, and don't use that piece of software any more. |
Fixes: containernetworking#598 Signed-off-by: Lionel Jouin <[email protected]>
Fixes: containernetworking#598 Signed-off-by: Lionel Jouin <[email protected]>
In the (IPv4) case where we have a bridge, the bridge has an IP address we could use as a gateway, but that IP address is not in the subnet we are using for the current ADD, we can make it work by adding a route to the bridge address.
We do this in the Weave Net CNI plugin here: https://github.com/weaveworks/weave/blob/6e3f8a1c7a0ae8c011f7e28e6e06e6164396d03e/plugin/net/cni.go#L157
I would like there to be some way to request this behaviour in the CNI config, either in the spec or as a convention, so we don't have to do it "by magic".
We can't use the existing route syntax because (a) sometimes we need it and sometimes we don't, depending on the subnets and (b) we don't know the gateway address ahead of time: it depends what else has used the network on the same node.
Prompted by containernetworking/plugins#233 which describes a related scenario.
The text was updated successfully, but these errors were encountered: