Tag: Virtual Switch

Last updated by at .

Hyper-V NAT Switch

Set up a Hyper-V Virtual Switch using a NAT Network

A couple of months ago I wrote a blog post about how you can create a new Hyper-V NAT Switch. Now this worked fine in some early Windows 10 builds, but Microsoft removed the parameter for the NAT Switch in some Windows 10 Insider builds. Today Sarah Cooley PM at the Microsoft Hyper-V team, documented how you can do this using newer Windows 10 builds.

Requirements:

  • Windows 10 and Windows Server 2016 build 14295 or later
  • Enabled Hyper-V role
  • PowerShell, since this setting is not available in the UI right now

Hyper-V NAT Switch

Create a new Hyper-V Virtual Switch

Configure the NAT Gateway IP Address

This configures the Virtual Network Adapter which was created while creating the Internal Virtual Hyper-V Switch.

Now you can configure the NAT rule

After that you have finally created your NAT network and you can now use that network to connect your virtual machines and use IP Address from 172.21.21.2-172.21.21.254.

Hyper-V Virtual Switch NAT Configuration

Create a new NAT forwarding

To forward specific ports from the Host to the guest VMs you can use the following commands.

This example creates a mapping between port 80 of the host to port 80 of a Virtual Machine with an IP address of 172.21.21.2.

This example creates a mapping between port 82 of the Virtual Machine host to port 80 of a Virtual Machine with an IP address of 172.21.21.3.

This also works with Windows and Hyper-V Containers.

 

 

 



Create NAT Virtual Switch on Hyper-V

Hyper-V Virtual Switch using NAT Configuration

Update:

This blog post is blog post is for older Windows 10 builds, for newer Windows 10 (1607) and Windows Server 2016 builds please follow this blog post:

Set up a Hyper-V Virtual Switch using a NAT Network

In the latest Windows 10 build 10586 (Threshold 2) and Windows Server 2016 Technical Preview 4, Microsoft included a great new feature which is NAT mode for the Hyper-V Virtual Switch. This was mostly build for Windows Containers scenarios, but also has great value for Client Hyper-V. As of today Hyper-V had 3 different VMSwitch types called, Internal, Private and External. With the latest releases of the Windows 10 and Windows Server 2016 Technical Preview 4, Microsoft included a new VM Switch Type called NAT, which allows Virtual Machines to have a Internal Network and connect to the external world and internet using NAT. This feature right now is not included in the UI but you can use PowerShell to create the NAT Virtual Switch.

Create a new Virtual Switch using NAT:

Create NAT Virtual Switch on Hyper-V

Setup the NAT configuration:

This will create a new VM Network Adapter on the host using the 172.29.92.1 IP Address. You can now use the NATSwitch to connect Virtual Machines. You can now set IP Addresses inside Virtual Machines to the 172.29.92.0/24 subnet and add 172.29.92.1 as the default gateway and you are good to go.

Hyper-V Virtual Switch NAT Configuration

Create a new NAT forwarding

To forward specific ports from the Host to the guest VMs you can use the following commands.

This example creates a mapping between port 80 of the host to port 80 of a Virtual Machine with an IP address of 172.29.91.2.

This example creates a mapping between port 82 of the Virtual Machine host to port 80 of a Virtual Machine with an IP address of 172.29.91.3.

This also works with Windows and Hyper-V Containers.

Update – 4/27/2016 #1

As many of the people mentioned, the option of the SwitchType NAT is gone in the latest Windows Insider Preview builds of Windows 10. If you have created a NAT Switch in Windows 10 before the upgrade to a Windows 10 insider build, the switch is still working. There is no comment at the moment from Microsoft on this. But Microsoft announced Hyper-V Container support for Windows 10, and since the NAT Switch makes totally sense when you are using containers, I guess the SwitchType for NAT will be coming back.

Update – 4/27/2016 #2

With the latest Windows 10 Insider Build 14332, I saw some Container Network PowerShell cmdlets, which maybe will replace the Hyper-V Switch NAT cmdlet options for the future. But this is just guessing.

Container Network PowerShell

Update – 5/3/2016

Here is a updated version how you can configure the Hyper-V NAT Switch in newer Windows 10 and Windows Server 2016 builds.

Have fun and enjoy! Thanks to Ben Armstrong (Microsoft VirtualPCGuy) for the info.



Cisco Nexus 1000v for Hyper-V now available for download

Cisco Nexus 1000v

Just got the information that Cisco made the Nexus 1000v for Hyper-V available for download.

What is the Cisco Nexus 1000v

Cisco Nexus 1000V Series Switches provide a comprehensive and extensible architectural platform for virtual machine (VM) and cloud networking. The switches are designed to accelerate server virtualization and multitenant cloud deployments in a secure and operationally transparent manner. Integrated into the Windows Server 2012 Extensible Switch, and fully compatible with System Center Virtual Machine Manager 2012 SP1, the Cisco Nexus 1000V Series provides:

  • Advanced virtual machine networking based on Cisco NX-OS operating system and IEEE 802.1Q switching technology
  • Cisco vPath technology for efficient and optimized integration of virtual network services
  • Tight integration with System Center Virtual Machine Manager 2012 SP1
  • Layer 2 Switching with Transmit side Rate Limiting
  • Security Policy Mobility, inbuilt support for Private VLANs with local PVLAN Enforcement
  • Provisioning Port Profiles with deep Integration with SCVMM
  • Traffic Visibility, including VM Migration Tracking, NetFlow v.9 with NDE, Cisco Discovery Protocol v.2
  • And more…

You can download the Nexus 1000v from the Cisco Website



Using System Center 2012 SP1 – Virtual Machine Manager Logical Switch with Hyper-V

System Center Logo

This blog post is a part of a series of blog posts about System Center 2012 Virtual Machine Manager, I am writing together with Michel Luescher (Consultant from Microsoft Switzerland).

In the last post we wrote about the new networking features in System Center 2012 SP1 – Virtual Machine Manager. One of the biggest changes in SCVMM is the concept of the Logical Switch. The new Logical Switch allows to manage Hyper-V Virtual Switches including the underlying network teaming centralized from System Center Virtual Machine Manager.

In Service Pack 1 you can choose between two Virtual Switches; You can use either the new Logical Switch or you can use the Standard Virtual Switch, which is basically the “legacy” Virtual Switch with the default Hyper-V Virtual Switch functions. If you create the Virtual Switch on a Hyper-V host you can choose between the two options and this allows you to choose the Logical Switch.

Standard Switch

The Standard Virtual Switch is basically the normal Hyper-V Virtual Switch and the configuration looks exactky the same as in the Hyper-V Manager. If you add a Hyper-V Host to SCVMM and you have previously created the Virtual Switch using Hyper-V Manager or PowerShell cmdlets, this Virtual Switch will be shown as Standard Switch.

Standard SwitchIn a nutshell:

  • The Standard Switch can only be deployed on one network adapter, so if you want to use network teaming you have to create the network teaming manual on the Hyper-V host.
  • The available Logical Networks have to be added on every host on the physical network adapter. This can be a little of a management effort but I made a simple PowerShell Script which helps you to do configuration changes: SCVMM 2012: Add Logical Network to all Hyper-V Hosts in HostGroup via PowerShell
  • Existing Virtual Switches will be shown as Standard Switches in SCVMM, you have to recreate the configuration if you want to use the Logical Switch.
  • With the Standard Switch you can set the one single management vNIC which can be used by the Management OS. You can attach additional vNIC using Windows PowerShell on the Hyper-V host but not from the Virtual Machine Manager Console

Logical Switch

A Logical Switch includes Virtual Switch Extensions, Uplink Port Profiles which define the physical network adapters used by the Hyper-V Virtual Switch for example for teaming and the Virtual Adapter Port Profiles mapped to Port Classifications which are the settings for the Virtual Network Adapters of the virtual machines.

Logical SwitchIn a nutshell:

  • The Logical Switch allows you to add multiple NICs in one Virtual Switch and creates a NIC teaming based on Uplink Port Profile. The Uplink Port Port Profile includes all the information which teaming mode and algorithm has to be used.
  • The Uplink Port Profile also includes a list of available logical network sites. If you have an additional Logical Network which runs on this network adapters you can simply add this to the Uplink Port Profile.
  • You can create multiple vNICs (vEthernet Adapters) for example a Hyper-V Converged Networking setup. Port Classifications and Virtual Adapter Port Profiles bring support for Bandwidth Management and QoS.
  • Logical Switches only work with windows Server 2012 , but there is no need to stay on Windows Server 2008 R2 Hyper-V.

If you are running Windows Server 2012 Hyper-V hosts there is no reason why you should not use the Logical Switch, which adds additional functionality and centralized management to the Hyper-V Virtual Switch.

You can find the German Version of this blog post on Michel Lueschers (Consultant Microsoft Switzerland) blog.



Basic Hyper-V Networking in System Center 2012 SP1 – Virtual Machine Manager

System Center Logo

This blog post is a part of a series of blog posts about System Center 2012 Virtual Machine Manager, I am writing together with Michel Luescher (Consultant from Microsoft Switzerland).

In January Microsoft released the Service Pack 1 for System Center 2012. This was more close to a full featured release rather than just a normal maintenance Service Pack with just small changes and bug fixes. The main purpose of System Center 2012 Service Pack 1 is to support Windows Server 2012. But in the special case of Virtual Machine Manager there are also a lot of new features and improvements. One of the biggest investments Microsoft made with SP1 was the Network Management.

Besides the integration of Network Virtualization which came with Windows Server 2012 Hyper-V a new concept call “Logical Switch” has been introduced. These Logical Switches allow you to configure the Virtual Switch and other network components of Hyper-V hosts directly and centralized from Virtual Machine Manager.

Network Definitions

Logical Networks – Logical Networks represents basically the network infrastructure you have already in your environment. For example this can be a subnet for a specific server or even a storage network. In System Center 2012 Virtual Machine Manager without Service Pack 1 you connected a virtual machine to a Logical Network to connect it to the specific subnet. In Service Pack 1 the concept has been extended with  VM Networks.

Virtual Machine Manager Logical Network Overview

Network sites – Network sites are added to an Logical Network to associate VLANs and subnets to host groups, which are representing the different locations. For example the “CorpNET” network on “Site A” has a different VLAN or subnet than “Site B” uses for the same network. When deploying a new virtual machine to the “CorpNET” network, Virtual Machine Manager automatically detects the right subnet and also adds (if required) the VLAN ID to the specific virtual machines network adapter.

Logical Network

IP Pools – IP Pools are just a pool of IP addresses which can be used to automatically let Virtual Machine Manager to assign static IP addresses from the selected subnet (example CorpNET) to a virtual machine or a physical Hyper-V host. An IP Pool includes also the information about Gateway or DNS Serves which are automatically used for the network adapter configuration.

IP Pool

VM Networks – VM Networks are defined by logical networks and virtual machines are now connected to VM Networks. This is done because of the new Network Virtualization feature in Windows Server 2012 Hyper-V. With this technology multiple VM networks can run on a single logical network.

SCVMM 2012 SP1 Networking 01

As already mentioned the Logical Network is mapped to a VM Network. This mapping is done because with the new Hyper-V Network Virtualization feature you can run multiple VM Networks on a single Logical network.

SCVMM 2012 SP1 Networking

Extended Virtual Switch

Logical Switch – The new Logical Switch is the main part of the new concept Microsoft introduced in System Center 2012 SP1 Virtual Machine Manager. A Logical Switch combines the different configuration objects used to create a new Hyper-V Virtual Switch in your environment, as for example Virtual Switch Extensions, Uplink Port Profiles and Virtual Adapter Port Profiles mapped to Port Classifications.

Native Virtual Adapter Port Profile – The Virtual Adapter Port Profiles define Virtual network adapter definitions like QoS settings, security settings like router or DHCP guard and performance settings like SR-IOV, IPsec task offloading or Virtual Machine Queue (VMQ). The Virtual Adapter Port Profile settings are not just for Virtual Machines they are also used for Virtual Network Adapters (vNIC) attached to the Hyper-V Management OS in a Converged Network setup.

Native Uplink Port Profile – The Uplink Port Profile sets the definition for the physical adapter like which logical networks are available on these physical adapters, the configuration of the LBFO and if Network Virtualization is being used.

Port Classifications – Port Classifications are mapping with Virtual Adapter Port Profiles based on the logical switch the virtual machine runs on. If a Virtual Machine is moved to a Hyper-V hosts with a different logical switch, the port classification links in the background which Virtual Adapter Port Profile has to be used

Port Classification

How this works together

The Logical Switch defines a Virtual Switch with Extensions

SCVMM 2012 SP1 Logical Switch

The Logical Switch has Native Uplink Port Profiles which add information about the Teaming Configuration, which Logical Networks and Network Sites are available on the physical network adapters and if Network Virtualization is allowed.

SCVMM 2012 SP1 Logical Switch2

The Logical Switch has also a Native Virtual Adapter Port Profiles which matches with a Port Classification on the Logical Switch and defines the Virtual Network Adapter settings for Virtual Machines or in a Converged Environment for the Hyper-V Management OS.

SCVMM 2012 SP1 Logical Switch3

I hope this post gives you some basic understanding about the new networking features which are added in Service Pack 1 for System Center 2012 Virtual Machine Manager.

You can find the German Version of this blog post on Michel Lueschers (Consultant Microsoft Switzerland) blog.