Assumption
- We use one NIC on the node as the public service network communication path.(192.168.1.0/24)
- We use another NIC to connect the VM’s in hpyer-V inside the closed network which does not face to any external network. (192.168.1.10/24)
- We would like to use 1st NIC to route the traffic toward the internet for packet coming from Closed network.
- packet is coming in 2nd NIC connecting to Closed network with going through 1st NIC getting the network Address translated and masked.
Step
- Log into Server via Administrator.
- Open Powershell in administrator mode.
- Check the network configuration.
192.168.10.2 is connecting to the closed network, hence the NAT internet network subnet is 192.168.10.0/24 - Execute the following command
> New-NetNat -Name NATfromInternalToExternal -InternalIPInterfaceAddressPrefix 192.168.10.0/24 |
- Confirm no error.
- Configure machine in NAT Closed network.
- You have two Hyper-V cluster machines providing the compute resource to VM connecting to Closed Network.
- Hyper-V node 1: 192.168.10.1
- Hyper-V node 2: 192.168.10.2
- Your VM host will need to have the Default gatewayconfigured with these two Hyper-V node NIC providing the NAT towards the external Network.
- Example node: 192.168.10.10/24
Default Gateway : 192.168.10.1 / 192.168.10.2
- Example node: 192.168.10.10/24
- The reason why two Hyper-V IP address is set to the VM is because the node may become offline anytime. So, the VM using the gateway service via hpyer-V NIC will need to be able to select one better by adding two IP addresses int Default Gateway.
Example: There is another node in Externally facing Network. From the Node inside the closed network, ping to such node and you will see the node outside of closed network reacts.
- You have two Hyper-V cluster machines providing the compute resource to VM connecting to Closed Network.