To provide internet access to an untrusted guest virtual machine without granting access to the local network, I would setup a second and trusted guest virtual machine running Linux and configure it as a router and traffic filter.
The original guest VM would have a single network adapter attached to an internal network. The router guest VM would have two network adapters, where the first one would be attached to the same internal network and the second one would be attached to the host network as usual, via bridge or NAT.
The router VM would run dnsmasq to provide network connectivity to the original guest VM. To ensure that packets from the untrusted machine will not reach the LAN interface independently of the network protocol, I would manipulate the routing policy database and create a dedicated routing table:
[root@trustedRouter]# echo 'nolan' >> /etc/iproute2/rt_tables
[root@trustedRouter]# ip rule add iif ${intIF} table nolan
[root@trustedRouter]# ip route show table main | grep -F " dev ${intiF} " | \
while read L; do ip route add table nolan ${L}; done
[root@trustedRouter]# ip route show table main | grep -E "^default " | \
while read L; do ip route add table nolan ${L}; done
${intIF}
on the above example would be the network card connected to the untrusted guest machine.
For peace of mind, network filtering via nftables
would also be in place:
[root@trustedRouter]# nft add chain inet filter FORWARD \
meta iifname ${intIF} ip daddr ${lanADDR4} counter DROP
[root@trustedRouter]# nft add chain inet filter FORWARD \
meta iifname ${intIF} ip6 daddr ${lanADDR6} counter DROP