5

I have an external ethernet switch which I'm using to connect to my VM. I'm able to access internet on my local VM. The problem is that I'm not able to ping it.

I've done the following after reading through many posts asking the same question:

  1. Assigned a static IP to my local VM.
  2. Opened all the local ports on my VM.

Still I'm not able to ping. What can I do to resolve this? Please let me know if you need more information from me.

Thanks.

Screenshots:

ipconfig host: enter image description here

local vm ip: enter image description here

ethernet switch: enter image description here

ping result: enter image description here

Firewall rule on vm: (Allow all local ports) enter image description here

90abyss
  • 169
  • 1
  • 1
  • 5
  • Why do you need to be able to ping your VM? – joeqwerty Jan 19 '17 at 01:39
  • I'm deploying a build and for that I need to be able to ping the VM. – 90abyss Jan 19 '17 at 01:40
  • That doesn't make sense. You need to communicate with the VM over the network, but why do you specifically need to ping the VM? Does your "build" utilize ICMP Echo Request/Reply? – joeqwerty Jan 19 '17 at 01:41
  • All I'm trying to do is follow some guy's documentation in my workplace that tells me that I need to be able to ping the VM to process further. I honestly know nothing else. – 90abyss Jan 19 '17 at 01:45
  • It would help me tremendously if someone could tell me how to do it. I don't have enough context on the why part of it yet unfortunately. – 90abyss Jan 19 '17 at 01:46

3 Answers3

7

It sounds like the document is instructing you to use ping as a method of validating network connectivity, which it isn't unless you know that ping should work in the first place, which it doesn't by default in Windows. If you're going to use ping as a method of testing network connectivity then the document needs to reflect the steps needed to ensure that ping works, which includes making changes to the Windows Firewall.

My issue with using ping as a catch all network connectivity test is that more often than not people spend an inordinate amount of time troubleshooting ping instead of focusing on troubleshooting the actual problem.

If you want to use ping to validate network connectivity then make sure you modify the Windows Firewall appropriately.

That being said, getting ping to work has almost no value in making sure your actual application/service works.


OK, based on your screenshots I see where your problem is. It's in your firewall rule. PING is neither TCP nor UDP, it's ICMP. You need to modify the appropriate firewall rules to allow ICMP inbound based on the network/firewall profile in use on the client.

enter image description here

joeqwerty
  • 109,901
  • 6
  • 81
  • 172
  • Thanks! How do I modify the firewall appropriately? I already have all the local ports including the Echo request - ICMP open. What else can I do? – 90abyss Jan 19 '17 at 01:56
  • Post a screenshot of your virtual switch. Post a screenshot of the ip configuration of the host and the VM. Post a screenshot of your ping test. Are the firewall rules enabled for the appropriate network/firewall profile? – joeqwerty Jan 19 '17 at 02:00
  • i just edited my post with screenshots. Can you please take a look? Thanks. – 90abyss Jan 19 '17 at 21:36
  • For those also unfamiliar with Windows Firewall, you can find the rules to allow ping (those in the screenshot) here: Control Panel → System and Security → Windows Defender Firewall → Advanced settings → Inbound Rules → File and Printer Sharing (Echo Request - ICMPv4-In) – Grilse Jun 02 '20 at 21:31
4

For Windows 10 also look into Network Discoverability Settings on the VM which could be blocking the connection

Settings->Network & Internet->Wi-Fi -OR- Ethernet

Click on your Network Name

Under Network Profile, Select Private instead of Public

Matt Kneiser
  • 419
  • 4
  • 4
0

If you can ping host from Hyper-V VM, but vice versa. If your Hyper-V VM is Windows 10 system, then you may try to click Open Network & Internet settings on the right bottom corner on the desktop. Then click Network and Sharing Center. On the left panel, click Change advanced sharing settings and then choose Turn on network discovery

oscarz
  • 101
  • 2