Trying to ping one VM's IP from another VM: Unable to reach target host


User 95

I have 2 VMs. One acts as a client and the other acts as a server. For the server VM, I set the IP address like this:

sudo ifconfig enp0s8 192.168.0.73/24 up

For the client VM, I set the IP address as follows:

sudo ifconfig enp0s8 192.168.0.77/24 up

I'm trying to make sure both the client and server are in the same subnet of the internal network.

Then I try to ping the server's IP from the client VM like this:

ping 192.168.0.73

However, I keep getting the " target host unreachable" error

Both VMs have 2 nework adapters. The first network adapter is a host-only adapter (both VMs have the same MAC address) and the second network adapter is an internal network adapter (both VMs have the same network name and MAC address).

What am I doing wrong?

Jim Durratt

What you are doing wrong is that both computers are using the same MAC. Don't do that. Using the same MAC-ID on different systems on the same network can have all kinds of surprising and unpredictable results.

So, I guess what is happening is this:

  • ping 192.168.0.73
  • What is the MAC-ID of 192.168.0.73? make an ARP request
  • Ah! The MAC-ID is my own adapter; so no need to send it over the network
  • On my own adapter, I get an ICMP echo request to 192.168.0.73, but mine is 192.168.0.77. Therefore, I will not answer this request (no ping pong).

Because Linux (like every OS I know of) keeps a cache for ARP, you can see the IP adder to MAC-id translation for that computer

arp -a

Related


Unable to route from one VM on LAN to host

free software server I'm frustrated/frustrated because I can't get postfix to work on one of the VMs. This is a "template" VM with which I have setup other VMs. The only difference I can really think of is what this VM is for, the ZoneMinder security software.

Unable to start new VM when copying from one XEN host to another

rubo77 On my Debian 10 (disruptive) XEN host, I'll use Debian jessie's Xen-VM to copy from an LVM snapshot into a new xen guest and try to boot it. Here is what I did: Copy the xen VM to test the dist-upgrade of the mail server first try I created a new mashin

Unable to connect to MySQL VM from host

oshirowanen I have a Ubuntu 18.04 Desktop 64 bithost. On this host, I created one using VirtualBox Ubuntu 18.04 Server 64 bit VM, installed MySQL on it, and created a MySQL user, a database, and a table. I have set the network adapter in this virtual machine t

Configure a VM to ping a VM in another subnet

charves I have a rather theoretical question, and I'm not very experienced with networking: condition: I have 4 virtual machines that must be configured. I am free to choose the operating system and virtual hardware specifications. VM 1 is in subnet 1, connect

Configure a VM to ping a VM in another subnet

charves I have a rather theoretical question, and I'm not very experienced with networking: condition: I have 4 virtual machines that must be configured. I am free to choose the operating system and virtual hardware specifications. VM 1 is in subnet 1, connect

Nginx web server on VM cannot reach host

oxweiwei My laptop is running Ubuntu 14.10 desktop and hosting a 14.10 server in a libvirtVM (using setup virt-manager) . I just installed it in minimal virtual server mode openssh-server. Once installed, I can easily SSH in and add the nginx stable PPA and in

Nginx web server on VM cannot reach host

oxweiwei My laptop is running Ubuntu 14.10 desktop and hosting a 14.10 server in a libvirtVM (using setup virt-manager) . I just installed it in minimal virtual server mode openssh-server. Once installed, I can easily SSH in and add the nginx stable PPA and in

How to get a VM's external IP from a VM

Gargan I have a GCP compute instance VM from which I want to get the instance's external IP? PS: gcloud is not set on the instance swear In a shell script: PUBLIC_IP=$(curl -s ifconfig.co) From the website: Please limit automatic requests to 1 request per min

Unable to ping Ubuntu VM from WSL2 Ubuntu

Saif Islam | I am trying to ping my Ubuntu VM from my WSL2 Ubuntu. The same ping problem occurs vice versa. Both ubuntu versions are 20.04.1. But I can ping the Ubuntu VM from my local Windows. From Windows to Ubuntu virtual machine From WSL2 Ubuntu to Ubuntu

How to connect a host on one NIC and a VM on another NIC

TNT I have a Win7 host with 2 NIC cards (no wireless) and 1 Win7 VM (Vmware) on the same host. I want to connect the host to the network using 1 NIC, and I want to connect the VM on a second NIC on a different network. For security reasons I don't want the VM