Giter Site home page Giter Site logo

Comments (10)

hemith avatar hemith commented on September 27, 2024 7

It works.

After booting Mac.
Set off the firewall and
Set on the firewall using sockerfilterfw command.
then well-known ports are OK.
Is this MacOS problem ? :-(

$ sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off
Password:
Firewall is disabled. (State = 0)
$ sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on
Firewall is enabled. (State = 1)

from vpnkit.

MagnusS avatar MagnusS commented on September 27, 2024 1

I can also reproduce this on the latest beta with docker run -p 80:80 nginx. The port is open on the external interface locally, but it's not accessible remotely - even if the application layer firewall is set to allow signed applications to receive connections. I also tried to add Docker.app, vmnetd and com.docker.slirp manually, but that didn't work either. It may be possible to use pfctl to add a rule for the port manually as a temporary workaround.

from vpnkit.

the-destro avatar the-destro commented on September 27, 2024 1

Hi, any updates to this issue?

from vpnkit.

yuhr avatar yuhr commented on September 27, 2024 1

Still getting this 😭

from vpnkit.

djs55 avatar djs55 commented on September 27, 2024

I can reproduce this.

If I open a privileged port with sudo nc -l 80 then a dialog pops up asking me to allow or deny incoming connections for the process. Since we're binding ports in the privileged helper process which won't have access to the screen/user session perhaps this mechanism doesn't work.

I played with the /usr/libexec/ApplicationFirewall/socketfilterfw tool but I've not made it do anything sensible. Any ideas, @MagnusS ?

from vpnkit.

charlieanstey avatar charlieanstey commented on September 27, 2024

I too would like to know if there are any updates on this issue.

It seems to mean that Docker for Mac cannot provide network access to container services running on privileged ports without completely disabling MacOS's Application Firewall or overriding with pfctl.

Workarounds of using ports >1024, creating specific rules using pfctl or introducing some other firewall solution don't seem appropriate.

from vpnkit.

blueimp avatar blueimp commented on September 27, 2024

Encountered the same issue and was unsuccessful with adding Docker binaries to the OSX Firewall exceptions nor using pfctl to allow external clients to access privileged ports on Docker containers.

Does someone have a workaround that does not involve disabling the OSX Firewall completely?
e.g. was someone successful adding working rules with pfctl?

from vpnkit.

esterkin avatar esterkin commented on September 27, 2024

Any updates on this issue? With my Mac (High Sierra) firewall turned on, I am able to access containers exposing port 8080 (such as Jenkins) from other machines but not containers exposing port 80 (such as Nginx).

from vpnkit.

mstred avatar mstred commented on September 27, 2024

It works.

After booting Mac.
Set off the firewall and
Set on the firewall using sockerfilterfw command.
then well-known ports are OK.
Is this MacOS problem ? :-(

$ sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off
Password:
Firewall is disabled. (State = 0)
$ sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on
Firewall is enabled. (State = 1)

TY very much, @hemith! As weird as it seems to be, this workaround solved the problem!
However, I just don't understand why it doesn't get reproduced if using any other "safe" ports (such as 8080 and 8443).

from vpnkit.

blueimp avatar blueimp commented on September 27, 2024

@hemith, @mstred, @yuhr and others using the socketfilterfw commands as a workaround:
Please make sure your Firewall is still enabled after you run those commands.
In my tests, the solution only worked because the Firewall was in fact still disabled, despite the misleading "Firewall is enabled" message.

The workaround that I've settled on is using pfctl as @MagnusS and @charlieanstey have mentioned, as it's using a MacOS built-in tool, does not require running any other services and does not interfere with the Application firewall.

For those that are interested:
I've created a little port forwarding helper script, that should make usage a little easier. There's also a FAQ entry that explains the script's usage.

from vpnkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.