Understanding the Error: subnet 192.168.10.0/24 overlaps with another one in this address space
in macvlan network creation with nerdctl
#4082
Unanswered
eric-ela-b3006c
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When creating a macvlan network with nerdctl, I encounter the error
subnet 192.168.10.0/24 overlaps …
.My goal is to create a flat network (i.e., a single segment network) that includes physical hosts, an ESXi server (with VMs), and containers within a containerd host.
The containerd host details are as follows:
192.168.10.125
192.168.10.0/24
192.168.10.128/25
A macvlan network is required for UDP multicast/broadcast. The
--network=host
option is not feasible in my context. Therefore, I am using rootful containerd.The command for network creation is:
(Option
--ip-range=
omitted for brevity).This command fails with the following error:
I am using containerd 1.7.25 as the containerization engine and nerdctl (v2.0.0) as the CLI on Rocky Linux 9.4, and I am very grateful for this software.
I understand that the subnet intersection check is implemented in netutil/netutil.go .
However, I am puzzled as to why this check is necessary for a macvlan network, as the same command succeeds in Docker (see below).
I am aware of a related discussion on GitHub: #3430, What is the purpose for subnet intersection checking in netutil.go?
The same command succeeds with Docker:
-> SUCCESS 😀
-> SUCCESS 😀
The check behind the error
subnet 192.168.10.0/24 overlaps …
seems (at least to me) to be overly restrictive. It also deviates from Docker’s behaviour.Moreover, there is a workaround:
After that, containers in macvlan network run properly.
While this workaround is a bit cumbersome, it is done only once for the network creation.
Essentially, this workaround bypasses the network intersection test, which relies on function GetLiveNetworkSubnets in netutil/subnet/subnet.go:
So my question is:
Is the error
subnet xxx.yyy.zzz.0/24 overlaps ...
really justified for the creation of a macvlan network in a flat network configuration?Thanks, I appreciate your time and attention to this matter.
Beta Was this translation helpful? Give feedback.
All reactions