Last updated by at .

  • What's new in Hyper-V 2016
  • Microsoft Azure

Tag: Windows

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.

[PowerShell]

Add-NetNatStaticMapping -NatName “VMSwitchNat” -Protocol TCP -ExternalIPAddress 0.0.0.0 -InternalIPAddress 172.21.21.2 -InternalPort 80 -ExternalPort 80

[PowerShell]

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.

[PowerShell]

Add-NetNatStaticMapping -NatName “VMSwitchNat” -Protocol TCP -ExternalIPAddress 0.0.0.0 -InternalIPAddress 172.16.0.3 -InternalPort 80 -ExternalPort 82

[PowerShell]

This also works with Windows and Hyper-V Containers.

 

 

 



Microsoft Network 5 Conference

Speaking at Microsoft NetWork 6 in Neum, Bosnia Herzegovina

Today I am proud to announce that I will speak at the Microsoft NetWork 6 conference in Bosnia. The Microsoft NetWork 6 conference will take place from April 18-20 in Neum, Bosnia. I will present two sessions:

Nano Server and Containers better together!

Have a look at the latest Cloud Technologies from Microsoft. Learn about the next Microsoft Cloud Platform Server called Nano Server and Windows Containers. Both solutions are built for the future and will fundamentally change how we do IT. Learn why we need Nano Server and Windows Containers and how we deploy, manage and operate them.

What’s new in Windows Server 2016 Hyper-V

With the next version of Microsoft hypervisor Microsoft released some great new features for your Cloud infrastructure. Come to this session to get the details of all the new stuff that is in Hyper-V and learn about how you can play with it “hands-on.” This session includes also the latest updates from the Technical Previews.

Check out the event page for more information:

Microsoft NetWork 6

Microsoft NetWork 6 Neum, Bosnia 18-20 April



Cloud ând Datacenter Conference Germany

Speaking at Cloud & Datacenter Conference Germany 2016

I am happy to announce that I am one of the speakers at the Cloud & Datacenter Conference Germany 2016. The Cloud & Datacenter Conference Germany will be held in Düsseldorf Germany 12.05.2016. The CDC Germany will be focusing on Microsoft Technology and will have 5 tracks full of great Microsoft Cloud and Datacenter content with speakers from all over the world.

In my session I will cover the latest about Windows Server and Hyper-V Containers, how they work, how you can manage them and much more…

Cloud & Datacenter Conference Germany

Get more information about the Cloud & Datacenter Conference Germany.

Speakers



PowerShell New-Guid

Create GUID using PowerShell

PowerShell version 5 brings a lot of new cmdlets which make our lives easier and our code cleaner. One of them is the New-GUID cmdlet. Before we had this cmdlet we had to use the .NET command to create a new GUID:

Now with PowerShell 5 we can use simply the new cmdlet:



Get-NetIPConfiguration

Basic Networking PowerShell cmdlets cheatsheet to replace netsh, ipconfig, nslookup and more

Around 4 years ago I wrote a blog post about how to Replace netsh with Windows PowerShell which includes basic powershell networking cmdlets. After working with Microsoft Azure, Nano Server and Containers, Powershell together with networking becomes more and more important. I created this little cheat sheet so it becomes easy for people to get started.

Basic Networking Information with PowerShell

Get-NetIPConfiguration

Get the IP Configuration (ipconfig with PowerShell)

List all Network Adapters

Get a spesific network adapter by name

Get more information VLAN ID, Speed, Connection status

Get driver information

Get adapter hardware information. This can be really usefull when you need to know the PCI slot of the NIC.

Disable and Enable a Network Adapter

Rename a Network Adapter

IP Configuration using PowerShell

Get-NetIPAddress

Get IP and DNS address information

Get IP address only

Get DNS Server Address information

Set IP Address

or if you want to change a existing IP Address

Remove IP Address

Set DNS Server

Set interface to DHCP

Ping with PowerShell

Test-NetConnection Ping

How to Ping with PowerShell

Get some more details from the Test-NetConnection

Ping multiple IP using PowerShell

Tracert

PowerShell Tracert

Tracert with PowerShell

Portscan with PowerShell

PowerShell Portscan

Use PowerShell to check for open port

NSlookup in PowerShell

PowerShell NSlookup

NSlookup using PowerShell:

Route in PowerShell

PowerShell Route

How to replace Route command with PowerShell

NETSTAT in PowerShell

PowerShell Netstat

How to replace NETSTAT with PowerShell

NIC Teaming PowerShell commands

Create a new NIC Teaming (Network Adapter Team)

SMB Related PowerShell commands

SMB PowerShell SMB Client Configuration

Get SMB Client Configuration

Get SMB Connections

Get SMB Mutlichannel Connections

Get SMB open files

Get SMB Direct (RDMA) adapters

Hyper-V Networking cmdlets

Hyper-V PowerShell Get-VMNetwork Adapter

Get and set Network Adapter VMQ settings

Get VM Network Adapter

Get VM Network Adapter IP Addresses

Get VM Network Adapter Mac Addresses

I hope you enjoyed it and the post was helpful, if you think something important is missing, please add it in the comments.



PowerShell Compress-Archive

Compress or Expand ZIP Archive using PowerShell

I was blogging about some of the new features of PowerShell 5 in several blog posts. Another great enhancement of PowerShell v5 is the Compress-Archive and the Expand-Archive cmdlets which allow you to compress or expand a ZIP archive.

To simply create a new ZIP archive using PowerShell you can use the following cmdlet:

To unzip the ZIP Archive you can use the following cmdlet:



PowerShell New-TemporaryFile

Create a tempfile with PowerShell

When I was using PowerShell in the early stages it was limited in some features, now with PowerShell version 5 Microsoft added some great new features to it. This time it’s about creating a tempfile. I already wrote a blog post in 2011 how you can create a tempfile in older version of PowerShell using .NET:

With PowerShell 5 you got a native cmdlet for this: