$ 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"
}
]
}
nerdctl/pkg/netutil/cni_plugin.go
Lines 31 to 37 in cb8fa6c
nerdctl network --ip-rangeinjectsipRangeproperty 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
ipRangecould be dynamically computed fromrangeStartandrangeEnd.Reproducer: