Hyper-V NAT network
- Create new internal switch
New-VMSwitch -SwitchName "NAT Switch" -SwitchType Internal - Get the
ifIndexof the new switch ``` PS C:> Get-NetAdapter
Name InterfaceDescription ifIndex Status MacAddress LinkSpeed —- ——————– ——- —— ———- ——— vEthernet (intSwitch) Hyper-V Virtual Ethernet Adapter 24 Up 00-15-5D-00-6A-01 10 Gbps Wi-Fi Marvell AVASTAR Wireless-AC Net… 18 Up 98-5F-D3-34-0C-D3 300 Mbps Bluetooth Network … Bluetooth Device (Personal Area… 21 Disconnected 98-5F-D3-34-0C-D4 3 Mbps
3. Set the IP range of the switch
New-NetIPAddress -IPAddress 192.168.42.1 -PrefixLength 24 -InterfaceIndex
4. Configure NAT networking
New-NetNat -Name NATNet -InternalIPInterfaceAddressPrefix 192.168.42.0/24 ```