Setting up an Internal vSwitch, NATing in Microsoft Hyper-V

Powershell FTW

Being used to VMware Workstation, where NATing is a few GUI clicks away, I couldn’t find a GUI way of configuring it in Hyper-V. inside local outside hokey pokey; Turn yourself around I don’t mind the command line and actually prefer it sometimes. The PowerShell equivent didn’t end up being too bad. Not like the first time doing Cisco NAT from the CLI.

Setting up NAT

The first code block is the generic commands from the Microsoft reference document the second one is what I used in my lab. Create Internal vSwitch for NATNew-VMSwitch -SwitchName SwitchName” -SwitchType Internal Configure the NAT gatewayNew-NetIPAddress -IPAddress -PrefixLength -InterfaceIndex Configure the NAT networkNew-NetNat -Name -InternalIPInterfaceAddressPrefix What I Used in My Lab New-VMSwitch –SwitchName NATvSwitch” –SwitchType InternalNew-NetIPAddress –IPAddress -PrefixLength 24 -InterfaceAlias vEthernet (NATSwitch)”New-NetNat –Name myNATnetwork –InternalIPInterfaceAddres

There Can Be Only One

Windows (WinNAT) only supports one internal NAT subnet prefix, trying to create multiple NATs will place the system into an unknown state. (1)


https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/user-guide/setup-nat-network/ https://www.thomasmaurer.ch/2016/05/set-up-a-hyper-v-virtual-switch-using-a-nat-network/

Up next Windows Error 2 Occured While Loading Java VM, During Citrix Command Center Installation RSA Conference CCSP Crash Course, a Review
Latest posts Change Synology NAS Password from the CLI Free Git eBook Using Brew Bundle to Backup and Restore Mac App Store and Brew Apps Update macOS with an all in one alias Mac App Store Command Line Interface Update macOS with softwareupdate command Markdown Crash Course Video What’s New with Fusion and Workstation [HCP1833] File IO in Python Overview of vSphere 7 Video What is ISO? Migrating Website HTML details Tag Microsoft RD Client iOS App Create VMware ESXi USB Install Media Intel NUC Lab Hosts Hardware Setup Installing Microsoft SQL 2016, and Management Studio Deploy VMware vCenter Appliance (VCSA) Installing the First Two Domain Controllers in the VMware ESXi 6.7 Lab Environment Macchanger Utility, and Usage Install a Kali Linux VM in a VMware ESXi 6.7 Environment Install Ubuntu 18.04 Virtual Machine in a VMware ESXi 6.7 Environment Install xRDP on Ubuntu 18.04 Install Chromium on Ubuntu 18.04 Install OpenSSH on Ubuntu 18.04 Install VMware Workstation 14 on Ubuntu 18.04 Nested ESXi server Laboratorium Rattus The Animal Within Who is Veeam? RSAC OnDemand Videos Create a Windows 10 Sandbox VM on VMware Workstation 14