Using PacketFilter to transparently proxy packets in OS X [closed]

Why not try a Loopback Alias:

  1. Create a custom alias for the loopback interface
  2. Then, redirect the traffic to

This way even if pf rewrites the destination IP to, it would be different from This could perhaps make it possible for you to differentiate traffic between the IP Addresses.

ifconfig lo0 alias

Then for your pf rule, you could do something like this:

rdr pass proto tcp from any to any -> port 12300

If this doesn’t work, would it be possible to use a third-party package like redsocks? Keep in mind this won’t be a drop-in replacement for the exact ipfw functionality, however, with some configuration and potentially some scripting, perhaps this could be used to serve a similar purpose.

If your primary objective is to work with sshuttle specifically, I recommend looking into any updates or forks of the project that might have arisen to address macOS’s changes, as mentioned previously.

Leave a Comment