How ARP works in case of Virtual machine

arpmac addressvmware

As far as my understading goes MAC address is used to recognize a computer node in a LAN where as internet communications happen over IPv4 address. When a request comes from the internet to the gateway the packet has the destination IP address. Now the cached ARP table is looked up to see the corresponding MAC address. If not ARP broadcast request is sent to get the corresponding MAC address.

But in case of virtual machine(Windows XP) running on my CentOS both will have same MAC address but different IPV4 addresses. So how the packet will be delievred to the correct host?

Best Answer

I am assuming you're using "bridge-mode" for networking (your internal, virtual adapter is bridged to your host's physical adapter).

In any case (unless you explicitlly manually set them to the same address, which causes a lot of other problems), your guest (WinXP) machine will have a different MAC address than your host (CentOS). Due to bridge-mode, your host acts as an ethernet switch, and forwards packets to the guest.

So when an ARP broadcast comes, your host gets the packet and also forwards it to your guest machine. When packets for your host come, they are processed by your host's network stack. When packets for your guest come, the host forwards them to your guest, which then processes them as needed.

Related Topic