How to build Active Directory Domain in Hyper-V with Static IP Addresses

RNA-5508 1 Reputation point
2021-10-11T21:42:18.077+00:00

Hi,

I have a Windows 10 laptop with Hyper-v installed. It's connected to a home network using a built-in wireless card.

I have created 3 VMs running Windows Server 2019 with one of them being a Windows server 2019 domain controller

All VMs are initially connected to the default Hyper-V built-in switch where they receive a DHCP IP address and can access the Internet normally.

I need the three VMs to have their own "internal network" so I created a new Hyper-V "internal switch" and I added one more NIC to each VM.

The new NICs are all configured with a "static IP address" with the DNS pointing to the AD domain controller DNS service. The additional NICs are not configured with any "default gateway". Just IP Address/Subnet/DNS

Now the issue is that the "default switch" keeps changing the DHCP info for each VM "lease period is 1 day I think" which is creating issues when attempting to use RDP to these VMs.

Is there any way I can keep this "default switch" IP as static? I tried to do that from the NIC property but is that the only option.

Thanks

System Center Virtual Machine Manager
Hyper-V
Hyper-V
A Windows technology providing a hypervisor-based virtualization solution enabling customers to consolidate workloads onto a single server.
2,790 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Anonymous
    2021-10-11T22:29:33.84+00:00

    The simplest solution here is to use an external vSwitch. Domain controller and all members must use the static ip address of DC listed for DNS and no others such as router or public DNS so clients can find and logon to domain. Internet requests would be handed off to either the default 13 root hint servers or configured DNS forwarders.

    139635-image.png

    139625-image.png

    --please don't forget to upvote and Accept as answer if the reply is helpful--

    1 person found this answer helpful.

  2. Anonymous
    2021-10-11T21:45:36.02+00:00

    Don't use the default switch, create a new vSwitch
    https://blogs.technet.microsoft.com/jhoward/2008/06/17/hyper-v-what-are-the-uses-for-different-types-of-virtual-networks/

    multi-homing a domain controller will always cause no end to grief for active directory DNS.

    --please don't forget to upvote and Accept as answer if the reply is helpful--


  3. Anonymous
    2021-10-12T00:05:46.863+00:00

    Why the "external hyper-v switch" has changed the IP configuration on my Windows 10 laptop?

    Because the check box was checked for allow management operating system to share which is what you want but the default switch is going to complicate things. A better setup would be a server OS for host operating system as windows server does not have a default switch. You can setup the domain on an internal network but internet isn't going to be available on internal.


  4. Limitless Technology 39,781 Reputation points
    2021-10-13T08:28:11.56+00:00

    Hi there,

    You can set a static address in Control Panel > Network Connections > Change adapter settings by right-clicking the ethernet switch, but Windows will reset it to a random address after the reboot, and that action cannot be disabled.
    A solution could be to reset it always to the same value by using the netsh command or its PowerShell alternatives.
    Another solution would be to create a new switch, whose IP address will stay, unlike the default switch.


    If the reply is helpful, please Upvote and Accept it as an answer

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.