Linux Virtual machine can't ping Google, while Host can do it

11,467

Solution 1

As a workaround (or arguably a fix), disable any network offloading settings on the physical NIC on the host.

  1. Open Control Panel, System, Device Manager
  2. Expand "Network Adapters"
  3. Double-click on your physical NIC to bring up properties.
  4. Select the "Advanced" tab
  5. 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?

Share:
11,467

Related videos on Youtube

Ebrahim Ghasemi
Author by

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, 2022

Comments

  • Ebrahim Ghasemi
    Ebrahim Ghasemi over 1 year

    Assumptions:

    1. You have a Windows 7 Ultimate as your host.
    2. You have a Linux Kali 2 as a VMWare Workstation virtual machine on this host.
    3. Your network adapter is bridged on the VMWare(Version 10.0.3).
    4. Host IP address = 10.0.0.81
    5. Virtual Machine IP address = 10.0.0.38
    6. Host Gateway = 10.0.0.60
    7. Virtual machine Gateway = 10.0.0.60
    8. 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, have ICMP reply packets, but ICMP requests from the virtual machine haven't!

    What am I did so far?

    1. I replaced my host IP address with the virtual machine IP address, and vice versa, but nothing changed.
    2. I tried other virtual machines. For all Linux virtual machines I have this issue, while all Windows virtual machines are working fine!
    3. 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:

    enter image description here

    Kali Linux: enter image description here

    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!

    Look: enter image description here

    Any way I need to see the ping reply packet!

    • gogoud
      gogoud over 8 years
      this should be tagged vmware and you don't say what vmware software you are using.
    • Ebrahim Ghasemi
      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
      gogoud over 8 years
      see vmware.com/products. You mentioned a version number but not the software...
    • Ebrahim Ghasemi
      Ebrahim Ghasemi over 8 years
      @Archemar Sorry, that was a miswritten. Both are 10.0.0.60. I corrected it. Thanks.
    • Ebrahim Ghasemi
      Ebrahim Ghasemi over 8 years
      @gogoud Well, I have this problem for both virtual machines installed on VMware® Workstation and VMWare VSphere softwares.
    • Chris.C
      Chris.C over 8 years
      Turn off your Windows firewall and try to use bridge mode instead of nat.
    • Ebrahim Ghasemi
      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
      MariusMatutiae over 8 years
      What happens if you say, from Kali, ping -M dont 8.8.8.8? Does this work?
    • harrymc
      harrymc over 8 years
      To 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
      Squeezy over 8 years
      Can 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
      Ebrahim Ghasemi over 8 years
      @MariusMatutiae I tried ping -M dont 8.8.8.8. Returned nothing.
    • Ebrahim Ghasemi
      Ebrahim Ghasemi over 8 years
      @harrymc Yes, I tried Ubuntu too. Same result.
    • Ebrahim Ghasemi
      Ebrahim Ghasemi over 8 years
      @Squeezy I checked the logs, there is no dropped packet from 10.0.0.38 there!
    • Ebrahim Ghasemi
      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
      harrymc over 8 years
      You haven't answered whether turning off IPv6 is an option, even just as a test?
    • Squeezy
      Squeezy over 8 years
      That 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
    Ebrahim Ghasemi over 8 years
    What are these offloads for?
  • Steven
    Steven over 8 years
    Your 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
    Arthur Kay over 8 years
    Offloads 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
    Sebastian Nielsen about 3 years
    Your answer worked for me!