How to redirect a request to a docker machine on a local network in OSX

I am currently running a docker machine on a local network, where its IP and port is 192.168.99.100:8080 right now. I want to connect this machine from somewhere on the local network and access it, so in the best way I found that NAT sent the request from my laptop to the docker machine. In other words, every request sent to my laptop will be sent to the docker machine on its own IP port and port! I use pfctl for this, but when I check port 8585 to find out which service is listening on this port, I cannot find anything, and it looks like the requests are not coming (reaching) to the destination!

I have done the following:

1- csrutil disable

2- my role is pf: /etc/pf.anchors/mazafard:

rdr pass on en0 inet proto tcp from any to 192.168.20.203 port 8585 -> 192.168.99.100 port 8080

3- my pf conf / etc / pf -mazafard.conf

rdr-anchor "forwarding"
load anchor "forwarding" from "/etc/pf.anchors/mazafard"

and

sudo pfctl -vnf /etc/pf.anchors/mazafard


pfctl: Use of -f option, could result in flushing of rules
present in the main ruleset added by the system at startup.
See /etc/pf.conf for further details.

rdr pass on en0 inet proto tcp from any to 192.168.20.203 port = 8585 -> 192.168.99.100 port 8080

and

sudo pfctl -evf /etc/pf.anchors/mazafard


fctl: Use of -f option, could result in flushing of rules
present in the main ruleset added by the system at startup.
See /etc/pf.conf for further details.

No ALTQ support in kernel
ALTQ related functions disabled
rdr pass on en0 inet proto tcp from any to 192.168.20.203 port = 8585 -> 192.168.99.100 port 8080
pfctl: pf already enabled

and

telnet 192.168.20.203 8585

Trying 192.168.20.203...
telnet: connect to address 192.168.20.203: Operation timed out
telnet: Unable to connect to remote host

My OSX v: 10.11.4

Dock version 1.9.1, build a34a1d5

Boot2Docker version 1.11.0-rc3, build

+4
source share

All Articles