How to share one IP address among VMs on a Hyper-V Server?

Posted on

QUESTION :

My dedicated server came with one IP address. I installed Hyper-V Server 2019 on it, and I want to simultaneously run multiple VMs, each running Windows Server 20xx Standard. I’ll need to be able to remote desktop to each VM, as well as the host. I’m thinking I could change the port number that each VM listens to for RDC (https://docs.microsoft.com/en-us/windows-server/remote/remote-desktop-services/clients/change-listening-port). Would that work?

Next, for outbound TCP/IP from the VMs, since that uses ephemeral port numbers, what happens if 2 VMs try to make connections from the same port number? I know the odds are low, given how large the range is of ephemeral port numbers, but what would happen, and if it’s bad, what could I do about it?

Thanks in advance.

ANSWER :

You can set up a NAT network.

NAT Network helps Virtual Machines to access the External Host/Virtual Machines using Host computer IP address and port through Internal Switch (NAT Switch).

enter image description here

enter image description here

For more details about Hyper-V NAT network, you can refer to the following article:

Hyper-V Virtual Switch Using NAT Setup

Set up a NAT network

Leave a Reply

Your email address will not be published. Required fields are marked *