Cannot set static IP for host machine after adding Hyper-V role

asked 2021-11-18T19:45:01.067+00:00
Omid Shojaee 101 Reputation points

On Windows Server 2022 Datacenter edition, we have enabled Hyper-V role. Before that the Ethernet interface of the server had 192.168.50.4 as the static IP address and it worked fine.

After enabling the role, the IPv4 settings of Ethernet interface is wiped out (the IPv4 is unchecked). There's a new interface named Hyper-V Virtual Ethernet Adapter and it is set to get the IP address from DHCP server. The issue is now we cannot use Remote Desktop and Server Manager to manage this server remotely because the IP address is not persistent across reboots.

And if we assign static IP (the same 192.168.50.4 we had before) to the Hyper-V Virtual Ethernet Adapter, the network disconnects.

Server has 4 NICs but only one is plugged in.

Hyper-V
Hyper-V
A Windows technology providing a hypervisor-based virtualization solution enabling customers to consolidate workloads onto a single server.
1,818 questions
No comments
{count} votes

1 answer

Sort by: Most helpful
  1. answered 2021-12-15T20:18:41.753+00:00
    Limitless Technology 37,291 Reputation points

    This can be likely happened after creating Virtual Switch , I will suggest you remove default virtual switch and create new Virtual switch with External as per below Microsoft article.

    Allow management operating system to share this network adapter -> Select this option if you want to allow the Hyper-V host to share the use of the virtual switch and NIC or NIC team with the virtual machine. With this enabled, the host can use any of the settings that you configure for the virtual switch like Quality of Service (QoS) settings, security settings, or other features of the Hyper-V virtual switch.

    https://learn.microsoft.com/en-us/windows-server/virtualization/hyper-v/get-started/create-a-virtual-switch-for-hyper-v-virtual-machines

    ---

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

    No comments