cni icon indicating copy to clipboard operation
cni copied to clipboard

bridge: adding route without gw, creates still gateway route?

Open f1-outsourcing opened this issue 5 years ago • 3 comments

{
  "name" : "test-bridge",
  "type" : "bridge",
  "bridge": "test-br0",
  "isGateway": false,
  "ipMasq": false,
  "ipam": {
    "type": "host-local",
    "subnet": "192.168.122.0/24",
    "rangeStart": "192.168.122.171",
    "rangeEnd": "192.168.122.179",
    "routes": [
        { "dst": "192.168.10.153/32" }
    ]
  }
}

[@m03 mesos-cni]# CNI_PATH="/usr/libexec/cni/" NETCONFPATH="/etc/mesos-cni" cnitool-0.6.0 add test-bridge /var/run/netns/testing
{
    "cniVersion": "0.2.0",
    "ip4": {
        "ip": "192.168.122.177/24",
        "gateway": "192.168.122.1",
        "routes": [
            {
                "dst": "192.168.10.153/32",
                "gw": "192.168.122.1"
            }
        ]
    },
    "dns": {}
}

creates these routes

[@m03 ~]# ip netns exec testing ip route
192.168.10.153 via 192.168.122.1 dev eth0
192.168.122.0/24 dev eth0 proto kernel scope link src 192.168.122.177

I would like to know how I can add a route that is the equivalent of

ip route add 192.168.10.153/32 dev eth0

[@m03 ~]# ip netns exec testing ip route
192.168.10.153 dev eth0 scope link
192.168.122.0/24 dev eth0 proto kernel scope link src 192.168.122.177

f1-outsourcing avatar Feb 24 '19 13:02 f1-outsourcing

Hi there, That's a good point; with isGateway false, we should not be setting the gateway.

Would you mind re-filing this issue against the plugins repository? It's a bug in the bridge plugin. Do you think you'll be able to fix this?

squeed avatar Mar 06 '19 16:03 squeed

Done

https://github.com/containernetworking/plugins/issues/273#issue-418035410

f1-outsourcing avatar Mar 06 '19 22:03 f1-outsourcing

Are you sure? Does not seem anyone is monitoring there?

f1-outsourcing avatar Mar 15 '19 18:03 f1-outsourcing