pasta network missing ip, gateway, etc. with default settings #26651
Replies: 2 comments
-
That is the expected behavior, pasta and slirp4netns are network modes that function fundamentally different from bridge networks. They only connect a single namespace an the ip there isn't actually routeable from anywhere besides that ns so it would be pointless to list in inspect as that would just mean other containers would assume they connect to it when they don't. As for why you cannot reach the host ip that is also because pasta copies it into its namespace, see So what you should do is use bridge and then connect to |
Beta Was this translation helpful? Give feedback.
-
Ok, thanks for the explanation. And big thumbs up for that easy solution. That |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Issue Description
It looks like that using network modes other than bridge result in partial working networks. I would have assumed that default params result in a 100% functional network.
context:
I am using checkmk (raw edition) container for monitoring my devices and I also want to monitor podman host machine to get stats about its load and memory usage. To get monitoring working the container needs to connect to port 6556 of monitored hosts where an agent listens and delivers stats. This will not work by default bridge network since communication with host (other than ping) is not available by design. So I tried pasta network mode and got communcation working between container and host. To access checkmk's web interface I use traefik with container labels. This works well with bridge network. Unfortunately the pasta mode only sets up a partial working network. At least it looks to me like that but I am not a networking expert. After switchting to pasta network traefik repeatedly reports the following
Unable to find the IP address. container=check-mk-raw-monitoring-d9a70509bebf61c99af2ceeda4b871e9a5f72eb0e59629cf2d6d7a3f86ed11a9 providerName=docker serviceName=monitoringservice
.When using the default bridge network I can inspect the checkmk container and see its effective network settings resulting from bridge mode. These look like the following and as you can see
NetworkSettings.Networks
has an entry with sane values (ip address, gateway and so on).After switching to pasta settings (
--network=pasta:--map-gw,-T,6556
) a connection from the container to the hosts port by accessing it vialocalhost:6556
can be established. But it results in traefik not working with that container anymore (see message above). When I inspect the container set up with pasta network it looks like this:As you can see the whole
NetworkSettings.Networks
block is missing. I would assume that's the reason why traefik cannot pick up the container anymore to do its routing magic.So it seems like the default options for pasta aren't enough to create a functional network entry. I did try using
slirp4netns
but had very similar results.Steps to reproduce the issue
To reproduce the issue in a basic form you need an open port on your host, then you can do:
bridge
podman run --rm -it --network=bridge debian:bookworm bash
apt-get update && apt-get install -y telnet
telnet [ip of host] [your open port]
podman
by default, having ip address, gateway, etc. set up correctly).pasta
podman run --rm -it --network=pasta:--map-gw,-T,6556 debian:bookworm bash
apt-get update && apt-get install -y telnet
telnet 127.0.0.1 [your open port]
does work nowDescribe the results you received
The result in my traefik context is that the container using pasta network is skipped for traefik routing since traefik cannot get any ip for that container and therefore cannot route requests to that container anymore.
Describe the results you expected
I would have expected a fully funcitonal network with ip, gateway and so on based on sane default settings without me setting them all up-
podman info output
Podman in a container
No
Privileged Or Rootless
Rootless
Upstream Latest Release
Yes
Additional environment details
No response
Additional information
No response
Beta Was this translation helpful? Give feedback.
All reactions