podman cannot access the container using the windows LAN ipv4 address

236 views Asked by At

When the container is started, you can access it using 127.0.0.1:port, but you cannot access it using a native IPV4 address.

Moreover, ipconfig /all does not display the interface information of podman, but you can run podman machine ssh to enter the podman container and use ifconfig to see the interface information of podman. You can also access the container using the ip address of en0.

Windows firewall is off

The container uses the podman network configuration

 {
      "name": "podman_net",
      "id": "12123434556677788",
      "driver": "bridge",
      "network_interface": "podman1",
      "created": "2024-02-02T09:56:26.625364378+08:00",
      "subnets": [
           {
                "subnet": "10.89.0.0/24",
                "gateway": "10.89.0.1"
           }
      ],
      "ipv6_enabled": false,
      "internal": false,
      "dns_enabled": true,
      "ipam_options": {
           "driver": "host-local"
      }
}

Version detail info:

  • Windows 10
  • Podman 4.8.2

How do I access podman's container using local IPV4 and modify network config?

1

There are 1 answers

0
zdk-stu On

windows 10 problem solution:Configure the mapping between the IP address and port of the WSL

netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport={host_port}connectaddress={your_podman_ip} connectport={wsl_port}