How to do IP masquerading on MacOS (10.14+)? I am looking for the equivalent Macos command to the linux:

sudo iptables -t nat -A POSTROUTING -o en0 -j MASQUERADE


I notice there are some very very old solutions using the ancient ipfw firewall, but pfctl has taken over and it has a completely different command system!
I believe under pf you are required to edit the pf.conf file for NAT. The OpenBSD PF page has some more information on the syntax.

Murus is a frontend for pf configuration if you're happy using a GUI rather than CLI.

The linux/unix or networking stack exchange sites might be helpful places to ask about pf if the OpenBSD page doesn't cover your question.