I am trying to make a NAT interface to connect tap0 to the internet for QEMU. So far I've made a bridge and connected tap0 to it:
sudo ifconfig bridge1 create sudo ifconfig bridge1 addm tap0 sudo Ifconfig bridge1 up Now I'm trying to NAT bridge1 to the internet (I think en0) using PF.
I have added an anchor to my pf.conf file:
nat-anchor "com.apple/*" rdr-anchor "com.apple/*" dummynet-anchor "com.apple/*" anchor "com.apple/*" load anchor "com.apple" from "/etc/pf.anchors/com.apple" anchor PF_NAT_Anchor My anchor file:
pass out on en0 inet from bridge1 to any nat-to (en0) However, each time I try to load the file I get a Syntax error:
pfctl: Use of -f option, could result in flushing of rules present in the main ruleset added by the system at startup. See /etc/pf.conf for further details. No ALTQ support in kernel ALTQ related functions disabled PATH_TO_FILE/PF_NAT_Anchor:1: syntax error pfctl: Syntax error in config file: pf rules not loaded I've looked over the Anchor file but cannot find the error. All my scripts are slightly modified versions from https://www.openbsd.org/faq/pf/nat.html#status and https://srobb.net/pf.html Please help and thank you for reading this.