Create a Virtual Internal VS with NAT Network in Hyper-V

Step-by-Step Instructions

This guide walks you through creating aย Hyper-V Internal Virtual Switch with NAT support for use in labs or test environments โ€” useful for setting up isolated virtual networks.

๐Ÿ”ง 1. Open PowerShell as Administrator

All commands below require elevated privileges.


๐ŸŒ 2. Create a New Virtual Switch (Internal)

New-VMSwitch -SwitchName "LabSwitch" -SwitchType Internal

๐Ÿ” 3. Get the Interface Index of the New Adapter

Get-NetAdapter

๐Ÿ“ก 4. Assign a Static IP Address to LabSwitch

New-NetIPAddress -IPAddress 10.0.0.1 -PrefixLength 24 -InterfaceIndex 49

๐ŸŒ 5. Create a NAT Network

New-NetNat -Name "NatSwitch" -InternalIPInterfaceAddressPrefix 10.0.0.0/24

๐Ÿงน Optional: Remove Network Components

โŒ Remove the Virtual Switch
Remove-VMSwitch "LabSwitch"
โŒ Remove NAT Object(s)
Get-NetNat # List all existing NATs Remove-NetNat -Name "NatSwitch"

๐Ÿง  Tips

  • Attach virtual machines to the LabSwitch virtual adapter to place them on the internal NAT network.

  • VMs will use 10.0.0.1 as their gateway for internet access via NAT.

  • Use DHCP manually or statically assign IPs in the same subnet (10.0.0.x/24).


Revision #2
Created 14 July 2025 16:25:10 by Admin
Updated 15 July 2025 22:35:59 by Admin