Open xiaoyar opened 2 years ago
Hi @xiaoyar I also meet a similar issue and got reply from others. https://github.com/containers/podman/issues/14747
For netavark, create a json file /etc/containers/networks/podman.json to define dual stack network For cni, create /etc/cni/net.d/podman.conflist
Maybe there is no cli command for it, we have to change the backend config file.
Hope this can help you
Actually, I am not looking for a workaround, instead I want to confirm if Podman default network can support dual stack in a proper way, e.g. by specifying correct options in containers.conf.
This is not a workaround, it is currently the only way to do it.
Adding a new default_ipv6_subnet
is doable but not sure how much benefit this has. I would like to avoid adding config settings for this when you can just create/edit the actual network config file yourself.
Given we don't actually create the default network as a file anymore, it seems like it could be valuable?
Somehow I still feel it's a workaround, if we use this approach in product code, the code will have to be aware of which network backend is used, that means,
However, if we can specify both IPv4 subnet and IPv6 subnet in containers.conf, the product code can still keep network backend agnostic.
If it's not doable to make it in containers.conf, is it possible to leverage podman network
command to customize the default network?
e.g. Introduce a new sub command podman network modify
or podman network update
to edit the existing network?
Adding new commands to modify existing networks sounds very hard to support and not something I would recommend anyone to do. If you have running containers on the network things can go bad quickly if you modify it (same if you modify it in containers.conf).
Adding a new default_ipv6_subnet
field to containers.conf make sense but I do not like adding fields for all settings, e.g. dns.
Okay, let's give up the idea to introduce a new podman network
sub command to modify existing networks.
Any other approach, other than adding a new default_ipv6_subnet
option in containers.conf, besides manually generating/editing network config file of default network, any other approach, to make default network properly support dual stack?
Is it possible to let podman network create
modify the configuration of default network?
That means, when the specified network is the default network, podman network create
should modify the configuration of default network, instead of reporting an error like "network already exists".
A friendly reminder that this issue had no activity for 30 days.
@mheon @Luap99 Could you answer @xiaoyar's question?
you would need to delete the default network and just recreate it i think?
IMO, the answer here is to make default network configuration part of containers.conf
(or some other config file). The current situation (manually generating a network config file and editing it) does not seem like a viable long-term solution given its complexity.
@baude
you would need to delete the default network and just recreate it i think?
The problem is, it's not allowed to delete the default network.
# podman network rm podman
Error: default network podman cannot be removed
@mheon , I totally agree with you, "making default network configuration in containers.conf
also support IPv6" is the original purpose of opening this issue ticket.
What do you think, @Luap99 ? Do you think it's feasible to go that way?
A friendly reminder that this issue had no activity for 30 days.
@Luap99 Waiting for an answer from you.
As said before I am fine with adding an ipv6 subnet field to containers.conf. What I do not want are fields for every single network setting because that is already possible if you create the config file manually.
Then we really ought to make the process of producing the config file manually either easier, or better documented, because it is a frequent question.
Can we ship a configuration file with everything commented out?
Thank you, @rhatdan , @mheon , @Luap99 .
So, if I am reading correctly, we are going to introduce a new variable, such as default_subnet6
, in containers.conf, so that the default podman network can support pure IPv4(only default_subnet
in containers.conf), pure IPv6(only default_subnet6
in containers.conf), and IPv4/IPv6 dual stack(both default_subnet
and default_subnet6
in containers.conf)?
Do you have ETA for this, in which version of Podman will this be included?
Any workaround for this issue? On the system with disabled IPv6, it cause issue. we cannot run container with default network.
[root@bip-ctrl01-l1-rx ~]# sysctl net.ipv6.conf.all.disable_ipv6
net.ipv6.conf.all.disable_ipv6 = 1
[root@bip-ctrl01-l1-rx ~]#
[root@bip-ctrl01-l1-rx ~]# podman network inspect podman
[
{
"name": "podman",
"id": "2f259bab93aaaaa2542ba43ef33eb990d0999ee1b9924b557b7be53c0b7a1bb9",
"driver": "bridge",
"network_interface": "podman0",
"created": "2022-11-22T23:52:57.188882939+07:00",
"subnets": [
{
"subnet": "10.255.255.0/24",
"gateway": "10.255.255.1"
},
{
"subnet": "fc00:2222:3333::/64",
"gateway": "fc00:2222:3333::1"
}
],
"ipv6_enabled": true,
"internal": false,
"dns_enabled": false,
"ipam_options": {
"driver": "host-local"
}
}
]
[root@bip-ctrl01-l1-rx ~]#
[root@bip-ctrl01-l1-rx ~]# podman run --rm --detach busybox:latest /bin/sleep 5
Error: netavark: failed to configure bridge and veth interface: failed while configuring network interface: failed to set ip address to podman0: Permission denied (os error 13)
[root@bip-ctrl01-l1-rx ~]#
@kgfathur I don't understand what your point is? This issue is about no easy way to enable ipv6 on the default network.
If you manually add ipv6 subnets to your default network then yes it will not work if you disable ipv6 on your host.
honestly podman should be able to detect the hosts network stack and mirror its capabilities by default. this is issue is pretty ug from a usability standpoint.
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind feature /network
Description
Because the 'network.default_subnet' option in containers.conf can only take either an IPv4 CIDR string or an IPv6 CIDR string, the default network can only be either IPv4 only or IPv6 only. On the other hand, other networks created by
podman network create
can be IPv4 only, IPv6 only, or IPv4/IPv6 dual stack. We may need the default network to support dual stack when the host network is dual stack. Is it possible to make the default network to also support IPv4/IPv6 dual stack?Steps to reproduce the issue:
It's the default network, we can observe the behavior by default.
Describe the results you received:
Describe the results you expected: e.g. some possible approaches
podman network create
Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):