Skip to content

nerdctl network create --ip-range injects a non-existent property ipRange to CNI IPAM config #5068

Closed

Description

@AkihiroSuda

type IPAMRange struct {
Subnet string `json:"subnet"`
RangeStart string `json:"rangeStart,omitempty"`
RangeEnd string `json:"rangeEnd,omitempty"`
Gateway string `json:"gateway,omitempty"`
IPRange string `json:"ipRange,omitempty"`
}

nerdctl network --ip-range injects ipRange property in .plugins[0].ipam.ranges[][], but this property does not seem supported by the CNI plugin.

https://github.com/containernetworking/plugins/blob/v1.9.1/plugins/ipam/host-local/backend/allocator/config.go#L68-L73

ipRange could be dynamically computed from rangeStart and rangeEnd.


Reproducer:

$ nerdctl network create  --driver=bridge --subnet=172.28.0.0/16 --ip-range=172.28.5.0/24   --gateway=172.28.5.254 br0

$ cat /etc/cni/net.d/default/nerdctl-br0.conflist 
{
  "cniVersion": "1.0.0",
  "name": "br0",
  "nerdctlID": "0f1575ab177c63b4a9de71c81aaf76cd2680bc20fa9b0ba6444e14e5303803e8",
  "plugins": [
    {
      "type": "bridge",
      "bridge": "br-0f1575ab177c",
      "isGateway": true,
      "ipMasq": true,
      "hairpinMode": true,
      "ipam": {
        "ranges": [
          [
            {
              "gateway": "172.28.5.254",
              "ipRange": "172.28.5.0/24",
              "rangeEnd": "172.28.5.255",
              "rangeStart": "172.28.5.1",
              "subnet": "172.28.0.0/16"
            }
          ]
        ],
        "routes": [
          {
            "dst": "0.0.0.0/0"
          }
        ],
        "type": "host-local"
      }
    },
    {
      "type": "portmap",
      "capabilities": {
        "portMappings": true
      }
    },
    {
      "type": "firewall",
      "ingressPolicy": "same-bridge"
    },
    {
      "type": "tuning"
    }
  ]
}

Activity

  1. changed the title [-]`nerdctl network --ip-range` injects a non-existent property `ipRange` to CNI IPAM config[/-] [+]`nerdctl network create --ip-range` injects a non-existent property `ipRange` to CNI IPAM config[/+] on Jul 14, 2026
  2. mayur-tolexo commented on Jul 17, 2026

    @mayur-tolexo
    Contributor

    /assign

  3. added a commit that references this issue on Jul 17, 2026
    7191d26
  4. added a commit that references this issue on Aug 4, 2026
    8136de5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions