Ramifications of Switching between NAT (Shared Networking) Mode and Bridged Mode with MED-V V2.

In a previous blog article, I wrote about the differences between NAT and Bridged Mode in MED-V v2. The differences between the two were discussed in detail. You can find the article here:

https://blogs.technet.com/b/medv/archive/2011/11/03/nat-mode-vs-bridged-mode-in-med-v-v2.aspx

Often I get the question, “What if I want to change the networking mode? Can I do this after the MED-V workspace has been deployed? Or will I have to re-deploy the workspace?”

Administrators can change the deployed mode after the workspace has been deployed. This can be helpful if, for some reason, the current mode will not suffice. If you choose to change the networking mode post-deployment, It is important to consider the following issues that will most likely occur.

1.)    Regardless of networking mode, there will always be 4 network interfaces in the guest operating system. This is by design. This is to allow for multiple adapters on the host to be allowed into the workspace with MED-V if the VPC is running in Bridged Mode (i.e. VPN, virtual, tunneling adapters from the host.)

2.)    Switching between NAT Mode and bridged mode while the workspace is running will cause a delay in network availability in the workspace guest operating system.

3.)    Switching to Bridged mode from NAT only recommended when using DHCP in bridged mode. While static IP addresses are supported in bridged mode, they are not in NAT mode.

In any scenario, there will likely be a temporary automatic IP address (169.254.x.x) when switching while the workspace is running. You may need to trigger an IPCONFIG /RELEASE and IPCONFIG /RENEW command to speed up the process.

You can also automate the network configuration switching using a variety of means:

 

Using a .REG file to switch to NAT Mode

Windows Registry Editor Version 5.00

; Registry file created using Microsoft MEDV Configuration commands

[HKEY_LOCAL_MACHINE\Software\Microsoft\Medv\v2\VM]

"NetworkingMode"="NAT"

 

Using a .REG file to switch to Bridged Mode

 Windows Registry Editor Version 5.00

; Registry file created using Microsoft MEDV Configuration commands

[HKEY_LOCAL_MACHINE\Software\Microsoft\Medv\v2\VM]

"NetworkingMode"="BRIDGED"

 

WMIC command to set the workspace to Bridged Mode

wmic /namespace:\\root\Microsoft\Medv PATH Setting set VmNetworkingMode=BRIDGED

 

WMIC command to set the workspace to NAT Mode

wmic /namespace:\\root\Microsoft\Medv PATH Setting set VmNetworkingMode=NAT

 

VBScript code to set the MED-V workspace to NAT Mode

Set objMedv = GetObject("winmgmts:root\Microsoft\Medv:Setting=@")

objMedv.VmNetworkingMode="NAT"

objMedv.Put_()

 

VBScript code to set the MED-V workspace to Bridged Mode

Set objMedv = GetObject("winmgmts:root\Microsoft\Medv:Setting=@")

objMedv.VmNetworkingMode="BRIDGED"

objMedv.Put_()