Hyper-V NAT Configuration / Windows 10 Environment
1. Configuration Environment
The configuration environment is as follows.
- NAT Network
- Network : 172.35.0.0/24
- Gateway : 172.35.0.1
- Switch Name : NAT-Switch
- Network Name : NAT-Network
- VM
- Address : 172.35.0.100
2. Switch Creation and NAT Configuration
> New-VMSwitch -SwitchName "NAT-Switch" -SwitchType Internal
> $AdapterName=(Get-NetAdapter -Name "vEthernet (NAT-Switch)").Name
> New-NetIPAddress -IPAddress 172.35.0.1 -PrefixLength 24 -InterfaceAlias $AdapterName
> New-NetNat -Name NAT-Network -InternalIPInterfaceAddressPrefix 172.35.0.0/24Execute the above commands in PowerShell with administrator privileges.
3. VM
| |
Configure the /etc/netplan/50-cloud-init.yaml file as shown in [File 1]. Since there is no DHCP Server in the Network configured with NAT, manual IP configuration is required.
$ netplan applyApply the changed Network configuration.