I am sure this question has been answered before, but I can't seem to find a workable answer.
I have a CentOS 7 virtual machine running inside VirtualBox 5.2.20 hosted on a Windows 10 Pro computer. I set up an Apache web server on the guest and would like to make it reachable over the internet (e.g. to serve a static webpage over port 80). However, I would like my host and other devices in my LAN to be shielded off from the guest in case it gets compromised.
At the moment, I have two network adapters configured in VB, one NAT to give outbound internet access to the guest and one host-only adapter to test the web server locally. No port forwarding is set up at the moment, so the guest is reachable only from my host. My understanding is the following:
- If I use NAT with port forwarding, I would have to open up the required port(s) on my host as well, making it vulnerable to potential exploits (I want to avoid that)
- If I use Bridged mode, I can forward ports directly to my guest, but then it would also have access to other hosts on my LAN. If my guest gets hacked, they would be at risk.
Is my understanding correct? If yes, how can I set up the network to enable port forwarding to my guest only, without exposing the rest of my LAN to it?