Port based multitenancy in MacOS

How to setup Port based multitenancy in MacOS?