Linux Virtual machine can't ping Google, while Host can do it
Solution 1
As a workaround (or arguably a fix), disable any network offloading settings on the physical NIC on the host.
- Open Control Panel, System, Device Manager
- Expand "Network Adapters"
- Double-click on your physical NIC to bring up properties.
- Select the "Advanced" tab
- Disable all properties with "Offload" in the name (varies by network card).
NOTE: You may want to record the initial settings should you want to revert later.
Solution 2
Try using a static IP address, even if it is static, set a static IP at no-ip.com and then try to ping that IP from both machines. Also see if you can ping the router gateway?
Related videos on Youtube
Ebrahim Ghasemi
Passionate Java Card programmer with +6 years of experience in different security related topics, including cryptography, web application and network penetration testing and also reverse engineering. Having strong background in network traffic analysis, deep packet inspection,networking protocols and high-performance system programming.
Updated on September 18, 2022Comments
-
Ebrahim Ghasemi over 1 year
Assumptions:
- You have a Windows 7 Ultimate as your host.
- You have a Linux Kali 2 as a VMWare Workstation virtual machine on this host.
- Your network adapter is bridged on the VMWare(Version 10.0.3).
- Host IP address =
10.0.0.81
- Virtual Machine IP address =
10.0.0.38
- Host Gateway =
10.0.0.60
- Virtual machine Gateway =
10.0.0.60
- Virtual Machine and Host can ping each other and also the gateway successfully.
Problem:
While Host can ping
46.228.47.114
(Yahoo) successfully, the virtual machine can't! In the other words,ICMP requests
from host to Yahoo, haveICMP reply
packets, butICMP requests
from the virtual machine haven't!What am I did so far?
- I replaced my host IP address with the virtual machine IP address, and vice versa, but nothing changed.
- I tried other virtual machines. For all Linux virtual machines I have this issue, while all Windows virtual machines are working fine!
- I tried different versions of VMware® Workstation and VMWare VSphere softwares. Issue doesn't solved for my Linux virtual machines.
Differences between ICMP requests:
Windows 7:
As you see above, there are some difference between requests. Is these difference origin of the problem? If so, how can I handle it?
Note that:
Formerly I even can't ping the Gateway on the Virtual Machine! By sniffing I noticed that MAC address of gateway in the Virtual machine is not correct, so I set it statically with the correct value and after that I pinged it successfully. Now this is the new problem!
Update:
I'm just see that I have Internet access on the virtual machine! I only can't ping it!
Any way I need to see the ping reply packet!
-
gogoud over 8 yearsthis should be tagged vmware and you don't say what vmware software you are using.
-
Ebrahim Ghasemi over 8 years@gogoud Thank you. I changed the tags. what vmware software you are using: how many VMWare is there outside? (I even mentioned the version of VMWare).
-
gogoud over 8 yearssee vmware.com/products. You mentioned a version number but not the software...
-
Ebrahim Ghasemi over 8 years@Archemar Sorry, that was a miswritten. Both are
10.0.0.60
. I corrected it. Thanks. -
Ebrahim Ghasemi over 8 years@gogoud Well, I have this problem for both virtual machines installed on
VMware® Workstation
andVMWare VSphere
softwares. -
Chris.C over 8 yearsTurn off your Windows firewall and try to use bridge mode instead of nat.
-
Ebrahim Ghasemi over 8 years@Chris.C Thank you but I don't want to use the NAT mode.I want to solve the issue. Any way, I have the same problem for NAT too!
-
MariusMatutiae over 8 yearsWhat happens if you say, from Kali,
ping -M dont 8.8.8.8
? Does this work? -
harrymc over 8 yearsTo reduce the number of variables, turn off IPv6 on host and VM. Also on the router's internal network (if you can). Did you try another Linux distribution than Kali?
-
Squeezy over 8 yearsCan you provide the logfiles from the Kerio? Specifically check for "Packets dropped for some reason" ( see kb.kerio.com/product/kerio-control/security/… ). Windows and Linux ping utilities differ in a few things regarding the packets they send.
-
Ebrahim Ghasemi over 8 years@MariusMatutiae I tried
ping -M dont 8.8.8.8
. Returned nothing. -
Ebrahim Ghasemi over 8 years@harrymc Yes, I tried
Ubuntu
too. Same result. -
Ebrahim Ghasemi over 8 years@Squeezy I checked the logs, there is no dropped packet from
10.0.0.38
there! -
Ebrahim Ghasemi over 8 years@Squeezy Do you have any idea about the problem that I mentioned my last comment under the answer of this question: superuser.com/questions/997636/… - Gateway, returns the MAC address of its another NIC!
-
harrymc over 8 yearsYou haven't answered whether turning off IPv6 is an option, even just as a test?
-
Squeezy over 8 yearsThat is too specific. Packets could be dropped on the return path as well. Can you perform a tcpdump on the gateway for both pings?
-
Ebrahim Ghasemi over 8 yearsWhat are these offloads for?
-
Steven over 8 yearsYour Wireshark log indicated the header checksum fail may be caused by "TCP checksum offload." Some VMware forums posts indicated that disabling the offloads may be a solution. Did you try it? Did it work?
-
Arthur Kay over 8 yearsOffloads move stuff that is processed on the CPU for a virtual machine onto the physical NIC, like is done for the host. It helps network performance in super high load situations but is incompatible with many consumer NICs. When having this kind of issue, it's a great thing to try and has personally worked for me a few times.
-
Sebastian Nielsen about 3 yearsYour answer worked for me!