You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is easy to think that the container is hosted in a different device on the `local area network (LAN) <https://en.wikipedia.org/wiki/Local_area_network>`_.
73
+
74
+
.. mermaid::
75
+
:align: center
76
+
:alt: Diagram of access container from Windows or macOS over LAN.
77
+
:caption: Diagram of access container from Windows or macOS over LAN.
The container can expose some ports (for example, the port 80 to receive HTTP requests) and the exposed port can be mapped to a port in the host. This way, a request to the port in the host is passed to the container.
35
109
36
110
.. important::
@@ -39,13 +113,13 @@ The container can expose some ports (for example, the port 80 to receive HTTP re
WSL uses a `NAT (Network Address Translation) <https://learn.microsoft.com/en-us/windows/wsl/networking#default-networking-mode-nat>`_ based architecture for networking. This allows the use of the `loopback <https://en.wikipedia.org/wiki/Loopback>`_ address from Windows to access the machine running Podman, for example
180
+
181
+
.. code:: powershell
182
+
183
+
curl.exe http://localhost:8080
184
+
185
+
or
186
+
187
+
.. code:: powershell
188
+
189
+
curl.exe http://127.0.0.1:8080
190
+
191
+
or
192
+
193
+
.. code:: powershell
194
+
195
+
curl.exe http://[::1]:8080
196
+
197
+
.. warning::
198
+
199
+
``curl.exe http://127.0.0.1:8080`` should work but it fails when tested.
200
+
201
+
It is also possible to use the IP address in the local area network (LAN) of the machine running Podman. First, discover the IP address.
202
+
203
+
.. code:: powershell
204
+
205
+
wsl.exe hostname -I
206
+
207
+
::
208
+
209
+
172.25.11.50
210
+
211
+
.. important::
212
+
213
+
The IP address might change when the WSL machine restarts.
214
+
215
+
.. note::
216
+
217
+
The IP address can be used in ``C:\Windows\System32\drivers\etc\hosts``.
218
+
219
+
And use the IP address
220
+
221
+
.. code:: powershell
222
+
223
+
curl.exe http://172.25.11.50:8080
224
+
225
+
Windows 11
226
+
^^^^^^^^^^
227
+
228
+
.. important::
229
+
230
+
The new `Mirrored mode networking <https://learn.microsoft.com/en-us/windows/wsl/networking#mirrored-mode-networking>`_ is available on Windows 11 22H2 and higher.
0 commit comments