I have a rootless podman container bound to 127.0.0.1:10080
, and I would like to forward external traffic to port 80
to go to that container, which I have been unable to accomplish:
[me@certvault ~]$ curl -sS http://127.0.0.1:10080 >/dev/null
[me@certvault ~]$ curl -sS http://127.0.0.1:80 >/dev/null
curl: (7) Failed to connect to 127.0.0.1 port 80: Connection refused
[me@certvault ~]$ sudo firewall-cmd --list-forward-ports
[me@certvault ~]$ sudo firewall-cmd --add-forward-port=port=80:proto=tcp:toport=10080:toaddr=127.0.0.1
success
[me@certvault ~]$ sudo firewall-cmd --list-forward-ports
port=80:proto=tcp:toport=10080:toaddr=127.0.0.1
[me@certvault ~]$ curl -sS http://127.0.0.1:80 >/dev/null
curl: (7) Failed to connect to 127.0.0.1 port 80: Connection refused
[me@certvault ~]$ curl -sS http://127.0.0.1:10080 >/dev/null
As you can see, everything works fine other than the redirection of traffic to the container. If I remove the restriction of the container and the rule to 127.0.0.1
, everything works, so I would think the base setup and idea are solid. But I don't want to expose the containers custom port to the world just to redirect traffic to it, and it doesn't seem to make sense that that would be necessary. Once the outside world reaches port 80
, it should not need to even know about port 10080
.