-
Notifications
You must be signed in to change notification settings - Fork 2.6k
network - error when mixing bridge networks with slirp4netns options #13109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
My goal is to create (at least) two isolated networks for reverse proxying and have two exposed ports with correct IPs. I tried different options, but I will need to set the IP-Address static for at least one of the isolated networks, so the bridge driver is a requirement. |
This won't work at present, due to the way our parsing of the As a workaround, in the meantime I suggest you retain |
This cannot work! You cannot use both slirp4netns and networks. First the Second, you cannot set slirp4netns option because slirp4netns is not used per container when you use rootless networks. We only spawn one slirp4netns process for the rootless network namespace. Rootless containers which use networks will always use the rootlesskit port handler since the slirp4netns one does not work for this at the moment. |
I will close the issue since this is not a bug or something we can fix with the way it is designed but feel free to continue the conversation. |
This doesn't work. $ podman run --name=reverse-proxy -d --net slirp4netns:port_handler=slirp4netns -p 8080:80 -p 8443:443 docker.io/library/nginx:1-alpine
12d40fe65da76e36971e8417725513af4f8108fac2fefe4439ca8eaa094fa5f8
$ podman network connect --ip 10.89.0.2 nextcloud-pub reverse-proxy
Error: "slirp4netns" is not supported: invalid network mode Maybe reopen this issue? @mheon
Ok - thanks for the explanation.
Totally my mistake - sorry. I also haven't worked with namespaces and pods yet - I am at the beginning of understanding podman without helping tools. |
You cannot use slirp4netns port_handler with the networks at the moment, see #8193 |
I am facing the same problem, with a similar use case:
I would like to have my reverse proxy to see the IP that originated the request, however, I see the internal IP of the container. Is there any workaround for that? Apparently using @Loader009 have you found a working solution for that case? |
I'm using a bare-installed nginx as the first reverse proxy (which I actually could put in a container) and another reverse proxy for all container, everything with default network driver. The second reverse proxy allows me to use the headers from the first reverse proxy and "correct" the IP. For those I try to directly open a port - but since I stopped using synapse (it definitely needs a SSD for the database, with about 80GB of new data per day), I kinda don't need to resolve other issues. Beside that I also have conntrack issues with podman, but that's a completely different issue. |
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
-- 2 internal networks (driver: bridge)
-- slirp4netns:port_handler=rootlesskit
Results in error (different errors, depending on the order of the parameters)
Steps to reproduce the issue:
podman network create --internal nextcloud-pub
podman network create --internal synapse-pub
podman run --name=reverse-proxy -d --net bridge:alias=nextcloud-pub --net bridge:alias=synapse-pub --net slirp4netns:port_handler=rootlesskit -p 8080:80 -p 8443:443 docker.io/library/nginx:1-alpine
OR
podman run --name=reverse-proxy -d --net slirp4netns:port_handler=rootlesskit --net bridge:nextcloud-pub --net bridge:synapse-pub -p 8080:80 -p 8443:443 docker.io/library/nginx:1-alpine
Describe the results you received:
Error: can only set extra network names, selected mode bridge conflicts with bridge: invalid argument
Error: cannot set multiple networks without bridge network mode, selected mode slirp4netns: invalid argument
Describe the results you expected:
container with two networks and 2 exposed ports with rootlesskit as a port_handler
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.):
physical
The text was updated successfully, but these errors were encountered: