# Explain networking known limitations, explain "host"

**URL:** <https://forums.docker.com/t/explain-networking-known-limitations-explain-host/15205>\
**Category:** Docker Desktop\
**Tags:** macos\
**Created:** [June 10, 2016, 5:50pm UTC](https://forums.docker.com/t/explain-networking-known-limitations-explain-host/15205 "2016-06-10T17:50:00Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![mitack](https://avatars.discourse-cdn.com/v4/letter/m/e8c25b/32.png) [@mitack](https://forums.docker.com/u/mitack)\
**Post date:** [June 10, 2016, 5:50pm UTC](https://forums.docker.com/t/explain-networking-known-limitations-explain-host/15205/1 "2016-06-10T17:50:00Z")

</div>

From [https://docs.docker.com/docker-for-mac/networking/](https://docs.docker.com/docker-for-mac/networking):

> Unfortunately, due to limtations in OSX, we’re unable to route traffic to containers, and from containers back to the host.

There have been numerous discussions in this forum related to this:  
[https://forums.docker.com/t/should-docker-run-net-host-work/14215/](https://forums.docker.com/t/should-docker-run-net-host-work/14215)  
[https://forums.docker.com/t/access-host-not-vm-from-inside-container/11747/](https://forums.docker.com/t/access-host-not-vm-from-inside-container/11747)  
[https://forums.docker.com/t/cannot-access-network-port-on-host-using-bridge-network/14631/](https://forums.docker.com/t/cannot-access-network-port-on-host-using-bridge-network/14631)

There are numerous references to “host” here: [https://docs.docker.com/engine/reference/run/](https://docs.docker.com/engine/reference/run/)  
Examples: --ipc=host, --uts=host, --net=host, --pid=host,

Also, to quote @davetucker here:  
[https://forums.docker.com/t/access-host-not-vm-from-inside-container/11747/13/](https://forums.docker.com/t/access-host-not-vm-from-inside-container/11747/13)

> We’ve gone a long way to try and achieve this and we want to make sure that the experience for Mac users is the same as the experience on Linux.

What I’m trying to figure out exactly are:

1. What is the “host” in Docker for Mac context-- the xhyve VM, or the actual OSX host? (It seems to refer to both, depending on the speaker.)
2. What networking features of docker will not work as expected for someone coming from native docker on Linux “due to limtations in OSX”? What features will never work and what features are in the beta/planning stages but not yet available?
3. Is a user of Docker for Mac supposed to have to plan around interacting with the xhyve VM in the same way that a Docker Toolbox user does? Or is it supposed to “feel” native, like docker on Linux?

---

<div class="post-metadata">

**Author:** ![mcgeeco](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/mcgeeco/32/9044_2.png) [@mcgeeco](https://forums.docker.com/u/mcgeeco)\
**Post date:** [June 21, 2016, 8:54am UTC](https://forums.docker.com/t/explain-networking-known-limitations-explain-host/15205/2 "2016-06-21T08:54:17Z")

</div>

It’s beginning to look like this is just being deliberately ignored. It keeps being brought up without any response from anyone on the Docker team. It’s getting really difficult to sell this to the rest of my dev team with this kind of uncertainty.

---

<div class="post-metadata">

**Author:** ![mitack](https://avatars.discourse-cdn.com/v4/letter/m/e8c25b/32.png) [@mitack](https://forums.docker.com/u/mitack)\
**Post date:** [June 21, 2016, 3:05pm UTC](https://forums.docker.com/t/explain-networking-known-limitations-explain-host/15205/3 "2016-06-21T15:05:44Z")

</div>

Agreed. As I posted in one of those threads, I’m giving up on using the beta & native app until this issue is addressed. If it’s never addressed, I’ll stick with Docker Toolbox + Virtualbox until I no longer have the need to reach the host from a container.

---

<div class="post-metadata">

**Author:** ![adamaig](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/adamaig/32/11998_2.png) [@adamaig](https://forums.docker.com/u/adamaig)\
**Post date:** [July 3, 2016, 4:16am UTC](https://forums.docker.com/t/explain-networking-known-limitations-explain-host/15205/4 "2016-07-03T04:16:00Z")

</div>

The docker for mac solution is currently unusable in my work context as well due to networking issues with unclear resolutions.

We have nearly a dozen web apps that we need to run together using consul + registrator with our various docker-compose applications to provide cross-app communication.

Specifically, we are using consul’s DNS to provide lookups between container applications running on common ports and need to reach each app by DNS name from the host. We’ve set this up with docker-toolbox by adding an /etc/resolver/docker file and supporting routes that point to the consul container, which then allows us to use cookies and sessions across the \*.docker hosts running locally.

But this solution doesn’t work for the native solution because the route to consul is unclear, and it looks like the communication is dropped.

---

<div class="post-metadata">

**Author:** ![thellier](https://avatars.discourse-cdn.com/v4/letter/t/b5e925/32.png) [@thellier](https://forums.docker.com/u/thellier)\
**Post date:** [July 14, 2016, 8:15pm UTC](https://forums.docker.com/t/explain-networking-known-limitations-explain-host/15205/5 "2016-07-14T20:15:38Z")

</div>

+1 for hoping for a fix

---

<div class="post-metadata">

**Author:** ![ktwalrus](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@ktwalrus](https://forums.docker.com/u/ktwalrus)\
**Post date:** [July 14, 2016, 8:32pm UTC](https://forums.docker.com/t/explain-networking-known-limitations-explain-host/15205/6 "2016-07-14T20:32:42Z")

</div>

I don’t think there will be a “fix” for this. Networking is all done within the VM and you can map ports on the Mac to the VM. That’s just the way Docker for Mac is designed.

You can run a swarm (or cluster of docker daemons) in the VM using “Docker in Docker” containers. Watch this [video](https://www.youtube.com/watch?v=tlEurzT-KDQ) for how to swarm (with multiple user-defined networks) in the Docker for Mac VM.

For any services you need access to outside the VM, you should use port mapping.

---

<div class="post-metadata">

**Author:** ![joshma](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/joshma/32/8714_2.png) [@joshma](https://forums.docker.com/u/joshma)\
**Post date:** [July 14, 2016, 10:23pm UTC](https://forums.docker.com/t/explain-networking-known-limitations-explain-host/15205/7 "2016-07-14T22:23:16Z")

</div>

@ktwalrus AFAIK you don’t need to port forward for standard Docker for Mac, so this seems like a broken abstraction. For example, if I run nginx with `-p 80:80`, it shows up on localhost:80 of my Mac without any port forwarding (as opposed to when we needed to do that with virtualbox). My impression was that there’s a networking layer that automatically forwards for you.

Put differently, how would you port forward on Docker for Mac?

---

<div class="post-metadata">

**Author:** ![ktwalrus](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@ktwalrus](https://forums.docker.com/u/ktwalrus)\
**Post date:** [July 14, 2016, 10:41pm UTC](https://forums.docker.com/t/explain-networking-known-limitations-explain-host/15205/8 "2016-07-14T22:41:33Z")

</div>

When I say “port forwarding”, I mean that port 80 on localhost is forwarded to port 80 in your container (for your `-p 80:80` example. Docker for Mac sets up a unix socket ( to connect the localhost:80 to container\_ip:80). See the `/port` directory in the VM:

```
/ # cd port
/port # ls
README tcp:0.0.0.0:9955:tcp:172.18.0.24:9955
tcp:0.0.0.0:1961:tcp:172.18.0.16:1961 tcp:0.0.0.0:9956:tcp:172.18.0.24:9956
tcp:0.0.0.0:2587:tcp:172.18.0.25:587 tcp:0.0.0.0:9957:tcp:172.18.0.24:9957
tcp:0.0.0.0:32768:tcp:172.18.0.4:1961 tcp:0.0.0.0:9958:tcp:172.18.0.24:9958
tcp:0.0.0.0:32769:tcp:172.18.0.5:1961 tcp:0.0.0.0:9959:tcp:172.18.0.24:9959
tcp:0.0.0.0:32770:tcp:172.18.0.6:1961 tcp:0.0.0.0:9960:tcp:172.18.0.24:9960
tcp:0.0.0.0:32771:tcp:172.18.0.7:1961 tcp:0.0.0.0:9961:tcp:172.18.0.24:9961
tcp:0.0.0.0:32772:tcp:172.18.0.8:1961 tcp:0.0.0.0:9962:tcp:172.18.0.24:9962
tcp:0.0.0.0:32773:tcp:172.18.0.9:1961 tcp:0.0.0.0:9963:tcp:172.18.0.24:9963
tcp:0.0.0.0:32774:tcp:172.18.0.10:1961 tcp:0.0.0.0:9964:tcp:172.18.0.24:9964
tcp:0.0.0.0:32775:tcp:172.18.0.11:1961 tcp:0.0.0.0:9965:tcp:172.18.0.24:9965
tcp:0.0.0.0:32776:tcp:172.18.0.12:1961 tcp:0.0.0.0:9966:tcp:172.18.0.24:9966
...

```

(I may not have the underlying mechanism that Docker uses to implement this since I know Docker uses `iptables` to forward traffic inside the VM to the correct network/port.)

---

<div class="post-metadata">

**Author:** ![joshma](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/joshma/32/8714_2.png) [@joshma](https://forums.docker.com/u/joshma)\
**Post date:** [July 15, 2016, 12:39am UTC](https://forums.docker.com/t/explain-networking-known-limitations-explain-host/15205/9 "2016-07-15T00:39:39Z")

</div>

Ahhh thanks @ktwalrus, this makes a lot more sense now. (For anyone else following along, `screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty` gets you into the xhyve vm)

Do you happen to have any pointers for how I would port forward to the VM?

---

<div class="post-metadata">

**Author:** ![aleksi](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/aleksi/32/7812_2.png) [@aleksi](https://forums.docker.com/u/aleksi)\
**Post date:** [July 28, 2016, 8:33pm UTC](https://forums.docker.com/t/explain-networking-known-limitations-explain-host/15205/10 "2016-07-28T20:33:05Z")

</div>

It looks like there is no way to connect to a service running on a host from inside the container?

---

<div class="post-metadata">

**Author:** ![jsniecikowski](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@jsniecikowski](https://forums.docker.com/u/jsniecikowski)\
**Post date:** [August 1, 2016, 9:19pm UTC](https://forums.docker.com/t/explain-networking-known-limitations-explain-host/15205/11 "2016-08-01T21:19:05Z")

</div>

This seems to create an issue with using Kafka when you don’t want to expose 9092 on Docker host machine. Haven’t found a workaround yet other than executing code using Kafka in another container…

---

<div class="post-metadata">

**Author:** ![marcellopato](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/marcellopato/32/41472_2.png) [@marcellopato](https://forums.docker.com/u/marcellopato)\
**Post date:** [July 6, 2023, 1:27pm UTC](https://forums.docker.com/t/explain-networking-known-limitations-explain-host/15205/13 "2023-07-06T13:27:53Z")

</div>

Indeed. This is a shame on you Docker guys! MacOS is the BEST OS to run development, this situation can’t continue.  
Please, help us with an official solution!

---

<div class="post-metadata">

**Author:** ![emfacx](https://avatars.discourse-cdn.com/v4/letter/e/ea666f/32.png) [@emfacx](https://forums.docker.com/u/emfacx)\
**Post date:** [July 20, 2023, 8:02pm UTC](https://forums.docker.com/t/explain-networking-known-limitations-explain-host/15205/14 "2023-07-20T20:02:19Z")

</div>

I’ve been trying to connect to a service on the host for days.

You just can’t do it on Docker Desktop for Mac?

I can ping `host.docker.internal` from inside a container which works fine, even shows up in the system console.

I can’t however do like `wget http://host.docker.internal:5000`. Are you guys saying this isn’t possible?
