Jump to content

Windows Hyper-V Virtual Switch issues

Hey guys, trying to keep this as short and simple as I can.

I am having an issue on my Windows server where my Hyper-V vm's cannot reach other machines on the network (ping).

 

When I created the vm's, Windows created a virtual switch with a preferred address of 169.254.XXX.XXX, but my subnet is 192.168.0.0.

 

When I assign a static IP address for my Linux vm's on the same subnet (192.168.0.0), I can see them as online on my Firewall (pfsense).

I added an IPV4 rule on my firewall to allow all traffic for the hyper-v switch (168.254.XXX.XXX), but still nothing

 

Anyone have any experience with Windows Hyper-V that can help me out? Stumped on this one.

 

 

My Gaming Rig: AMD Ryzen 5600x  |  Corsair H100i GTX  |  ASUS ROG Strix B450-F Gaming  |  32GB Samsung DDR4 3600MHz  |  ASUS RTX 3070 ROG Strix  |  WD Black 240GB NVMe  |  1TB Samsung 850 Pro SSD | 2TB Samsung Enterprise SSD  |  WD Black 1.5TB   |  3x NZXT Aer RGB 140MM  |  Seasonic Focus 750w   |  NZXT H500 Elite   |  Windows 10 Pro

 

My Home Server: AMD Ryzen 1400x  |  Gigabyte Aurora B550 Elite  |  32Gb Samsung DDR3 3200Mhz  |  HP RTX 2060 6GB  |  1TB Samsung 850 Pro  |  2x Seagate IronWolf Pro 18TB | 3x Seagate IronWolf Pro 4TB |  2x WD Green 2TB  |  Corsair CX650m  | Bitfenix Shinobi | Windows Server 2022

Link to comment
Share on other sites

Link to post
Share on other sites

Also when trying to ping, I get a:

PING 192.168.XXX.XXX (192.168.XXX.XXX) 56(84) bytes of data.
From 192.168.XXX.XXX icmp_seq=1 Destination Host Unreachable

 

My Gaming Rig: AMD Ryzen 5600x  |  Corsair H100i GTX  |  ASUS ROG Strix B450-F Gaming  |  32GB Samsung DDR4 3600MHz  |  ASUS RTX 3070 ROG Strix  |  WD Black 240GB NVMe  |  1TB Samsung 850 Pro SSD | 2TB Samsung Enterprise SSD  |  WD Black 1.5TB   |  3x NZXT Aer RGB 140MM  |  Seasonic Focus 750w   |  NZXT H500 Elite   |  Windows 10 Pro

 

My Home Server: AMD Ryzen 1400x  |  Gigabyte Aurora B550 Elite  |  32Gb Samsung DDR3 3200Mhz  |  HP RTX 2060 6GB  |  1TB Samsung 850 Pro  |  2x Seagate IronWolf Pro 18TB | 3x Seagate IronWolf Pro 4TB |  2x WD Green 2TB  |  Corsair CX650m  | Bitfenix Shinobi | Windows Server 2022

Link to comment
Share on other sites

Link to post
Share on other sites

24 minutes ago, KingCollins said:

Hey guys, trying to keep this as short and simple as I can.

I am having an issue on my Windows server where my Hyper-V vm's cannot reach other machines on the network (ping).

 

When I created the vm's, Windows created a virtual switch with a preferred address of 169.254.XXX.XXX, but my subnet is 192.168.0.0.

 

When I assign a static IP address for my Linux vm's on the same subnet (192.168.0.0), I can see them as online on my Firewall (pfsense).

I added an IPV4 rule on my firewall to allow all traffic for the hyper-v switch (168.254.XXX.XXX), but still nothing

 

Anyone have any experience with Windows Hyper-V that can help me out? Stumped on this one.

 

 

The 169.254 address range is reserved for private use and is typically assigned when a device can't reach a DHCP server. It sounds like the virtual switch doesn't have an external connection through the vm to your network and so isn't getting an IP address from the DHCP server. Make sure you're adaptors and virtual adaptors are all set up correctly in passthrough or bridged modes. I've not used hyper v too much, more of a vmware guy, but that should set you on the right path.

Hope that helps!

I ilke trains.

Link to comment
Share on other sites

Link to post
Share on other sites

Show us a screenshot of your Hyper-V Virtual Switch Manager. In general you only need a single switch of type External, with the correct physical network adaptor chosen. If you only have a single ethernet connection then make sure the checkbox for allowing the host to share the connection is checked.

 

EDIT: this page is a good rundown of Hyper-V Switches https://www.nakivo.com/blog/hyper-v-networking-virtual-switches/

 

EDIT2: as long as your VMs aren’t getting IPs from your router via DHCP, the network setup is not correct. Focus on getting DHCP to work, anything else like setting static IPs on VMs should be done afterwards.

Looking to buy GTX690, other multi-GPU cards, or single-slot graphics cards: 

 

Link to comment
Share on other sites

Link to post
Share on other sites

34 minutes ago, brwainer said:

Show us a screenshot of your Hyper-V Virtual Switch Manager. In general you only need a single switch of type External, with the correct physical network adaptor chosen. If you only have a single ethernet connection then make sure the checkbox for allowing the host to share the connection is checked.

 

EDIT: this page is a good rundown of Hyper-V Switches https://www.nakivo.com/blog/hyper-v-networking-virtual-switches/

 

EDIT2: as long as your VMs aren’t getting IPs from your router via DHCP, the network setup is not correct. Focus on getting DHCP to work, anything else like setting static IPs on VMs should be done afterwards.

Ok so, what I've done is removed the static rule from one of my Linux VM's and set it to DHCP, I also removed the reserved IP address in the firewall so that it request a IP address from the DHCP server. After a reboot, I can see that the VM was successfully able to assign an IP address from the DHCP server which is on the same subnet as my other machines. For example, both my server and VM is 192.168.0.XXX. But still, I cannot ping my server from the VM and vise versa.

 

Here is a screenshot of my Virtual Switch Manager:

server.PNG.2ee3ff330ced3bb19d967e227c90c26a.PNG

 

Would it have anything to do with the IP range of the DHCP server?

More information that might be helpful:

LAN IP range is 192.168.0.10-255

DHCP range is 192.168.0.10-200

IP Reserved Range is 192.168.0.200-255 (Router reserved IP addresses)

 

Thanks again for the help :)

My Gaming Rig: AMD Ryzen 5600x  |  Corsair H100i GTX  |  ASUS ROG Strix B450-F Gaming  |  32GB Samsung DDR4 3600MHz  |  ASUS RTX 3070 ROG Strix  |  WD Black 240GB NVMe  |  1TB Samsung 850 Pro SSD | 2TB Samsung Enterprise SSD  |  WD Black 1.5TB   |  3x NZXT Aer RGB 140MM  |  Seasonic Focus 750w   |  NZXT H500 Elite   |  Windows 10 Pro

 

My Home Server: AMD Ryzen 1400x  |  Gigabyte Aurora B550 Elite  |  32Gb Samsung DDR3 3200Mhz  |  HP RTX 2060 6GB  |  1TB Samsung 850 Pro  |  2x Seagate IronWolf Pro 18TB | 3x Seagate IronWolf Pro 4TB |  2x WD Green 2TB  |  Corsair CX650m  | Bitfenix Shinobi | Windows Server 2022

Link to comment
Share on other sites

Link to post
Share on other sites

4 minutes ago, KingCollins said:

Ok so, what I've done is removed the static rule from one of my Linux VM's and set it to DHCP, I also removed the reserved IP address in the firewall so that it request a IP address from the DHCP server. After a reboot, I can see that the VM was successfully able to assign an IP address from the DHCP server which is on the same subnet as my other machines. For example, both my server and VM is 192.168.0.XXX. But still, I cannot ping my server from the VM and vise versa.

 

Here is a screenshot of my Virtual Switch Manager:

server.PNG.2ee3ff330ced3bb19d967e227c90c26a.PNG

 

Would it have anything to do with the IP range of the DHCP server?

More information that might be helpful:

LAN IP range is 192.168.0.10-255

DHCP range is 192.168.0.10-200

IP Reserved Range is 192.168.0.200-255 (Router reserved IP addresses)

 

Thanks again for the help :)

that looks right to me. Is the DHCP server also a VM or is it a seperate node on the network?

I ilke trains.

Link to comment
Share on other sites

Link to post
Share on other sites

4 minutes ago, MCManiac52 said:

that looks right to me. Is the DHCP server also a VM or is it a seperate node on the network?

This is where I become quite the noob.

 

I recently built a pfsense firewall/router a few weeks ago which is the DHCP server.

 

I have a funny suspicion this is where the problem lies, but I haven't changed anything or applied any obscure rules.

 

Simple setup using the wizard with a firewall rule to PASS all traffic on the LAN network

My Gaming Rig: AMD Ryzen 5600x  |  Corsair H100i GTX  |  ASUS ROG Strix B450-F Gaming  |  32GB Samsung DDR4 3600MHz  |  ASUS RTX 3070 ROG Strix  |  WD Black 240GB NVMe  |  1TB Samsung 850 Pro SSD | 2TB Samsung Enterprise SSD  |  WD Black 1.5TB   |  3x NZXT Aer RGB 140MM  |  Seasonic Focus 750w   |  NZXT H500 Elite   |  Windows 10 Pro

 

My Home Server: AMD Ryzen 1400x  |  Gigabyte Aurora B550 Elite  |  32Gb Samsung DDR3 3200Mhz  |  HP RTX 2060 6GB  |  1TB Samsung 850 Pro  |  2x Seagate IronWolf Pro 18TB | 3x Seagate IronWolf Pro 4TB |  2x WD Green 2TB  |  Corsair CX650m  | Bitfenix Shinobi | Windows Server 2022

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, KingCollins said:

This is where I become quite the noob.

 

I recently built a pfsense firewall/router a few weeks ago which is the DHCP server.

 

I have a funny suspicion this is where the problem lies, but I haven't changed anything or applied any obscure rules.

 

Simple setup using the wizard with a firewall rule to PASS all traffic on the LAN network

pfsense you say. now that I have messed with. So lets just rewind quickly. So you have a vm in hyper v and a seperate physical machine (not the hyper v host) that are unable to ping each other, but both are getting DHCP IPs from the pfsense router. if that's the case, can the host ping the vm? can the vm ping the host? can the host ping the separate machine, and vice versa. Depending on what machines can ping what will help find the issue. Also if you run an Nslookup on the hostname of the vm on the other machines, do you get the IP address back?

I ilke trains.

Link to comment
Share on other sites

Link to post
Share on other sites

How are you seperating the LAN vs WAN traffic of the PFSense VM? Since you only have one virtual switch set up in HyperV, are you using VLANs? 

Looking to buy GTX690, other multi-GPU cards, or single-slot graphics cards: 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Levisallanon said:

did you disable the windows firewall on the VM first?

On this same train of thought, if you’re trying to ping a Windows VM, you either need to disable the firewall (not recommended except for testing) or enable the premade rule for ICMP: https://kb.iu.edu/d/aopy

Looking to buy GTX690, other multi-GPU cards, or single-slot graphics cards: 

 

Link to comment
Share on other sites

Link to post
Share on other sites

So, to start from the beginning, I have:

 

A physical Pfsense machine with a dual NIC, WAN and LAN:

  • WAN is DHCP from my ISP as we don't have a static IP address
  • A static LAN address of 192.168.0.1/24
  • LAN range is 192.169.0.10 - 256
  • LAN DHCP IP address range is from 192.168.0.10 - 200
  • 192.168.0.201 - 256 is reserved for "reserve IP addresses" (PFsense does not allow you to reserve IP address that are within the DHCP IP address range)

 

A physical Windows Server 2016 with 2 VM's:

  • Ubuntu 14.04 running in Windows Hyper-V (Static IP address)
  • Ubuntu 16.04 running in Windows Hyper-V (DHCP)

Unfortunately I am in work at the moment and I am connected to my home network via a VPN so I cannot test an actual physical machine on the network to the VM's or the host, but this is what I have so far, bare in mind my Work PC is connected via VPN:

  • Work PC to Windows Server = Sucessful ping
  • Work PC to 14.04 VM = Sucessful ping
  • Work PC to 16.04 VM = Sucessful ping
  • Windows Server to 14.04 VM = Destination host unreachable
  • Windows Server to 16.04 VM = Destination host unreachable
  • 14.04 VM to 16.04 VM = Sucessful ping
  • Both VM's to Windows Server = Destination host unreachable

Again I appreciate the help guys, sorry if I am a network noob. :/

 

 

My Gaming Rig: AMD Ryzen 5600x  |  Corsair H100i GTX  |  ASUS ROG Strix B450-F Gaming  |  32GB Samsung DDR4 3600MHz  |  ASUS RTX 3070 ROG Strix  |  WD Black 240GB NVMe  |  1TB Samsung 850 Pro SSD | 2TB Samsung Enterprise SSD  |  WD Black 1.5TB   |  3x NZXT Aer RGB 140MM  |  Seasonic Focus 750w   |  NZXT H500 Elite   |  Windows 10 Pro

 

My Home Server: AMD Ryzen 1400x  |  Gigabyte Aurora B550 Elite  |  32Gb Samsung DDR3 3200Mhz  |  HP RTX 2060 6GB  |  1TB Samsung 850 Pro  |  2x Seagate IronWolf Pro 18TB | 3x Seagate IronWolf Pro 4TB |  2x WD Green 2TB  |  Corsair CX650m  | Bitfenix Shinobi | Windows Server 2022

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, KingCollins said:

So, to start from the beginning, I have:

 

A physical Pfsense machine with a dual NIC, WAN and LAN:

  • WAN is DHCP from my ISP as we don't have a static IP address
  • A static LAN address of 192.168.0.1/24
  • LAN range is 192.169.0.10 - 256
  • LAN DHCP IP address range is from 192.168.0.10 - 200
  • 192.168.0.201 - 256 is reserved for "reserve IP addresses" (PFsense does not allow you to reserve IP address that are within the DHCP IP address range)

 

A physical Windows Server 2016 with 2 VM's:

  • Ubuntu 14.04 running in Windows Hyper-V (Static IP address)
  • Ubuntu 16.04 running in Windows Hyper-V (DHCP)

Unfortunately I am in work at the moment and I am connected to my home network via a VPN so I cannot test an actual physical machine on the network to the VM's or the host, but this is what I have so far, bare in mind my Work PC is connected via VPN:

  • Work PC to Windows Server = Sucessful ping
  • Work PC to 14.04 VM = Sucessful ping
  • Work PC to 16.04 VM = Sucessful ping
  • Windows Server to 14.04 VM = Destination host unreachable
  • Windows Server to 16.04 VM = Destination host unreachable
  • 14.04 VM to 16.04 VM = Sucessful ping
  • Both VM's to Windows Server = Destination host unreachable

Again I appreciate the help guys, sorry if I am a network noob. :/

 

 

Ah that makes it much clearer. So it looks like the issue is either going to be with the virtual switch not passing traffic between the host and VMs or the adaptor/virtual adaptor. I'd look at a guide on how to properly configure network adaptors on a server running hyper v with only 1 NIC. Or if your server 2016 box has multiple NICs, dedicate one to hyper v and one to windows.

I ilke trains.

Link to comment
Share on other sites

Link to post
Share on other sites

Has your Server multiple interfaces?

If so, which one has an IP-Address?

Link to comment
Share on other sites

Link to post
Share on other sites

Ok, I had thought the PFSense was a VM also. Given your setup, your Virtual Switch Settings look good to me. Does your server have just one ethernet port, or two? As @harry4742 says, what adaptor is the server’s IP defined on? If you just have one ethernet port, or just one ethernet cable plugged in, then I would expect the IP to be defined on a virtual adaptor created by HyperV (that’s what the checkbox for allowing the host to share the NIC does)

Looking to buy GTX690, other multi-GPU cards, or single-slot graphics cards: 

 

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, brwainer said:

Ok, I had thought the PFSense was a VM also. Given your setup, your Virtual Switch Settings look good to me. Does your server have just one ethernet port, or two? As @harry4742 says, what adaptor is the server’s IP defined on? If you just have one ethernet port, or just one ethernet cable plugged in, then I would expect the IP to be defined on a virtual adaptor created by HyperV (that’s what the checkbox for allowing the host to share the NIC does)

Well maybe that's my problem!

 

My server only has one NIC, and as you can see from the screenshot below, it's actually the other way around, it's the host ethernet adapter that the IP address is configured on. The virtual switch does not have a IP address.

 

Server interface:

server2.PNG.58a34d30ccde710a6f2dfb211d517ac5.PNG

 

Virtual Switch Interface:

server.PNG.1dfb0d2fb3f9bed4e869456941f2d640.PNG

My Gaming Rig: AMD Ryzen 5600x  |  Corsair H100i GTX  |  ASUS ROG Strix B450-F Gaming  |  32GB Samsung DDR4 3600MHz  |  ASUS RTX 3070 ROG Strix  |  WD Black 240GB NVMe  |  1TB Samsung 850 Pro SSD | 2TB Samsung Enterprise SSD  |  WD Black 1.5TB   |  3x NZXT Aer RGB 140MM  |  Seasonic Focus 750w   |  NZXT H500 Elite   |  Windows 10 Pro

 

My Home Server: AMD Ryzen 1400x  |  Gigabyte Aurora B550 Elite  |  32Gb Samsung DDR3 3200Mhz  |  HP RTX 2060 6GB  |  1TB Samsung 850 Pro  |  2x Seagate IronWolf Pro 18TB | 3x Seagate IronWolf Pro 4TB |  2x WD Green 2TB  |  Corsair CX650m  | Bitfenix Shinobi | Windows Server 2022

Link to comment
Share on other sites

Link to post
Share on other sites

11 hours ago, KingCollins said:

Well maybe that's my problem!

 

Somethings setup wrong, my setup looks like:

Physical device:

image.png.7459c6f985989bff46311058e85adcb3.png

 

Virtual Switch:

Capture.PNG.56ec26c5caf7a78029d3bd73239593b3.PNG

 

Here's what you do.

1. undo every setting change you made to the physical adapter.

2. Make the changes to the Hyper-v Adapter.

 

Link to comment
Share on other sites

Link to post
Share on other sites

19 hours ago, KingCollins said:

Well maybe that's my problem!

 

My server only has one NIC, and as you can see from the screenshot below, it's actually the other way around, it's the host ethernet adapter that the IP address is configured on. The virtual switch does not have a IP address.

 

Server interface:

 

 

Virtual Switch Interface:

 

Slightly off topic. Why are you hiding your internal IP address? No one can do anything with it. 

CPU: AMD Ryzen 5 5600X | CPU Cooler: Stock AMD Cooler | Motherboard: Asus ROG STRIX B550-F GAMING (WI-FI) | RAM: Corsair Vengeance LPX 16 GB (2 x 8 GB) DDR4-3000 CL16 | GPU: Nvidia GTX 1060 6GB Zotac Mini | Case: K280 Case | PSU: Cooler Master B600 Power supply | SSD: 1TB  | HDDs: 1x 250GB & 1x 1TB WD Blue | Monitors: 24" Acer S240HLBID + 24" Samsung  | OS: Win 10 Pro

 

Audio: Behringer Q802USB Xenyx 8 Input Mixer |  U-PHORIA UMC204HD | Behringer XM8500 Dynamic Cardioid Vocal Microphone | Sound Blaster Audigy Fx PCI-E card.

 

Home Lab:  Lenovo ThinkCenter M82 ESXi 6.7 | Lenovo M93 Tiny Exchange 2019 | TP-LINK TL-SG1024D 24-Port Gigabit | Cisco ASA 5506 firewall  | Cisco Catalyst 3750 Gigabit Switch | Cisco 2960C-LL | HP MicroServer G8 NAS | Custom built SCCM Server.

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, Abdul201588 said:

Slightly off topic. Why are you hiding your internal IP address? No one can do anything with it. 


Not too sure really! Force of habbit, I always hide everything. xD

My Gaming Rig: AMD Ryzen 5600x  |  Corsair H100i GTX  |  ASUS ROG Strix B450-F Gaming  |  32GB Samsung DDR4 3600MHz  |  ASUS RTX 3070 ROG Strix  |  WD Black 240GB NVMe  |  1TB Samsung 850 Pro SSD | 2TB Samsung Enterprise SSD  |  WD Black 1.5TB   |  3x NZXT Aer RGB 140MM  |  Seasonic Focus 750w   |  NZXT H500 Elite   |  Windows 10 Pro

 

My Home Server: AMD Ryzen 1400x  |  Gigabyte Aurora B550 Elite  |  32Gb Samsung DDR3 3200Mhz  |  HP RTX 2060 6GB  |  1TB Samsung 850 Pro  |  2x Seagate IronWolf Pro 18TB | 3x Seagate IronWolf Pro 4TB |  2x WD Green 2TB  |  Corsair CX650m  | Bitfenix Shinobi | Windows Server 2022

Link to comment
Share on other sites

Link to post
Share on other sites

It's fixed!

 

As all of you said, and most recently @Blake , something was up with my Hyper-V virtual switch. My main ethernet interface was assigned an IP address, but my virtual switch could not contact the DHCP. All I did was delete the existing virtual switch, created a new one and reconfigured my VM's and now everyone can ping everything! xD

 

My connection details are exactly as Blake's screenshots above.

 

Thanks again to everybody for the help! Will be back soon with my next screw up :) 

My Gaming Rig: AMD Ryzen 5600x  |  Corsair H100i GTX  |  ASUS ROG Strix B450-F Gaming  |  32GB Samsung DDR4 3600MHz  |  ASUS RTX 3070 ROG Strix  |  WD Black 240GB NVMe  |  1TB Samsung 850 Pro SSD | 2TB Samsung Enterprise SSD  |  WD Black 1.5TB   |  3x NZXT Aer RGB 140MM  |  Seasonic Focus 750w   |  NZXT H500 Elite   |  Windows 10 Pro

 

My Home Server: AMD Ryzen 1400x  |  Gigabyte Aurora B550 Elite  |  32Gb Samsung DDR3 3200Mhz  |  HP RTX 2060 6GB  |  1TB Samsung 850 Pro  |  2x Seagate IronWolf Pro 18TB | 3x Seagate IronWolf Pro 4TB |  2x WD Green 2TB  |  Corsair CX650m  | Bitfenix Shinobi | Windows Server 2022

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×