Give both VMs a network adapter on the same network. On Windows, set the Linux VM as default gateway. On Linux run the following commands (assumes eth1 incoming, eth0 outgoing):
1
sudo sysctl net.ipv4.ip_forward=1
2
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
3
sudo iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
4
sudo iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT