1

Is there a way to get connectivity to a network service that is accessible only via localhost from a LAN IP under Windows 11?

 

I'm trying to access a docker image hosted on Windows over LAN. So far I've only managed to get access via localhost:xxxx

--net=host : doen't seem to open a port on either localhost or the LAN IP, -p xxxx:xxxx: opens a port on localhost only

9
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Commented Aug 7, 2022 at 14:42
  • How are you using Docker? Are you specifying the port mapping correctly? No tricks are required for Docker, except of course setting up the firewall.
    – Daniel B
    Commented Aug 7, 2022 at 14:56
  • 1
    You cannot port forward to local host, because local host means, the local adapter on that interface. For windows 11, that means it is redirected to windows 11, and on docker it means, the traffic inside docker is redirected to itself. You will have to redirect to the LAN IP of the other instance. Always.
    – LPChip
    Commented Aug 7, 2022 at 14:58
  • @DanielB I've tried a couple of network configurations with docker: --net=host : doen't seem to open a port on either localhost or the LAN IP, and -p xxxx:xxxx: which opens a port on localhost only.
    – Scottmeup
    Commented Aug 7, 2022 at 18:33
  • @LPChip perhaps I'm not using the correct term. On macOS I've used software that acts as a proxy in a similar situation.
    – Scottmeup
    Commented Aug 7, 2022 at 18:44

1 Answer 1

2

To directly answer your question, No. Ports listening or otherwise established on the loopback interface cannot be accessed from another system. This is by design, and were it to not be the case, the security vulnerability that would result would be catastrophic.

Localhost only ports are commonly used for Inter-Process Communication and services that should only be accessible locally.

In order to make your port accessible to the LAN, you must reconfigure the service to listen on an interface with a valid LAN IP or 0.0.0.0. The specific methods to do this vary by product, so you will have to consult the documentation for your product.

It is possible to write some kind of Application Layer Gateway that you could deploy on the host bound to a LAN interface, and proxy communications to a localhost port, but this will require a knowledge of network programming and the command syntax used by the application, which are not commonly available to system administrators.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .