The MED-V Blog

The Microsoft Enterprise Desktop Virtualization blog.

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

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

  • Comments 2
  • Likes

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:

http://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_()

Comments
  • Just FYI although anyone reading this article should be able to figure it out there is an error in the .REG file above for selecting NAT mode, the value in the .REG file is BRIDGED (just like for BRIDGED mode) when it should be setting a value of NAT.

    FIrst bullet section should be as follows...

    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"

  • Thanks, it has been corrected.

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment