Exposed port unavailable after a while
Hi! I'm very new to Apple, my first device is the Mac mini M1, I'm trying to expose some services (through Docker) but I currently have some problems.
I investigated a little more and I found that my problem is not related to docker, once I try to expose a port directly with:
⚡ nc -lk 0.0.0.0 8888
and I try to connect from another devices (192.***.0.167 is the IP of the Mac Mini) here is what's happening:
daniele@xxxxx /home/daniele
⚡ while true; do sleep 2; nc -zv 192.***.0.167 8888; done
^C
daniele@xxxxx /home/daniele
⚡ nc -zv 192.***.0.167 22
Connection to 192.***.0.167 22 port [tcp/ssh] succeeded!
daniele@xxxxx /home/daniele
⚡ while true; do sleep 2; nc -zv 192.***.0.167 8888; done
Connection to 192.***.0.167 8888 port [tcp/*] succeeded!
Connection to 192.***.0.167 8888 port [tcp/*] succeeded!
Connection to 192.***.0.167 8888 port [tcp/*] succeeded!
^C
[Personal Information Edited by Moderator]
In the first attempt I don't get any answer, so I interrupt after a while; then a connection on the SSH port (remote login is enabled) "unlocks" the other ports, and finally if I try to connect it magically works!
After a while the port becomes unavailable again and to access the service I must first connect to the SSH port.
Could you explain me what's happening?
Thank you
Mac mini, macOS 13.0