Help! Hyper-V can't obtain/change to a 192.168.x.x local IP address for web server

Dan Smith 1 Reputation point
2022-11-19T20:04:50.017+00:00

Hi, I run a couple of personal websites, and I'm new to Hyper-V and switched to it when I became disheartened using another virtual machine product. Everything is fine, I installed 2019 server, got PHP and MySQL and IIS working, and my site is installed but I can't get to it because the network segment on my router is 192.168.0.x, but the VM gives me a weird IP address of 172.17.244.245 using the default network switch. When I created a new network switch, and told it to use my network card, it gave me some other weird IP address that I cannot get to my website on and knocked my Win 11 host offline. I did a 'repair' on the network connection and that didn't seem to help, so I deleted and returned the settings back to the defaults, and still gives me the 172.17.244.x IP address. I need to add this to my router so that port 80 traffic can get to my web page but my router won't accept any IP out of the local network segment of 192.168.0.x!! I ask all the Hyper-V experts out there to help me obtain a 192.168.0.x IP address for my server and I will be eternally grateful and forever in your debt. I've lost 2 full days of traffic to my site so far, hopefully there will be no more loss after today.

Hyper-V
Hyper-V
A Windows technology providing a hypervisor-based virtualization solution enabling customers to consolidate workloads onto a single server.
2,536 questions
Windows DHCP
Windows DHCP
Windows: A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.DHCP: Dynamic Host Configuration Protocol (DHCP). A communications protocol that lets network administrators manage centrally and automate the assignment of Internet Protocol (IP) addresses in an organization's network.
1,021 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Dave Patrick 426.1K Reputation points MVP
    2022-11-19T21:16:29.673+00:00

    Server 2019 doesn't have a default switch. This sounds more like a desktop version of hyper-v. You can try creating a new external vSwitch. When you create a new external vSwitch the internet protocols are removed from the adapter and the Hyper-V Extensible Switch protocol is added turning that physical port into a multi-port virtual switch. Connect your VMs to this vSwitch and use each VM's vEthernet to configure the addressing in the exact same manner as if it were a physical NIC

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

    0 comments No comments

  2. Dan Smith 1 Reputation point
    2022-11-19T21:34:31.967+00:00

    I think I solved my own problem. I created a new network switch, but selected "Private" instead of External or Internal. Then it came up with a 192.168.0.x address. Seems to be working fine now!!

    0 comments No comments

  3. Dave Patrick 426.1K Reputation points MVP
    2022-11-19T21:36:16.863+00:00

    Sounds good,
    https://blogs.technet.microsoft.com/jhoward/2008/06/17/hyper-v-what-are-the-uses-for-different-types-of-virtual-networks/

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