After installation done, we need to configure pf to enable NAT on vm1 local networking. VMM local networking will create interface with IP pattern 10.64.[vm id].3 on guest OS first interface. Edit the /etc/pf.conf and add below line :
dns_server = 8.8.8.8
match out on egress from 100.64.0.0/10 to any nat-to (egress)
pass in proto { udp tcp } from 100.64.0.0/10 to any port domain \
rdr-to $dns_server port domain
Here we used google dns server (8.8.8.8). Dont forget to reload pf rules using “pfctl -f /etc/pf.conf” and enable ip forwarding using “sysctl net.inet.ip.forwarding=1”. Execute the commands as root. If its working the our vm1 will be able to access internet.