Problem
I use the server of Alibaba Cloud. The public IP address of the server of Alibaba Cloud accesses the host computer through NAT.
The podman container cannot be accessed using the public ip address, but can access using the host’s local ip address.
I created a container using podman and the root account through by using the following command.
podman run -dit
--network bridge
-v $PWD/ql/data:/ql/data
-p 5700:5700
-e QlBaseUrl="/"
-e QlPort="5700"
--name qinglong
--hostname qinglong
docker.io/whyour/qinglong:latest
I can successfully access the container using curl http://127.0.0.1:5700
or curl http://172.16.0.55:5700
, but while I use curl http://<public-ip>:5700
, It’s not responding.
Useful information
centos 7.6 uanme
Linux Student.Wan 3.10.0-1160.114.2.el7.x86_64 #1 SMP Wed Mar 20 15:54:52 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
podman version
Version: 1.6.4
RemoteAPI Version: 1
Go Version: go1.12.12
OS/Arch: linux/amd64
ifconfig
br-3f6a398aaad1: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.22.0.1 netmask 255.255.0.0 broadcast 172.22.255.255
ether 02:42:5f:66:18:3d txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
br-9f71e38ca72e: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.18.0.1 netmask 255.255.0.0 broadcast 172.18.255.255
ether 02:42:45:88:7b:66 txqueuelen 0 (Ethernet)
RX packets 194615 bytes 253931483 (242.1 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 190963 bytes 23646183 (22.5 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
cni-podman0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.88.0.1 netmask 255.255.0.0 broadcast 10.88.255.255
ether 66:a0:b5:e4:8d:2a txqueuelen 1000 (Ethernet)
RX packets 42879 bytes 11958176 (11.4 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 42631 bytes 75566044 (72.0 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
docker0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
ether 02:42:c7:52:aa:30 txqueuelen 0 (Ethernet)
RX packets 657601 bytes 408324390 (389.4 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 656317 bytes 1001515284 (955.1 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.16.0.55 netmask 255.255.255.0 broadcast 172.16.0.255
ether 00:16:3e:16:fe:1c txqueuelen 1000 (Ethernet)
RX packets 6892683 bytes 3966380315 (3.6 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4563976 bytes 1788715990 (1.6 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
loop txqueuelen 1000 (Local Loopback)
RX packets 519638 bytes 877405200 (836.7 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 519638 bytes 877405200 (836.7 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
veth16de1eb: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 4e:18:bc:85:a5:82 txqueuelen 0 (Ethernet)
RX packets 194615 bytes 253931483 (242.1 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 190963 bytes 23646183 (22.5 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
veth565a332: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 2e:3a:68:39:e7:83 txqueuelen 0 (Ethernet)
RX packets 1455 bytes 121494 (118.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 3269 bytes 789488 (770.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
veth5cb66e9: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 56:3a:fd:23:be:42 txqueuelen 0 (Ethernet)
RX packets 6981 bytes 15787184 (15.0 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4176 bytes 837840 (818.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
veth6b064d0a: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 36:ed:34:c0:aa:49 txqueuelen 0 (Ethernet)
RX packets 36387 bytes 11949215 (11.3 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 36011 bytes 63305450 (60.3 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
veth7f1076f: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether da:d8:aa:62:43:bf txqueuelen 0 (Ethernet)
RX packets 1872 bytes 16172734 (15.4 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1845 bytes 304479 (297.3 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
veth8e95d8c: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 16:a5:e1:0d:b6:85 txqueuelen 0 (Ethernet)
RX packets 2302 bytes 7027589 (6.7 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 3385 bytes 859469 (839.3 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
veth94572c3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 26:61:06:17:19:a8 txqueuelen 0 (Ethernet)
RX packets 2042 bytes 5523198 (5.2 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1588 bytes 301502 (294.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
veth9840e07: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether aa:97:ac:5b:ed:72 txqueuelen 0 (Ethernet)
RX packets 4371 bytes 9204746 (8.7 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2532 bytes 415220 (405.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
vethb705aa5: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether ee:4d:c3:44:09:d9 txqueuelen 0 (Ethernet)
RX packets 99329 bytes 63969237 (61.0 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 100272 bytes 11031172 (10.5 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
vethb8e3499: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether da:0e:bb:a8:b0:ee txqueuelen 0 (Ethernet)
RX packets 1371 bytes 2186279 (2.0 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1710 bytes 165260 (161.3 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Expecting
I want to successfully access the container over the public ip address.
WanLu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.