Mac Os Monterey break Port Forwarding

Previously my port forwarding is working fine on Big Sur, but after upgrading to Monterey any incoming connection into my opened port is refused. I'm using port forwarding for android emulator debugging purposes.

Here's config that i'm doing on previously using Big Sur,

  1. on `/etc/hosts` file i'm adding line `127.0.0.1 my_big_sur_en0_ip_address`
  2. then create new file `/etc/pf.anchors/android.conf` with the following line:
rdr pass on en0 inet proto tcp from any to any port 5585 -> 127.0.0.1 port 5555

3 Then inside `/etc/pf.conf` put the following anchor lines:

...(another apple default setup)
rdr-anchor "forwarding"
load anchor "forwarding" from "/etc/pf.anchors/android.conf" 

4 Then start the forwarding by execute `sudo sysctl -w net.ip.forwarding=1 && sudo pfctl -ef /etc/pf.anchors/android.conf `


If i try to check for openned port (5555) in localhost by executing on terminal directly `nc -zv 127.0.0.1 5555` it shows localhost [127.0.0.1] 5555 (personal-agent) open but when i try to hit from another mac (since i'm using command from any to any port 5585 it should be work from any ip address) I try to execute: `nc -zvw1 mac_os_monterey_ip_address_mac 5585` connection refused appear.


Please sombody help

MacBook Air 13″, macOS 12.0

Posted on Nov 14, 2021 8:45 PM

Reply

Similar questions

1 reply

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Mac Os Monterey break Port Forwarding

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.