How to block VM accessing the internet when the host is not connected to VPN

When you configure VM' network adapter, you assign it either to physical network card on the host (Bridge mode), to a NAT, or nowhere.

When your host is connected over VPN, there is another network adapter (tunneling), which caries on the traffic over to the VPN server. If you assign your VMs to that adapter, they will have connection only if this adapter is connected.
 

Balazs227

Reputable
Feb 26, 2014
19
0
4,510


I am starting to get what you say, but I dont find the option in the VM adapter settings for the VPN adapter.
This is what I see:
_j_k_p__1__www.kepfeltoltes.hu_.jpg

_j_k_p_www.kepfeltoltes.hu_.jpg
 
My skills in reading Hungarian (or Finish, or Tagalog, can't decide) are close to zero, but I think you have to choose "Bridged" network connection. If you are connected to the VPN at that time, probably this network will be shown as well.

I am not using VMWare, and I am afraid I cannot be of much help here. My idea was more like "generic". It might turn you have to resort to some scripting / VMWare SDK to change network configurarion during VPN startup / shutdown.
 

Balazs227

Reputable
Feb 26, 2014
19
0
4,510


I think I have found what you are talking about. Only problem is that its not working. I will fool around with it for a while. Anyways thanks for the help!