|# Create new switch|
New-VMSwitch -SwitchName NAT -SwitchType Internal
# You can find the interface index by running:
# Run the following to create the NAT Gateway:
New-NetIPAddress -IPAddress 192.168.4.1 -PrefixLength 24 -InterfaceIndex 53
# Configure the NAT network
New-NetNat -Name NAT -InternalIPInterfaceAddressPrefix “192.168.4.0/24”
# Add a static mapping to a NAT
A static mapping enables an incoming connection from an external network to access a host on an internal network through the NAT.
Add-NetNatStaticMapping -NatName NAT -Protocol TCP -ExternalIPAddress "0.0.0.0/24" -ExternalPort 80 -InternalIPAddress "192.168.4.20" -InternalPort 80
One thought on “Configuring NAT for Hyper-V VMs”
Yess sure dear. Do you have any Enid blyton books?