this post was submitted on 04 Nov 2024
7 points (100.0% liked)

Container platforms (docker, lxc, podman)

314 readers
1 users here now

A place to discuss everything related to Container platforms and runtimes. Docker, LXC, Podman, OpenShift, OCI, and more.

founded 1 year ago
MODERATORS
 

I’m running a rootless podman container listening on port 8080 on OpenSUSE Tumbleweed.

From the same host, there's no problem accessing the container. Trying to access the container remotely fails due to firewalld blocking the connection.

What I don't understand is this:

If I configure firewalld to forward port 80 to the container on port 8080 using

firewall-cmd --add-forward-port=port=80:proto=tcp:toport=8080

I can access the container from a remote computer using port 80.

However, if I try:

firewall-cmd --add-forward-port=port=8080:proto=tcp:toport=8080

I'm not able to reach the container. It seems that every port I try will work except for port 8080 in this case, and I can't find any references explaining why this might be the case.

What's going on here? Is it a conflict by trying to forward a port to itself? Is there any way to allow port 8080? Trying to allow port 8080 in the public zone fails as well.

you are viewing a single comment's thread
view the rest of the comments
[–] Deebster 2 points 2 weeks ago

If it's losing the settings when you reboot, you can do firewall-cmd --runtime-to-permanent which does what the name suggests. Alternatively, you can use the --permanent flag when adding new services.