pf NAT to specified destinations only on Big Sur

In order to share a VPN connection, which is configured for specified websites only (while the other traffic goes as is), I created the following pf rule:

nat pass on vtap0 from bridge1:network to any -> (vtap0)

It works, but naturally all traffic now goes through VPN. I modified the rule to:

nat pass on vtap0 from bridge1:network to [allowed website IP XX.XX.XX.XX] -> (vtap0)

but no change - all traffic still seems to go through VPN. Here I stuck. So, how to create a NAT rule that is applicable to specified destination IPs only?

Thanks a lot.

Read more here:

Content Attribution

This content was originally published by Jack at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: