#!/bin/bash ifconfig lo0 alias 127.0.1.1 ifconfig lo0 alias 127.0.10.1 # clear rules pfctl -F all -f /etc/pf.conf # set rules echo " rdr pass inet proto tcp from any to 127.0.1.1 port 443 -> 127.0.1.1 port 1443 rdr pass inet proto tcp from any to 127.0.10.1 port 443 -> 127.0.10.1 port 10443 " | sudo pfctl -ef - # list rules # pfctl -s nat