
While this works, it’s quite a roundabout way to get packets from a container back to the host Information Unable to find any way to accomplish this with nat networking, short of running an ssh daemon inside a container which is inside the same docker network as the target, and from the host launching an ssh tunnel with a reverse port forward into that ssh container. There’s a few issues posted on this forum that are similar, but all the solutions are hacks and most revolve around using hostnet networking, where it’s apparent that Docker wants to focus on supporting nat networking (as it has recently become the default).Īn example use case is an application running inside a container which must connect out to a debugger, or, an nginx running as a container attempting to reverse_proxy to an application that is running on the host natively (like running your app inside an IDE, but need it to be proxied by nginx) Actual behavior To access the app on your Hosts browser edit the /etc/hosts file on the host as described above with port forwarding but this time associate the container IP with the app URL.Be able to access an ipv4 or ipv6 address, or some DNS/hostname from inside a container which can access the host (not the xhyve/hyper-v vm). Now you should be able to ping any container inside the VM directly from the host Run a quick ifconfig to check the interface bridge100 is on, for instance en4, and then run the command below. Xyhve creates a bridge100 interface automatically for VM networking. If your VM IP is 192.168.64.3 and container subnet is 10.0.3.0/24 you can create a route with a command like below Routing commands need to be run on the host. If you would prefer to use routing instead of port forwarding this is how it works. Routing will make the entire container subnet inside the VM available on the host. You can also use routing instead of portforwarding described above to access apps in containers. I found an article from other container product( not docker):, and i also haven’t even tested it if it does work indeed. The gui helps as an initial guidepost, and it’s better than the cmdline - but if it’s possible to do this, then the pf rules can simply be included with docker (or another addon) as a daemon to configure the pf I attempted to re-route traffic from that interface - but I’m pretty sure you’ll need to disable the murus preset rules and actually configure the network from scratch to get the topology to work for this case.

I’m NOT (typo) very knowledgable in this layer of abstraction - however, in the past during the early stages of beta development, I was able to see the networks created via docker, monitor the traffic, disable / enable filtering onto those ports, etc.

You are also able to forward services from your client to the Internet using Murus port forwarding. Using Murus you will be able to share your Internet connections with per-client and per-service rules, increasing security of both your Mac and your clients. But Murus offers an alternative way to do the same thing, with many more options. Normally you do it activating the “Internet Sharing” service in OS X System Preferences - Sharing panel. You can configure your Mac as a dual-homed router in order to share your Mac’s Internet connection and VPN connection with other computers, tablets, smartphone and such. It’s not a 1 - 1 map with OpenBSD’s pf - but it’s almost like iptables - maybe more powerful - I know it’s possible to create interesting networks within LAN I’ve found one gui that works and here’s documentation.

OpenBSD’s PF (firewall) exists natively in macOS, and has been since 10.7 - but I’m not sure what it’s being used for. If somebody reading this is a pfctl guru… maybe there’s a way.
