dimanche 27 novembre 2011

External, Internal, Private virtual networks in Hyper-V

Windows 2008 R2 is a great server OS with its powerful Hypervisor Hyper-V R2. Networking with Hyper-V is great, we are able to create Private, Internal and External virtual network.
This blog will explain the virtual networks type in Hyper-V, and how, in the future use, can i choose between them when setting up networking in Hyper-V
  •  Private Network
When creating Private virtual Network, you create a virtual network that only allows communication between virtual machines running in the host where this private virtual network is created. Host is unable to communicate with virtual machines.

This type of network is generally used in test environment where we want to isolate some virtual machines communications. Private virtual networks don’t allow scalability; VMs can only operate within the same host.
To create a private virtual network, Open the Hyper-V console, go to Virtual network manager


Then create (Add) a new Private virtual network

  •    Internal virtual network
This type of virtual networks is like the private virtual networks but besides allows communication with the Host. Host where virtual machines are running can communicate with its VMs via this type. Be aware that Internal virtual networks don’t allow communication with the external networks. Communication is limited to the Host.
To create a private virtual network, Open the Hyper-V console, go to Virtual network manager

Then create an internal virtual Network


Give a name to your Internal virtual network (My internal Virtual network)

The question is how can I use it for communication with my host.
The reponse is simple, when an internal virtual network is created, a virtual NIC is added in my Network and sharing Center. We can identify it by its name.



You can now open properties of My Internal Virtual network, give it an IP address. Now you can communicate with your VMs via this address.


  • External Virtual Network
This the last and most important virtual network type in Hyper-V. External virtual networks are used to connect your VMs with the external world using the physical Network cards of your host.
1.       How can I create an External Virtual network
Just like the other types of virtual network types, go to the Hyper-V console, Virtual Network Manager. Select to add an external virtual network
                  Name: give a Name to your External virtual network (External-Wire) 

Choose the physical NIC to bind it to your network (Broadcom NetXtreme Gigabit Ethernet)

You may ask the question, what is the “Allow management Operating System to share this network adapter

The response is: If you want to allow your host using this network check it. Your host will be able to have an IP address that allows it to communicate with the external world using this NIC and allows it to communicate with VMs connected to this external virtual network. When you check this option, an additional Icon is added in your Network and sharing Center. Now, in addition to your physical NIC icon, you will have a new NIC.


  The first here (Local Area connection, Broadcom NetXtreme Gigabit Ethernet) is your physical NIC, the second is your External Virtual NIC (External-Wire). If you want to configure an IP address to your Host, configure it in the Virtual External NIC, not the physical.

If you decide to not check the “Allow management Operating System to share this network adapter”, only the Physical NIC will reside.

2.       How this is functioning
Very simple: When you create an external virtual network, your physical NIC will act as a Switch (virtual Switch). Each VM connected to this external virtual network will send it’s traffic via this Switch.
If the host is allowed to use this external virtual network, a virtual NIC will be created and placed in the Network and sharing Center, and bound to this virtual switch, exactly like the VM (this explain the External wire created NIC)
You can be sure of this by opening the properties of your physical NIC.

You can notice the Microsoft Virtual Network Switch Protocol, the only enabled protocol

NB: Only wired physical NICs can be used in external virtual networks. Using Wireless NICs is unsupported by Hyper-V. You may notice that your wireless NICs doesn't appear when creating External virtual Network.
Fortunately, even if this is not supported by Hyper-V, i can show you a trick to use your Wireless NIC in External virtual network with Hyper-v. See my Next blog

Aucun commentaire:

Enregistrer un commentaire