I have a host with Mac OS and another machine (
192.168.100.50) in the same LAN.
I would like to configure Mac OS in that way if I access
localhost:443 it will redirect to
I'm able to redirect ports inside Mac OS, so if I access
localhost:444 it redirects to
localhost:443 this way:
sudo sysctl net.inet.ip.forwarding=1
rdr pass on lo0 inet proto tcp from any to 127.0.0.1 port 443 -> 127.0.0.1 port 444
scrub-anchor "com.apple/*" nat-anchor "com.apple/*" rdr-anchor "com.apple/*" rdr-anchor "dev" dummynet-anchor "com.apple/*" anchor "com.apple/*" load anchor "com.apple" from "/etc/pf.anchors/com.apple" load anchor "dev" from "/etc/pf.anchors/dev"
sudo pfctl -ef /etc/pf.conf
But if I change
from any to 127.0.0.1 port 443 -> 127.0.0.1 port 444 to
from any to 127.0.0.1 port 443 -> 192.168.100.50 port 443 it doesn't work.
I guess I should set up NAT somehow, but I'm not sure how to do that with PF to achieve that. So any help will be very appreciated.