Any idea of the right syntax ?
OpenBSD’s PF for Mac OS X is mostly outdated, broken, rotten.
You're trying syntax that is used in modern OpenBSD's PF version.
Meanwhile before they changed it in OpenBSD, set-tos
could be applied only in a scrub
-rule — OpenBSD 4.4 has it in its man pf.conf
, check it out.
Back to "OpenBSD’s PF for Mac OS X is mostly outdated, broken, rotten". Since OpenBSD 4.4 was the first version with support of scrub … set-tos
we can conclude that Apple ported PF's version < 4.4 (say, 4.3) that still's being shipped with pretty recent macOS releases. I have no idea whether they apply any bug fixes, but answer to your question would be "wrong OS for doing that with PF".